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:

Recommended Posts

Visual Studio 2019 project templates for Mastercam NET-Hooks are now available for C# and VB.NET

Installation:

From Visual Studio select Extensions->Online->Search->Mastercam

Restart Visual Studio.

 

Usage:

Start Visual Studio 2019, from the Create new project dialog type Mastercam in the search field leaving all other filters off to show the templates. A later update  will add tags to the templates for easier selection but right now they are not implemented. Once selected the template will show in your project type MRU

 

Default Project:

A default WinForms project is created with documentation on how to get up and running debugging a NET-Hook with Mastercam. The project includes some sample code.

 

If you prefer a WPF project, delete the MainView and add a new WPF User Control, rename the Control type to Window. Replace the code in the Main.cs Run method with the following code assuming you have named your Window MainView.

            // WPF
            var view = new MainView();

            // Get the handle to the non-WPF owner window
            var ownerWindowHandle = Mastercam.Support.UI.MastercamWindow.GetHandle().Handle;

            // Set the owned WPF window’s Owner property with the non-WPF owner window

            var helper = new System.Windows.Interop.WindowInteropHelper(view) { Owner = ownerWindowHandle };
            view.Show();

 

 

vs2019_templates.png

mastercam.png

project.png

Edited by Mick George
added project image
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...