-
Posts
629 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by Mick George
-
-
You can customize the ribbon and add it, it is very basic in 2022 but it is there.
- 1
-
Ah yes 2022 was kind of a preview so you can go ahead and create the folder in Shared and use that. You should find some samples online, you can also take a look at the NET-Hook samples as they both use the same API.
-
There is a NET-Script folder in Shared that you can use, there should be a few sample scripts in there also.
- 1
-
NET-Scripts are replacement for VBScript. I believe NET-Script was first added to Mastercam 2022.
VBScript is deprecated and will be removed completely from Mastercam 2025.
NET-Scripts use the same API as NET-Hooks but can be created using the inbuilt script editor.
There are several short video introductions to NET-Script on the Mastercam forums.
-
John,
There are some script examples installed with Mastercam 2023 under C:\Users\Public\Documents\Shared Mastercam 2023\NET-Scripts we also have more examples on our website under the 3rd Party Developers section.
-
2 minutes ago, ThickChips said:
Hi,
Following the guide. The guide is listed in X8, I had to modify the path for 2022.
In post build events, I set the field to:
copy "$(TargetPath)" "C:\Program Files\Mastercam 2022\Mastercam\chooks\"
copy "$(ProjectDir)\Resources\FunctionTable\$(TargetName).ft" "C:\Program Files\Mastercam 2022\Mastercam\chooks\$(TargetName).ft"I get error at startup, exited with code 0.
Do spaces need properly escaped in the path name?
Thanks
With Mastercam 2022 and beyond it is no longer recommended to install to the chooks folder due to elevated permissions requirement.
Replace the post build step as follows, assuming these paths match your paths:
IF NOT EXIST "C:\Users\Public\Documents\Shared Mastercam 2022\Add-Ins" MKDIR "C:\Users\Public\Documents\Shared Mastercam 2022\Add-Ins"
copy "$(TargetPath)" "C:\Users\Public\Documents\Shared Mastercam 2022\Add-Ins\$(TargetFileName)"
copy "$(ProjectDir)Resources\FunctionTable\$(TargetName).ft" "C:\Users\Public\Documents\Shared Mastercam 2022\Add-Ins\$(TargetName).ft" -
3 minutes ago, ThickChips said:
I downloaded the SDK. Following the guide posted directly on MCAM's website (6/6/15).
Is VB-Net not supported anymore? Searching for 'NET HOOKS' or 'MASTERCAM' in VS code's Extensions Manager shows precisely zero results. I need the template extension.
There is no SDK required for the .NET API.
We only have VS2019 templates for .NET at the moment, we plan to have VS2022 templates soon. If you have both VS versions installed you can create the project in VS2019 then open it in VS2022.
-
Take a look at the ToolNetApi, there are a couple samples on our site and a couple here if you run a search.
-
Please post your request on mastercam developer forums so we can assist.
-
Please repost on the official Mastercam forums and we can take a look.
-
Karl,
Please repost on our official forums so that we can take a look,
Thanks,Mick
-
There is a VBScript.htm file located in the Help folder if I recall, you can take a look through that as I am sure there is a way to check levels, entity colours and the like.
- 1
-
Could you post a snippet of code you are using?
-
On 4/28/2021 at 12:07 PM, sbowling said:
So I created the XML file and I go back and do another setup sheet, is still does not have my information. What do I do with the XML file?
Scan the XML file for the information you need to verify it is there. Once you identify the data you can reference the tag.
-
NiravP,
For NET-Hook development there is not additional SDK to install as there is an assembly installed with every seat of Mastercam that you reference in a .NET class library project to gain access to the API.
If you do not have access to a seat of Mastercam yourself you will need to talk to the client for access or contact [email protected] with your and your clients details and I can pass the information on the the applicable people to help you.
We do have several project examples on our website under the 3rd Party Developers portal and the [email protected] mailbox is our API support mailbox. We also have developer forums on our website.
-
On 4/14/2021 at 8:31 PM, sbowling said:
You can search the XML file that is created by the tool list call, from the setup sheet dialog hold the CTRL button and left mouse click the green check button to have Mastercam generate a full XML file. The file will be located in your C:\Users\Public\Documents\Shared Mastercam 2022\common\reports\XML folder and you can search the tags. You can also take a look at the report help file and see the tag section.
-
37 minutes ago, ThomasF said:
Mick, could you please check if these files are still there?
I don't see anything there added after May, 2020.
Regards
Thomas
Thomas,
Make sure to select the drop down to filter out the examples list. FWIW many of the 2017-2020 examples will works just fine in 2021+ other than the ToolNetApi examples which have a couple namespace breaking changes.
-
3 hours ago, Thee Byte™ said:
Maybe it's just me, but the link at the top gives me error 404
_ _ _ _ _ _ _ _ _ _ _ _ _
Hi Mick,
do you think we could have a more in depth Tutorial about making tools with the ToolNetAPI?
Specifically creating "custom" tools from 3D models.
Thanks!
Ah yea that link is no longer valid, I did report the post to update the link as I am unable to edit it. https://my.mastercam.com/Communities/3rd-Party-Developers/NET-Hook-Downloads is the correct link. Thanks for catching that.
I'll see what I can do with more tool examples.
- 1
-
2 hours ago, Thee Byte™ said:
It would be cool to see Mastercam Templates for nethooks in other languages someday..
C++/Cli / Iron Python / FSharp / Java
The last two especially are heavily used, if Mastercam would support them we could see a lot more users coming to the platform.
A c or .net interop project with python would also be good because python users would wamt to use actual python.
We do have a backlog item for a C++/CLI template so that is coming.
-
1 hour ago, JAalders said:
Im looking for a simplified Lathe set up sheet that can fit on one double sided sheet of paper or figure out how to create a custom sheet. Thanks for sharing this link.
Have you had much succes customizing this your self?
There is a tutorial from 2018 at https://my.mastercam.com/Learning/Tutorials/Mastercam that walks you through using setup sheets if you haven't seen it. There are also a few threads for setup sheets in our https://kb.mastercam.com/Knowledgebase.aspx just search for 'setup sheets'
-
A presentation from a couple years ago some of you might find helpful.
- 2
-
On 1/15/2021 at 9:01 AM, ToolanddieGuy said:
Thanks for the reply. Thats actually the video tutorial I used to create my initial setup sheet. There's no mention in there about how to change the image size. I've reached out to Mastercam technical support, and waiting to hear back.
Did you ever get an answer to this?
If not, if you open the image in an image viewer is it actually that small?
The image control used in the active reports has a size mode property, by default it is set to Zoom, you could try the Stretch or Clip setting to see if that gives you the view you are looking for.
- 1
-
I'd contact QC per Peters' recommendation.
-
12 hours ago, Thee Byte™ said:
This portion of code creates the libwrap class, I re-use this portion a lot, since this interface is nice than the one you get from .NET.
Here we are importing directly from The Windows Api
#region Private Methods [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public class OpenFileName { public int structSize = 0; public IntPtr dlgOwner = IntPtr.Zero; public IntPtr instance = IntPtr.Zero; public String filter = null; public String customFilter = null; public int maxCustFilter = 0; public int filterIndex = 0; public String file = null; public int maxFile = 0; public String fileTitle = null; public int maxFileTitle = 0; public String initialDir = null; public String title = null; public int flags = 0; public short fileOffset = 0; public short fileExtension = 0; public String defExt = null; public IntPtr custData = IntPtr.Zero; public IntPtr hook = IntPtr.Zero; public String templateName = null; public IntPtr reservedPtr = IntPtr.Zero; public int reservedInt = 0; public int flagsEx = 0; } public class LibWrap { //BOOL GetOpenFileName(LPOPENFILENAME lpofn); [DllImport("Comdlg32.dll", CharSet = CharSet.Auto)] public static extern bool GetOpenFileName([In, Out] OpenFileName ofn); }
You may want to set these switches to false at first,
Not sure if you are aware or you are doing this for a specific need there are file open and file save dialogs that are simple to implement.
Chook in ribbon bar
in Mastercam C-Hook, NET-Hook and VBScript Development
Posted
Hi,
You should not be using the chooks folder, you will want to move your add-in and ft to the Shared or My Mastercam Add-Ins folder. You will need to edit the FT path and remove the chooks folder in the path.