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:

VS2013 (all versions) C# and VB NETHook Project Template


Recommended Posts

Updated for X8; All previous templates have been removed.

 

Note: In both cases you can install directly from within Visual Studio 2013 go to Tools -> Extensions and Updates and search on-line for Mastercam.

 

 

Direct Downloads:

 

C# Template

VB.NET Template


As always please direct any questions, requests, concerns to this thread,

post-4901-0-46412400-1385003517_thumb.png

Edited by Mick from CNC Software Inc.
  • Like 3
Link to comment
Share on other sites
  • 1 year later...
  • 1 month later...

Updated for X8; All previous templates have been removed.

 

Note: In both cases you can install directly from within Visual Studio 2013 go to Tools -> Extensions and Updates and search on-line for Mastercam.

 

 

Direct Downloads:

 

C# Template

 

VB.NET Template

 

 

As always please direct any questions, requests, concerns to this thread,

 

Updated for X8; All previous templates have been removed.

 

Note: In both cases you can install directly from within Visual Studio 2013 go to Tools -> Extensions and Updates and search on-line for Mastercam.

 

 

Direct Downloads:

 

C# Template

 

VB.NET Template

 

 

As always please direct any questions, requests, concerns to this thread,

 

Updated for X8; All previous templates have been removed.

 

Note: In both cases you can install directly from within Visual Studio 2013 go to Tools -> Extensions and Updates and search on-line for Mastercam.

 

 

Direct Downloads:

 

C# Template

 

VB.NET Template

 

 

As always please direct any questions, requests, concerns to this thread,

 

Updated for X8; All previous templates have been removed.

 

Note: In both cases you can install directly from within Visual Studio 2013 go to Tools -> Extensions and Updates and search on-line for Mastercam.

 

 

Direct Downloads:

 

C# Template

 

VB.NET Template

 

 

As always please direct any questions, requests, concerns to this thread

When I search for Mastercam, there is nothing found! Help!

 

Link to comment
Share on other sites

When I search for Mastercam in visual studio, nothing is found. Is it because I have express for desktop? What do I need to download to be able to design chooks for mastercam x8?

 

Jason,

 

Don't use the Express version it doesn't support add-ins among other things, grab the Visual Studio 2015 Community Edition which is a free professional level version. The Templates for VS2015 are not uploaded yet but I hope to have them done soon. In the mean time you can download the NET-Hook sample projects from mastercam.com as well as some examples posted in various threads here to see how easy it is to hit the ground running.

  • Like 1
Link to comment
Share on other sites

Jason,

 

Don't use the Express version it doesn't support add-ins among other things, grab the Visual Studio 2015 Community Edition which is a free professional level version. The Templates for VS2015 are not uploaded yet but I hope to have them done soon. In the mean time you can download the NET-Hook sample projects from mastercam.com as well as some examples posted in various threads here to see how easy it is to hit the ground running.

Thank you! I was told c++ was the way to go by my code writing friends, so I have been cramming my head with that language for the past 2 weeks. Which language  would you recommend I learn to create chooks, write code to work with mastercam? Just Visual Basic and C#?

Link to comment
Share on other sites

Thank you! I was told c++ was the way to go by my code writing friends, so I have been cramming my head with that language for the past 2 weeks. Which language  would you recommend I learn to create chooks, write code to work with mastercam? Just Visual Basic and C#?

 

The NET-Hook API was implemented for C# and VB.NET programmers and works with Mastercam Mill and Mastercam Router. If you are looking to develop more advanced add-ins or need to target Lathe or Wire then the C-Hook SDK would be required. 

 

if you can tell me what it is you are planning to develop I should be able to tell you whether you need the .NET API or C-Hook SDK

Link to comment
Share on other sites

The NET-Hook API was implemented for C# and VB.NET programmers and works with Mastercam Mill and Mastercam Router. If you are looking to develop more advanced add-ins or need to target Lathe or Wire then the C-Hook SDK would be required. 

 

if you can tell me what it is you are planning to develop I should be able to tell you whether you need the .NET API orI

I work for a door company. I use mastercam to program a four axis router that cuts the custom doors. There are only a few types of doors each with little changes to them. (Hinge style and placement, lock style and placement etc..) I want to either write code similar to the chook door application that is currently used in X8, and add many more options that are specific for this company, or create software that will produce the gcode  (using the custom post processors I have for mastercam) from information gathered by the user.

Link to comment
Share on other sites

Thanks for posting all those learning materials; this is significantly reducing the barrier to entry.

 

