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:

Needed: Version 9 C-hook for creating a library from text


divisionary1
 Share

Recommended Posts

I don't think a C-Hook exists, per se. But it is possible. From experience, it can be done via VBScript or .NET APIs. You can parse out the tool information from the TXT file (look in the comments to find out which values represent what). Then you can create a new tool in your library programatically using functions like MakeContour(), MakePocket(), etc in VBScript using the tool parameters from the TXT file (you can't create a tool in VBScript). From the Nethook API, you could use the get/set methods of an instance of a CToolRef object such as cornerRadius, toolDiameter, toolComment, etc to access the members.

 

There's probably similar ways in the C-Hook API but I avoid it whenever possible and use it as a last resort.

Link to comment
Share on other sites

quote:

Is is possible to initiate the "Get Library From Text" function from a VB Script?


No frown.gif

 

quote:

Can this function be initiated in a C-hook?


I'm looking but I don't see anything yet headscratch.gif If worse comes to worse, you'd have to write your own "importer" to parse your TXT file and then create new tools using the data from the TXT file. In the case of VBScript, in the past, I just pulled the data out of the TXT file and used it in my operations. From looking at the Nethook API, we are now able to create a new tool and get/set tool data.

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