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:

Import operation and select drive surfaces with vbscript?


Recommended Posts

Hi All,

I am using mastercam x3 and i was wondering if it is possible with vbscript to import a surface rough pass tool operation from a saved operation file and then automatically select the drive surfaces for the operation. I have worked out how to do this with a simple contour path on curves in my model but I have not had any luck performing similar task automatically on a surface rough/finish toolpath.

Any advice/information on this topic would be really helpful.

Link to comment
Share on other sites
  • 11 months later...

Hello Mick,

 

 I was wondering if the status has changed with the vbscript api reguarding surface programming and if not, is it possible another way?

 

We are no longer actively developing our VBScript API so we encourage our users to move to our NET-Hook API. We have just recently added a two documents on our site under the 3rd Party Developers page that gives an introduction to VB.NET and C# NET-Hooks so you may want to take a look at those.

 

In regards to surface programming, we do have some surface capabilities with our NET-Hook API but it really depends on what you are looking to do.  Our C-Hook SDK is more mature and as such is much larger with a lot more functionality, however the learning curve for C-Hook development is a lot higher and there are specific requirements based on what version of Mastercam you are targeting so keep that in mind. We are working on an Introduction to C-Hook document to accompany our other Intro documents and it should be available early next week.

Link to comment
Share on other sites

Mick,

 

 I recently downloaded Visual Studio 2013 Express and the c# template to start playing with ..I am tring to develope some

automatic toolpath routines. Probably a question you have heard before, can I have a solid model, grab a curve, grab a 3d toolpath and crunch the path thru scripting, programming, macro? I was able to easily achieve this thru simple macros in powermill..Any advice would be appreciated.. Is it possible to do thru chook,nethook? 3d surface ? using version x8..

 

Thank you for your time,

Greg

Link to comment
Share on other sites

I would like to have mastercam analyze geometry...minimum radius, surface draft, z depth, and use said criteria for toolpath set-up..Im dealing in electrode creation with Solidworks and programming with Mastercam...loving the improvements in x8 as far as the rest rough stuff is concerned!! Great Job on that for sure... It seems I should be able to develope a one click solution as far as toolpathing, if i had access to call toolpaths and set parameters off of geometric parameters, It could be done..I understand the depths at which one could dive down too with the chooks and I dont mind that if it will do what i need it to do..So I guess my question is....Is it possible through one of the methods provided? I already have tool tables set, toolpath parameters set...etc...etc.. I have a script that will walk you through the programming process, but still involves a lot of user input..

Link to comment
Share on other sites

Mick,

 

 I recently downloaded Visual Studio 2013 Express and the c# template to start playing with ..I am tring to develope some

automatic toolpath routines. Probably a question you have heard before, can I have a solid model, grab a curve, grab a 3d toolpath and crunch the path thru scripting, programming, macro? I was able to easily achieve this thru simple macros in powermill..Any advice would be appreciated.. Is it possible to do thru chook,nethook? 3d surface ? using version x8..

 

Thank you for your time,

Greg

 

I would highly recommend installing the free Visual Studio 2013 Community Edition, it is essentially a Professional level of Visual Studio that has superior debugging and supports custom templates and a ton of other features. The Community version can be used for all NET-Hook development and Mastercam X9/2017 C-Hook development.

 

From what you describe you would likely need a C-Hook to do this, I recently up loaded an Introduction to C-Hook's document to mastercam.com under the 3rd Party Developers link that you should read through, it will explain what you need to do in order to build and debug a Mastercam X9 NETHook. Note that for Mastercam X8 you will need a Professional level of Visual Studio 2010 due to the tool set required but this is mentioned in the document.

Edited by Mick from CNC Software Inc.
Link to comment
Share on other sites

