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:

Feedback wanted - Mastercam VBScript


Recommended Posts

VBScript functionality in Mastercam has been available for a while and we would like to hear what you guys and gals are doing with it. We know a few of you are using VBScript based on your postings here and e-mails to [email protected] but what specifically are you using it for? Are you developing simple scripts or advanced script projects? Will you be writing scripts in the near future or you have no idea what we are talking about?

 

We look forward to your replies, post away!

Link to comment
Share on other sites
  • Replies 67
  • Created
  • Last Reply

Top Posters In This Topic

I'm not sure what VB script is either. I think we can write macros in it for things that are done repeatedly. But I could use some examples or something then I might be able to figure it out. If someone could post some examples that would be great. Do we need to know visual basic to use it? How hard or easy would it be to learn VB script in Mastercam? ie: learning curve or time spent trying it. I'm sure it will vary quite a bit but a ballpark window would be nice.

Link to comment
Share on other sites

quote:

what you guys and gals are doing with it

Hi Mick,

nice to know you guys are asking the end user's what our thoughts are. as for me VB is on my list of things to learn. I have used some of the samples just to see whats going on. as with anything I need somthing to apply it to before diving in head first. I have self taught most all computer apps to myself. currently I am building knowledge of post editing, with help from the forum cheers.gif things are coming along well. the more peeps we have programming here the more I see a need to be able to do these kind of things. mostly to help them and at the same time learning somthing new myself.

Link to comment
Share on other sites

For those of you that are new to Mastercam VBScript there are a number of examples installed with Mastercam V9.1, these examples can be found in your mcam9VB folder. To run a script you will need to run the chook (ALT+C) mcamvb.dll and a dialog will display, from this dialog you can either create a new script, edit a selected script or run a selected script. To run a script browse and select any of the examples and then run it to see what it does. To look at the script repeat the process of running the chook and after selecting the script click the Edit button to load the script in to Mastercam's VBScript editor.

 

If you are familiar some kind of programming language be it MS Office VBA macros (Word Excel, etc), Lisp, Basic, etc., then you should not have much difficulty picking up VBScript. There is a list of online resources in the Mastercam VBScript Editor's help file under FAQ's that will certainly be of help.

 

Remember that in order to take full advantage of VBScript within Mastercam you need to be familiar with Mastercam to begin with.

Link to comment
Share on other sites

RStuart,

 

VBscript in Mastercam can be used in a number of ways, from simple multi-command 'shortcut' scripts to creating geometry and toolpathing 'on-the-fly'.

 

Let's say, for example, you draw a mold base that has four bushings and four pry-slots at each corner and you have 10 different mold sizes that are to be created. The height and width are parametric, the bushings are always a set distance from each corner as are the pry slots. You could create a 'master' mold drawing and then modify/offset that for each different size mold you need or have a script take the width and height dimensions and automatically create the geometry positioning all the bushings and pry-slots accordingly. To take it a step further you could then apply roughing operations to the bushing locations and pry-slots at the same time. This process would take just a few seconds to accomplish and will be correct each time you run the script, assuming the script is correct of course wink.gif

Link to comment
Share on other sites

Mick,

 

I have been "playing around with it" a little bit. Working backwards from the examples and the scripts posted on the forum. I have not created any of my own yet.From what you just said. I not only want to learn it, but also need to. What would you recommend for a good beginners book to buy to get me going a little more? I wish I could take a course, but the time right now just isn't available.

 

Rob

Link to comment
Share on other sites

robk,

 

I would recommend picking up a book on Windows Scripting to get a taste of what vbscript can do. Once you begin to get familiar with the syntax, keywords, functions, etc., you should be ready to move into Mastercam vbscripting. You have already started playing with the example scripts included with v9.1 which is good and as you learn more about scripting the examples should start to become clearer and easier to understand. This forum is also a great resource, we have a number of end users and resellers writing scripts and they are more than happy to share their experiences here.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

I'm in the process of creating a "Wish List" of things I do often that could be automated. From that list I will then be creating VBScrips. I would like to know if the Visual Basic book from Wrox would be a good resource for me.

Link to comment
Share on other sites

Mick

we are very excited as to the possibilities of vb and mastercam. We very much want to offer our customers parametrics for entrance doors and windows. I was speaking with Rich Taft last Friday, (perhaps you remember I met you outside during lunch)we have an outline for a door interface perhaps you would like to see it?

regards

George

Link to comment
Share on other sites

quote:

I have been "playing around with it" a little bit. Working backwards from the examples and the scripts posted on the forum. I have not created any of my own yet.

same here. Ive messed around a bit, but not much. Not sure if I could use it in what I do, but I'm sure there are a few things I could use scripts on that I justr havent thought of yet. Either way, its definately something I've been meaning to sink my teeth into.

Link to comment
Share on other sites

I just started playing with it this week. We are trying to create an HTML setup sheet - in conjunction with mp_multi post. The post calls a script that creates a metafile within mastercam and then converts it to a png file for inside the html page. We post a lot of single toolpaths - not whole operations. I need to figure out how to do is backplot a selected toolpath at post time so that the image I create only shows the posted toolpath and not all the toolpaths in the operation. You can turn off the toolpath from the operation manager and this works - but it would be nice to have that programmed into the script. Any ideas???

 

 

I don't like the graphical setup sheets inside of masterCAM - on a large job they can take 15min to load and then its print, hardcopy, do-it, next op - print, hardcopy, do-it, rinse, lather, repeat, etc.... smile.gif

Link to comment
Share on other sites

quote:

Now Making web pages with MS frontpage

eek.gif

 

I've made several scripts I use all the time. I've made several others for testing purposes to see what I can and can't do before I commit to making some of the things I have in mind.

 

Some of the scripts I made are very simple, but the one that I use the most are using the advantages of File System Objects and executing external programs. The archiver script that I have running winzip's command line interpreter is a godsend. The script date/time stamps the MC9 file, looks for a zip file with the same name less the date stamp, and creates a .zip file (or adds to an existing one if found) and puts the date stamped MC9 file into the .zip file.

 

'Rekd teh TMI

Link to comment
Share on other sites

robk

 

Good question. This posting is one way for us to gauge the level of interest with vbscript and our end users. If classes were in great demand then perhaps, but this is a not a decision I can make. What I can say is that in the event that there were classes they would be 'how to write Mastercam VBScript' and not 'how to write VBScript'. There would be pre-requisites for a student to attend, they would need to have some hands on Mastercam experience and they would be somewhat familiar with vbscript or have prior/current experience writing code in a programming language.

 

So my question to you guys, would you be interested in a Mastercam VBScript class? What would you like to see covered in a class? What areas of Mastercam VBScript interest you?

Link to comment
Share on other sites
Guest CNC Apps Guy 1

quote:

Unless you are going to be developing ActiveX DLL's in VB6 for your script dialogs...

eek.gifeek.gifeek.gif

 

That's a ways off yet. biggrin.gif

 

James "teh novice Computer Programmer"

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