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:

Roger Martin from CNC Software

CNC Software
  • Posts

    2,870
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Roger Martin from CNC Software

  1. 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; }
  2. If you're trying to display a Form (aka. Dialog).... Try replacing those (3) lines of code with this -> Form1 form = new Form1(); form.ShowDialog(); Ultimately, what do you want your NETHook to do?
  3. Yikes! What is this code doing in a NETHook's "Run" method ??? Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); You're trying to spool up an Application within a running NETHook? I'm surprised that anything (good) happens.
  4. I am not having any luck re-producing this message. Can you supply a sample file? Please send to SDK<at>mastercam<dot>com
  5. 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).
  6. What "type" of toolpath operation(s) are you searching when you get this message?
  7. 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!
  8. 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.
  9. 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.
  10. 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?
  11. "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.
  12. 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
  13. 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.
  14. Not in -> Mastercam X5. But you can in the new NETHook v3 API coming in X7.
  15. Sounds like you are talking about doing a a 'Change at Point' . This is not (currently) possible with the .NET API It could be done with a CHook.
  16. 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) )
  17. Try moving the FileManager.[New](False) command to before the line that is setting the ActiveMachine.
  18. 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.
  19. 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
  20. What behavior do you see on system where it works vs. the other? Something's got to be different. Question is - What? Do they both have a Router license available?
  21. Not in the current X6 NETHook API You will be able to do this in the new NETHook API that will ship with X7
  22. Helio, Email me -> SDK <at> mastercam <dot> com I have a "quick & dirty" example (C#) NETHook Project that should be enough to get you started.
  23. 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.
  24. 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.
  25. Norbert, Could you send me your sample file(s) and settings data so I can investigate further? sdk <at> mastercam <dot> com

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