-
Posts
2,870 -
Joined
-
Last visited
-
Days Won
6
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Everything posted by Roger Martin from CNC Software
-
In the Operation Manager (Toolpath), when you select Setup Sheet... The .DLL must be a CHook (FYI - I've entered a request to have this function check the DLL and the execute a NETHook or CHook DLL) But... A CHook can ask Mastercam to run a NETHook DLL. So, if you have the ability to create a CHook, your CHook can tell Mastercam to run your NETHook when you select Setup Sheet... To test this, I have the Setup Sheet... (right-click menu) command launching the Zip2Go.DLL (which is a NETHook). What my CHook does so that I don't have to hard-code the path\name of the NETHook is read that information from the Registry from a value under the main Mastercam key -> \HKEY_CURRENT_USER\Software\CNC Software, Inc.\Mastercam X6 *Your CHook DLL must be located in the CHooks folder. In your CHook (I've not included the std. required m_version function here) -> #include "CReg_CH.h" #include "RunNHook_ch.h" extern "C" __declspec(dllexport) int m_main (int not_used) { // Must call this prior to accessing any Resources in the C-Hook DLL ! // ChangeResCl res(GetChookResourceHandle()); // The Registry keyname that holds the NETHook's full path\name. char* key_str = "RunNETHook"; char ret_str[MAX_PATH] = {0}; if (getStringFromRegistry(key_str, MAX_PATH, ret_str)) { if (is_net_app (ret_str, TRUE)) { int rv = run_net_app (ret_str, 0); } else { CString msg; msg.Format("%s\n\nIs not a valid NETHook!", ret_str); ::MessageBox (NULL, msg, (LPCTSTR)"RunNETHook", MB_OK); } return MC_NOERROR; }
-
Visual Studio 2012 For .NET projects it will default to the v4.0 framework. For Mastercam X6 this will not work. (as you've found out) You just need to reset the "Target Framework” in your Project to one earlier than v4.0 (v3.5, v2.0) Select the Project-Properties and on the Application and set the “Target framework”. For CHook projects, you can use Visual Studio 2012 “as your IDE”, but the X6/X7 the project must be compiled using the “V100” Toolset from Visual Studio 2010. Select the Project-Properties and under Configuration Properties, on the General page make sure that the "Platform toolset" is set to -> Visual Studio 2010 (V100).
- 9 replies
-
- compatabilitynetHook 2.0
- NetHook 3.0
-
(and 2 more)
Tagged with:
-
Sorry for the confusion of terms. When I say NETHook v2, that is the same as NETHook2_0.DLL (the v2 of the NETHook API) The reason you see an error is that you are running X6 (any MU#) There is not an SDK like the for CHooks, as you already have everything in the NETHook2_0.DLL (or the NETHook3_0.DLL) Those are "the .NET API". The NETHook3_0.DLL that ships with X7 is the new "version 3" of the .NET API Lots of new functionality in this new v3 .NET API for Mastercam. I hope that answers your questions for now, as I'll be "offlline" until later this month. I'm at JFK and my flight leaves in an hour for the other side of the world. Where I'll have no internet, no phone, no TV, nothing from the outside. Now that's what I call a vacation!
-
That specific ArcGeometry constructor (passing an Arc3D as the parameter) does not work properly in the NETHook v2. This was corrected in the NETHook2_0 API and NETHook3_0 API that ships with X7. The data in the ParamArc being passed to the ArcGeometry constructor looks OK. Centerpoint = X0, Y0, Z0 Radius = 1.0 Start Angle = 0.0 EndAngle = 90.0 But a 'valid' ArcGeometry object (NewArcGeom) is not getting properly initialized. Thus the "Zero length error" when you attempt to Commit that object. ;( You can just use any of the other methods of constructing an ArcGeometry object and you should be OK Please note that the NETook2_0 is "frozen". All future updates to the .NET API will be in the NETHook3_0 only.
-
NetHook3_0
Roger Martin from CNC Software replied to rocheey1's topic in Mastercam C-Hook, NET-Hook and VBScript Development
Mastercam.Support.SearchManager.GetOpGropupDataInExternalFile "External" file here is an MCX type file; An MCX-7, DEFAULTS-7 or OPERATIONS-7 This method loads up a pair of arrays: ExternalGroupsFileData and ExternalOpsFileData (declared in the namespace -> Mastercam.Support.Types) This is so you can interrogate these files without having to actually load them into Mastercam. Mastercam.Support.SearchManager.GetoolsInExternalFile Similar idea. Returns an array Tool objects (the tools) from "external" the MCX type file. -
The CHook Developer Guide is very out dated. We're trying to encourage everyone to try to the use NETHook API. True, you cannot do everything with the current NET API that you can with a CHook, but if you don't need a CHook to do want do do - Don't do it with a CHook. Building CHooks takes - A much more experienced programmer. You must use Visual Studio 2010 (Professional of higher) version to build CHook for X6/X7. You can use the free C# "express" version of Visual Studio 2010/2012 for building NETHooks. (If you use VS 2012 for NETHooks, be sure to set the .NET Framework target to v4.0) First thing I ask someone who says "I want to create a CHook" is... Exactly what are you wanting to have it do?
-
Question about scripts for Mastercam
Roger Martin from CNC Software replied to Müřlıń®'s topic in Industrial Forum
"Selecting" geometry is easy, it's what you want to do with these selected items is where the "rubber meets the road". I assume you want to assign these to some type of Surface machining operation? (Would need a CHook) The devil is in the details. -
You cannot pass command line parameters to a CHook, or get access the command line that started Mastercam. You could create/set a Registry value that your CHook could read when it starts up to find out where to look for the MyConfig.txt
- 2 replies
-
- CHook
- Parameters
-
(and 1 more)
Tagged with:
-
Update post
Roger Martin from CNC Software replied to AlbertZini's topic in Post Processor Development Forum
In Windows Explorer, navigate to the folder that contains the PST file in question. Right-Click on that file and in the General tab of the Properties dialog, un-check the 'Read-only' attribute and then click Apply before exiting this dialog. Now re-try the Post Update procedure. -
Try this funtion -> // chain everything possible in the current part Bool ChainAllDIr( Bool, (Input : only generate closed chains?) Bool , (Input: only find chains at Z=0?) Bool , (Input: chain direction? TRUE=CW direction, FALSE=CCW) Integer, (Input: only find chains on this level? Use mcCHAIN_ALL_NUMBERED_LEVELS for all levels) String (Input: only find chains on this level? Use mcCHAIN_ALL_NAMED_LEVELS for all levels) )
- 4 replies
-
- 1
-
- ChainManager
- Chain
-
(and 1 more)
Tagged with:
-
Can I create a .opertions-5 file with a nethook. Do-able => sort of... Will the effort be worth it => No (Certainly not with X5) An OPERATIONS file is just an MCX with a different extension. The v2 .NET API was designed to import operations from an OPERATIONS file. In other words, you create the OPERATIONS file and use the NETHook to import them, and then via the NETHook code "customize" (to a certain degree) what has been imported to do your automatic toolpathing.
-
Need to know more than that. The DUO 43 (and DUO 64) could be setup to use different versions of Machining Condition Data. v6 or v7.1 (doubtful) or the new v8 data settings. The Makino DUO-Ver6-INCH-V Guide.TECH has been installed with the Wire product since X5. It should be there with the other TECH & POWER files in the "Shared mcamx#" folder -- C:\Users\Public\Documents\shared mcamx5\WIRE\Power -or- C:\Users\Public\Documents\shared mcamx6\WIRE\Power
-
vbs Chaining
Roger Martin from CNC Software replied to srbeyke's topic in Mastercam C-Hook, NET-Hook and VBScript Development
A level does not have any "Name" unless you give it one. Number and "Name" are to different and independent things. Every Level has a Number, but is does not necessarily have a "Name". The answer to this is YES. It will scan every level in the file, whether the level has a "Name", or not. -
vbs Chaining
Roger Martin from CNC Software replied to srbeyke's topic in Mastercam C-Hook, NET-Hook and VBScript Development
VB Script ChainAll I took a look at the (X6) source code and this is what these “all” flags mean -> mcCHAIN_ALL_NUMBERED_LEVELS = -1 mcCHAIN_ALL_NAMED_LEVELS = "" If we look at the declaration of ChainAll that you posted…. You can limit what gets chained using the parameters you pass in. If you pass a Level Number, (a single Integer value). It will chain everything* on that (single) level. *You can also restrict what on this level gets chained, using “only closed” and/or “only Z=0”. If you pass in mcCHAIN_ALL_NUMBERED_LEVELS for Level Number and pass in a non-blank Level Name -> It will find the first level with that (text) “name” and then restrict what gets chained to that (single) level. If both Level Number and Level Name are not set... (Which really means that they are set using mcCHAIN_ALL_NUMBERED_LEVELS and mcCHAIN_ALL_NAMED_LEVELS) -> It will chain everything, ignoring any restriction based on Level. *Of course you could restrict what gets chained (from "everything") using the other two parameters as filters. Note: If you pass in both a Level Number ( > 0) and a non-blank Level Name, ChainAll will use the Level Number, ignoring the Level Name. I do not see that there is “sorting” going on of Level Numbers when mcCHAIN_ALL_NUMBERED_LEVELS is used, and there is certainly no sorting of Level Names. No, a Level Name is “text” and can be any “text” (only limited to the max length allowed). If could set a Level Name to => “123” if you wanted.
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.