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:

Creating a VB Script


Matthew
 Share

Recommended Posts

I've been wondering if it would be possible to create a vb script to complete a repetitive task that I perform with Mastercam.

 

Here are the steps I'm looking to perform upon executing the script:

 

1. open file "template.mcx"

2. open an "import" window to select a SLDPRT file to import

3. Import the SLDPRT File

4. Save the imported SLDPRT file as an MCX file with the same name as the file that was imported.

5. Change the machine group name and the first toolpath group name to match the name of the file

 

Is it possible to do this with a VBScript? If so could someone point me to some resources to read up on these, and possibly hint at some of the commands I might use for these steps?

 

Thanks,

 

Matt.

 

 

(I posted this in the developer's forum but there haven't been any responses so I thought I'd post here also!).

Link to comment
Share on other sites

Matthew, This would be very easy to do. You could put most of the pieces together yourself just from the examples that are included with mastercam. Look in the VB directory of whatever version you have installed. If you have any specific questions I'm sure that they will be answered here or you can e-mail me at my profile address.

Have fun with the vb side.

Karl

Link to comment
Share on other sites

Hello Matthew,

 

I do geometry creation and toolpathing with VB script, and it works awesome.

Along with the examples in the vb folder, my best resource is the VBScript.html

in the help folder. (or the VBSCRIPT.DOC)

 

Example functions prototypes from the VBScript.html that might help you:

 

// open a Mastercam file

 

Bool OpenMC(

 

String (Input: the path and name of the Mastercam file name)

 

)

 

 

// Import ANY file type (IGES, STEP, DWG, DXF, Pro/E, Inventor, etc)

 

// into the current Mastercam session

 

Bool ImportFile(

 

String (Input: the file name)

 

)

 

// save the current Mastercam file

 

Bool SaveMC(

 

Bool (Input: save the current screen image inside the file?)

 

)

 

// Create a group from the name

 

BOOL CreateGroupFromName( BSTR name);

 

Best of luck,

Joe

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