I'm thinking maybe I can write something to automate my posting process for our main family of parts, since I have to post around 13 ops per part, each for three machine types, each NC in it's own appropriately named folder, each with a setup sheet, each for over a hundred part numbers.  Then I might try to automate toolpath verification and comparison for all those ops.  Then I might try to ATP our families of turning parts, (much simpler than our main line which is all horizontal milling), then maybe ATP some of the main line.  If I get all that done it could save me about 90% of my time.

Link to comment
Share on other sites

I work for a door company. I use mastercam to program a four axis router that cuts the custom doors. There are only a few types of doors each with little changes to them. (Hinge style and placement, lock style and placement etc..) I want to either write code similar to the chook door application that is currently used in X8, and add many more options that are specific for this company, or create software that will produce the gcode  (using the custom post processors I have for mastercam) from information gathered by the user.

 

This should be possible with a NET-Hook I believe. Depending on how much flexibility you need you might want to create a library of hinges and locks and merge them into the applicable position of a door. 

Link to comment
Share on other sites

Thanks for posting all those learning materials; this is significantly reducing the barrier to entry.

 

I'm thinking maybe I can write something to automate my posting process for our main family of parts, since I have to post around 13 ops per part, each for three machine types, each NC in it's own appropriately named folder, each with a setup sheet, each for over a hundred part numbers.  Then I might try to automate toolpath verification and comparison for all those ops.  Then I might try to ATP our families of turning parts, (much simpler than our main line which is all horizontal milling), then maybe ATP some of the main line.  If I get all that done it could save me about 90% of my time.

 

Glad to help. If there are particular examples you need that are not already covered please feel free to email us with your suggestions.

Link to comment
Share on other sites

This should be possible with a NET-Hook I believe. Depending on how much flexibility you need you might want to create a library of hinges and locks and merge them into the applicable position of a door.

I have different mcx files. Each for a different door type. I have the post processor that was designed for the router. I have the gcode as well. Is it possible for the script to make new toolpaths from the user input, and the program output the new drawing and new gcode?

Link to comment
Share on other sites

I have different mcx files. Each for a different door type. I have the post processor that was designed for the router. I have the gcode as well. Is it possible for the script to make new toolpaths from the user input, and the program output the new drawing and new gcode?

 

The process you describe seems similar to he ATP add-on process, that is open a file and import (or create) operations and post all on the fly. I would look into a NET-Hook first to see if it's doable, it seems to be from what you are asking.

Link to comment
Share on other sites

I have added a Mastercam C# Project Template for Visual Studio 2015 this includes the free Community Edition. To install it open Visual Studio select Tools->Extensions and Updates->Online and search for Mastercam.

 

I plan on fine tuning the template but it will at least stop you from having to manually re-create all the boiler plate stuff just as previous template would. You will likely need to re-add the project reference to the NETHook3_0.dll but it is all explained in the included readme text file. I'll try to get a VB.NET template uploaded later tonight.

  • Like 1
Link to comment
Share on other sites

I have added a Mastercam Visual Basic.NET Project Template for Visual Studio 2015 this includes the free Community Edition. To install it open Visual Studio select Tools->Extensions and Updates->Online and search for Mastercam.

 

I have also updated the C# project template to the default Mastercam installation folder for references and upped the .NET framework from 4.0 to the recommended 4.5

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

It should work fine but you will need to remove the NETHook3_0.dll reference and replace it with the NETHook2_0.dll reference, both are located in your Mastercam installation folder. You may also need to set the .NET framework version of the project to a lower version, just go back one version at a time and rebuild until you have a successful build.

 

I am still working with MasterCAM X5 *grumbles* and it uses NETHook2_0.dll, I haven't tried it yet but do you think it would be possible to use your .NET API to develop C# add-ins? I will be working with VS community 2015.

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

 

Hi;

 

I havent got any access to documentation. How I can obtain this content for mastercam x8 and visual studio 2013?

 

Best regards

 

 

You need to create an account on our website, you don't need to be a current maintenance user but you will need a valid SIM#. Once you have done that you can access the 3rd-Party Developers area via the main menus and download the documentation and examples you would like. If you have any other questions please let me know.

 

 

 

Link to comment
Share on other sites
  • 1 year later...
1 hour ago, So not a Guru said:

I just downloaded Visual Studio, but it is version 2017. Since >Tools>Extensions & Updates>Online>Mastercam search comes up empty, I'm guessing that I can't use the  templates. is that correct?

That is correct, I need to set some time aside and update them. I'll try to get something done in a week.

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