I would like to have mastercam analyze geometry...minimum radius, surface draft, z depth, and use said criteria for toolpath set-up..Im dealing in electrode creation with Solidworks and programming with Mastercam...loving the improvements in x8 as far as the rest rough stuff is concerned!! Great Job on that for sure... It seems I should be able to develope a one click solution as far as toolpathing, if i had access to call toolpaths and set parameters off of geometric parameters, It could be done..I understand the depths at which one could dive down too with the chooks and I dont mind that if it will do what i need it to do..So I guess my question is....Is it possible through one of the methods provided? I already have tool tables set, toolpath parameters set...etc...etc.. I have a script that will walk you through the programming process, but still involves a lot of user input..

 

When you say you have a script are you referring to a Solidworks macro or a Mastercam VBScript?

Link to comment
Share on other sites

Mick,

 

  It's a simple mastercam script that runs you through a series of runmastercam commands very rudimentary but it saves alot of work and it allows me to program a trode rather quickly..I just tried the c++ template in vs 2010 pro and it will only build if i aim it at the v7 sdk..when I aim it at the v8 sdk,,,errors...not sure i understand. you mentioned to use 2010 for x8 chooks, not sure of whats happening.. Already downloaded all the chook sdk stuff last night, plowing through it now..

 

thanks,

Greg

Link to comment
Share on other sites

also, I dont see the point in starting into net hooks if they are not capable of what i need done..?

 

Yes thats fine, first thing with a new project is to determine if it can be done in the .NET API and if not it should be possible with the C-Hook SDK so go with that. The main difference, depending on the add-in complexity, is the turnaround time will very likely be longer with C-Hook development and you won't have access to all the juicy .NET framework namespaces.

Link to comment
Share on other sites

Mick,

 

 First off, thank you for the quick reply! I shure do appreciate the help. After compiling the .dll when I execute it in mastercam, I am getting an unknown filetype error. We are using x7 mu2...does the x7 sdk work with this version? I am getting super excited looking at all the possibilities through c-hooks! Very happy to find that Mastercam allows that level of access..

 

Thanks,

Greg

Link to comment
Share on other sites

Mick,

 

 First off, thank you for the quick reply! I shure do appreciate the help. After compiling the .dll when I execute it in mastercam, I am getting an unknown filetype error. We are using x7 mu2...does the x7 sdk work with this version? I am getting super excited looking at all the possibilities through c-hooks! Very happy to find that Mastercam allows that level of access..

 

Thanks,

Greg

 

 

Greg,

 

When you see that message it is often an indication of a version mis-match, that is the add-in's version does not match that of Mastercam. I'd need some more information and if possible sample code or screen-shots of your project configuration, or a sample project which would be ideal.

 

Oh, I just looked on our site and we have the X7 and X7 MU1 SDK's but not a X7 MU2, this might be the problem, let me find out if MU1 works for MU2.

Edited by Mick from CNC Software Inc.
Link to comment
Share on other sites

Mick,

 

 I was able to work out the issues I was having and now have the .dll executing properly! Pshew... you guys have done a lot of work on the

sdk & c-hook template..Dang thats a pile of info... So my next question is............Now What......? lol.. Thanks for the input.. More Questions will be forth comming..

 

Thanks,

Greg

Link to comment
Share on other sites

Greg,

 

I agree the SDK is a bit of a beast and the documentation has always been less than stellar as its not entirely an easy thing to get into for a typical Mastercam user. We are making strides to rectify this but it's slow going, priorities and all that ;)

 

We do have a support email as mentioned on the C-Hook document so I would encourage you to use that as a means to communicate as there are more developers monitoring it.

Link to comment
Share on other sites
  • 1 year later...

Mick,

 

 Its been a while since the last post as I am just getting a slow down at work and have a minute to code. We have since upgraded the shop to 2017, I have 2013 vb studio community

installed and have a c-hook shell releasing and debugging properly and doing a few one trick ponies. I need a few examples to help demystify things a bit. I've coded a c++ executable to write pallet programs for our micron

robot cells and a few other little c .exe's that I use here at work, so I am not a total noob to the language. It Seems like its a bit  secretive on the info sharing end of things, not sure why..Maybe as I advance, I

will guard the Illumination as well ;-) Do you guys provide any examples, or must I suffer?

 

 Thanks,

Greg

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