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:

vb script : is it possible to duplicate a group of operations?


Recommended Posts

There aren't any subs that directly copy entity Groups. But you could try creating a new group with CreateGroupFromName(), then loop through the database, retrieve each entity, make a copy of it (and grab its ent pointer to make it the currently selected entity) and then add it to your new group with AddCurrentEntToGroup().

 

I don't see any subs for copying operation groups, though.

 

HTH

Link to comment
Share on other sites

That's right bullines! I want to automatize all the process of make multi posting. We own 4 different cnc machines so we have 4 posts. I want to define all the operations needed for 1 machine and I want to automatize all the process for the 3 others machines:

 

- copy the content of the group (operations) to 3 new groups (1 group per cnc machine)

- modifiy the wcs for each specific cnc machines

- update tool number from a cnc machine to another

- select the post for each cnc machines

- post the program for each cnc machines

 

Bill.

Link to comment
Share on other sites

I'll reply to each point in the process:

 

quote:

- copy the content of the group (operations) to 3 new groups (1 group per cnc machine)


I can't find any ability of Mastercam VBS to be able to copy operations. Anyone from CNC Software have some insider info? wink.gif

 

quote:

- modifiy the wcs for each specific cnc machines


WCS is another thing that Mastercam VBS doesn't appear to have any access to. You can call up the WCS dialog from VBS, but that's all that I can see. C-Hooks do have access to WCS (the WCSinfo structure in m_avars.h comes to mind). Again, anyone from CNC Software have some neat-o bandito tricks?

 

quote:

- update tool number from a cnc machine to another


There are "get" subs for tool data, but no "sets" available to Mastercam VBS. You can, however, launch the dialog to create a new tool using either DefineNewTool() or EditTool(). For extra automation, you could try using the SendKeys() method of a WSH Shell object. Keep in mind, sometimes Mastercam exhibits some weird window behavious and you have to send the keystrokes in reverse order. banghead.gif

 

When dealing with tools, I've actually found it easier to export tool libraries as TXT files and parse out what I need that way; you have access to more tool data than the "get" subs give you. I then use that parsed data with the "Make[OPERATION]" subs (not "Make[OPERATION]WithKnownTool()") to create ops. Getting tool data back into Mastercam, though, as a binary library can't be automated.

 

quote:

- select the post for each cnc machines


Now this, Mastercam VBS can handle. You can hard-code the posts' filenames in, read it in from an external data file, read it in from the Windows Registry or prompt the user to select them with AskForFileName(). The choice is yours.

 

quote:

- post the program for each cnc machines


Piece o' cake. Use RunPost() to post individual operations (loop or grab operation ids/names) or RunPostAll() to post everything.

 

HTH

Link to comment
Share on other sites

quote:

I can't find any ability of Mastercam VBS to be able to copy operations.

quote:

WCS is another thing that Mastercam VBS doesn't appear to have any access to.

quote:

but no "sets" available to Mastercam VBS.

I wonder if it might be easier to just parse an NC file to get what you want... headscratch.gif

Link to comment
Share on other sites

quote:

I wonder if it might be easier to just parse an NC file to get what you want...


Yup. If all of the math for the WCS is worked out, it would probably be easier to just work with the NC file. Then he'd be able to choose any dev environment he wants, since he can work outside of Mastercam (I recommend Python or a .NET language wink.gif ). RegEx could come in handy wink.gif

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...