Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Change All machines in a file


Recommended Posts

We have all of our different ops, in seperate machine groups, so one machine can do the front and one can do the back etc, but most of the time it goes to the same machine for all the ops. I would like to change every machine group operation to the same machine definition at once. Eventually working up posting for all, but the post all script looks like it has one machine def. and the .pst changes. We are set up for seperate machine deg, and .pst. If there is better ways then let me know by all means. Thank you.

Link to comment
Share on other sites

After looking through the VBScript API it appears as though this is not possible, however, I believe we can do something using our .NET API.

 

Below is a code snippet that will iterate all mill operations in the current drawing and update each with a new machine definition which is what you are after.

 

code:

 //Get all mill machine groups in current drawing

Group[] existingMillGroups = SearchManager.GetGroups(ProductType.Mill);

// Iterate through the list

foreach (Group grp in existingMillGroups)

{

//We only want machine groups

if (grp.IsMachineGroup())

{

//Set this machine group as current

grp.SetAsCurrent();

//Assign new MMD to this group

Mastercam.Operations.OperationsManager.ActiveMachine = "C:mcamx4cnc_machinesMILL 3 - AXIS VMC.MMD";

}

}

I guess the next question is how are you to specify what machine def you want to set for all machine groups? Do you want the user to select from the machine defs contained in the drawing or from another location?

Link to comment
Share on other sites

I am new at programming .net, and not so good at others but I try. I would like to hard code the machine definition. I want to click once and be done. I have accomplished this in VBS, but only if there is one machine group. The logic I would follow in VBS:

code:

Def Counter

Def MachineDef

Counter = 1

Do While Counter < 6 'five machines

If Counter = 1 then

MachineDef = "C:....Bosto.MMD

ElseIF Counter = 2 then

MachineDef = "C:....Okuma.MMD 'and for 3 more

End IF

' What you can do in your .NET API

' but setting the active machine to

' The MachineDef String and then PostAll()

 

Counter = Counter + 1

Loop

I'm sure that logic is clear as mud, and there is likely better ways, but I am open to any suggestions if you have the time.

Link to comment
Share on other sites

The drawings that contain the various machine defs, are they all contained in all drawings? If so I would be easy to display a list of them in the drawing to the user and have the user select one and then apply to all machine groups.

 

Can you send me a sample(s) drawing via e-mail and I'll whip something up for you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...