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. This binary format is not published, as it is proprietary. That sounds like a good way to corrupt some files. What exactly are you thinking of changing?
  2. You're referring to "Create Relative Views" ? What you be the workflow that triggers the add-on to know "this is your WCS, now do this..."?
  3. While this is true -> That does not mean that you cannot have a NETHook or CHook that can execute something every time there is a File-New (or on some other “event”). A NETHook (or CHook) add-on can "subscribe" to event notifications from Mastercam and... when it receives an event notification it's interested in - take some action. I whipped up a FileNewView NETHook for X7 last night that demonstrates this. When this FileNewView add-on is installed it watches for "File-New" and when it sees one it-> Creates a new View (that you've pre-defined) and sets that View as the active Graphics View. Does this sound like what NeonDad was looking for?
  4. Hmmmm.... I tried "manually" opening X6 files in X7 and never got that message.
  5. I would say probably not. EDIT... So you do not get these warning from GetOpGroupDataInExternalFile, but you get them when you actually "open" file? Exactly how are you opening the file? And what version is the file you are opening when you see these messages?
  6. Probably not, but I can' say for sure that I've tried this. You could make backups of the current X6 NETHook2_0.DLL (an NETHook2_0.XML) and copy over the X7 version and try it.. No warranty of usability is expressed or implied by this posting.
  7. The GroupData and OpData varaibes are "out" variables, as the GetOpGroupDataInExternalFile method fills them in with data. Here they are set to "nothing" (or null for you non VB programmers). That's not going to work, as they need to be intialzied to "someting" So instead of this --> Dim FileSpec As String = "C:\TMP\TEST.MCX-7" Dim success As Boolean = False Dim OpData() As ExternalOpsFileData = nothing Dim GroupData() As ExternalGroupsFileData = nothing Success = SearchManager.GetOpGroupDataInExternalFile(FileSpec, GroupData, OpData) You need to initialize them as "empty" -> Dim FileSpec As String = "C:\TMP\TEST.MCX-7" Dim success As Boolean = False Dim OpData() As ExternalOpsFileData = {} Dim GroupData() As ExternalGroupsFileData = {} Success = SearchManager.GetOpGroupDataInExternalFile(FileSpec, GroupData, OpData) A side note: GetOpGroupDataInExternalFile allows one or the other to be nothing (null), which tells this method not to bother retrieve that (Group or Op) data. If both are null, you've told it to not bother with either, so you get nothing in the (2) output variables and the return in False. It should only return False, if… • The supplied file name “bad” (does not exist). • Both of the supplied GroupData and OpData variables are null. • Mastercam is not in a Machine Mode (it will not work if only in ‘Design’). • Something horribly unexpected has gone wrong. If you really need to use the GetOpGroupDataInExternalFile method in X7 - please contact me -> SDK <at> mastercam >dot> com
  8. Do you end up with any data n the GroupData or OpData objects? Could you mail me your TEST.MCX-7 file? SDK <at> mastercam <dot> com
  9. If you try to run ZIp2Go and it does not work on a system, then I'd start looking (again) at the .NET (v4) Framework install on that system.
  10. Is it just that one NETHook that doesn't want to run? Or do you have others that run, or don't run? If all the other NETHooks run, you would begin to doubt that it is the .NET Framework causing the issue.
  11. If you "manually" import that operation, does it regenerate? If not, determine what is "missing" and that is what is probably happening when you attempt to to the same with your AddOn. My intial guess would be that there is no geometry in the operation
  12. ??? I am not sure what you are referring to. In X7 I can create an OPERATIONS-7 file that contains any toolpath type.
  13. Either option would be OK. What is important is that you make sure that you are building your (X6/X7) CHook project with the v100 Toolset.
  14. I'm not exactly sure where you found that list of 3D HST toolpath type options. In the X6 SDK, the list I see (in AssocVars_CH.h) has values for TP_OP_CORE 13, TP_OPT_REST 14 and TP_OPT_PROJECT 15
  15. X6/X7 is the same in regards to the .NET Framework requirements. *And you don't have the newer NETHook3 in X6. Hmmmm.... Not something I'd usually go for, but maybe the v4.0 Framework is "messed up" (that's the technical term) on the non-working system? Maybe try uninstalling / re-installing the v4 .NET Framework on the "bad" system.
  16. For X7 you do want the NET Framework v4.0, as that is the version that the NETHook2 (and NETHook3) that shipped with X7 targets. So Visual Studio was correct in telling you that - "You're doing something wrong". Even though Mastercam can be 32-bit or 64-bit, we're working in .NET here and... We can build our NETHook AddOn using the "AnyCPU" platform. This way the (.NET) DLL we generate can be used for either 32-bit or 64-bit Mastercam. If you do the use the "AnyCPU" platform, you will see this warning when you build your project -> Warning - There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "NETHook2_0", "AMD64". blah, blah blah... If your NETHook project only references Mastercam's NETHook2_0.DLL (or NETHook3_0.DLL) you can safely ignore this warning. If this warning really bothers you, there is a way to (manually) add a line in the .csproj (project) file that will tell Visual Studio to stop complaining about this. I just built and ran this code using 64-bit Mastercam X7 (SP2) -> *I added some input validity checking so that it won't throw an Exception just because the file doesn't exist.* The only way I can get the "Unknown File Type" error (using this code) is if I build the project using the "X86" platform. If I buld it using "AnyCPU" or "X64", it runs fine*. "Fine" in that I see the error message telling me that the EXE file doesn't exist on my system. using System.Windows.Forms; using Mastercam.App; using Mastercam.App.Types; namespace Program_Run_Nethook { #region class NETHOOK public class Program_Run_Nethook : NetHook2App { public override MCamReturn Run(int param) { bool ret = true; // Assume success MessageBox.Show("your in!"); const string exe = @"Z:\Mastercam X6 Files\Machines\Mazak 510C-II\Tool Sequencer.exe"; if (System.IO.File.Exists(exe)) { System.Diagnostics.Process.Start(exe); } else { MessageBox.Show("File to execute was not found! ->\n" + exe, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error); ret = false; } return (ret ? MCamReturn.NoErrors : MCamReturn.ErrorOccurred); } } #endregion class NETHOOK }
  17. Zack, Does your NETHook project reference (require) any other (DLL) components (in addition to the NETHook2_0.DLL) that may not be installed on the "new" system?
  18. >> I am in the process of migrating our add-on software package from X6 to X7(using X7 SDK, VS2012, C++) When building CHooks (which are MFC "extension" style) DLLs, they must be built using the same compiler "tool set" as the version used to build the version of Mastercam being targeted. For X6/X7 that would be tine tool set from Visual Studio 2010 ( which is the v100 toolset). Visual Studio 2012 by default used the v110 toolset. To find this setting in your C++ Project Open the Project Properties and under Configuration Properties select the General category On this dialog you should see the setting for -> Platform Toolset ^^^ This does not mean that you cannot use Visual Studio 2012 "as your IDE" ^^^ Just make sure that the Platform Toolset in your X6/X7 CHook Project is v100 and you should be good.
  19. Another suggestion... Files Type Manager I use this free utility from NirSoft. With this you easily see and edit the file type <-> program associations on your system.
  20. When Mastercam starts up it reads all of the FT files in the CHooks folder. ALL of the CHook/NETHook DLLs referenced in these FTs are "loaded" (and added to an internal list). Now whenever Mastercam has an Event, it goes thru that list of AddOns and passes that Event to each of them. Of course only those CHooks/NETHooks that have a "notify" method are going to actually receive the notification. You can still leave your DLL in your bin/debug folder. Your. FT specifies where Mastercam looks for the DLL.
  21. Does your NETHook have an .FT file? (That "loads" your NETHook) Is your Notify method getting any notifications? When you "load" your Form, how are you running it? - Modal or Non-Modal (hint: you want Modal) I just tried this code in X7 (SP2) and I am getting these events. Public Overrides Function Notify(eventCode As MCamEvent) As MCamReturn ' Checking just some of the MCamEvents that get sent from Mastercam. System.Diagnostics.Debug.WriteLine(String.Format("EventCode:{0}", eventCode)) Select Case eventCode Case MCamEvent.File_New MessageBox.Show("MCamEvent.File_New", "Notify") Exit Select Case MCamEvent.Pre_File_Open MessageBox.Show("MCamEvent.Pre_File_Open", "Notify") Exit Select Case MCamEvent.File_Open MessageBox.Show("MCamEvent.File_Open", "Notify") Exit Select Case MCamEvent.Pre_File_Save MessageBox.Show("MCamEvent.Pre_File_Save", "Notify") Exit Select Case MCamEvent.Post_File_Save MessageBox.Show("MCamEvent.Post_File_Save", "Notify") Exit Select End Select Return MyBase.Notify(eventCode) End Function
  22. The MP Language has the predefined variable that returns the current date -> date$ You create a new user defined variable in your PST files(s) with your expiration date. Then within the PST you would do a check using the current date$ against your expiration date. If the post is "expired" you could then output a string to the NC file and/or display a message on screen when the PST is used. Obviously this is not very "secure" (if you need that), as anyone can just change your expiration date in the PST. But... If you really need to prevent that, you could put the expiration date in "binned" post file using MPBIN.
  23. Actually it is the new NETHook v3 that comes with X7. *** Also please note that the NETHook v2 (NETHook2_0.DLL) has been deprecated and will not be included with Mastercam after X7 *** It'll will be NETHook v3 going forward... Got the bottom of this page and you will find more detailed info in the NETHook v3 API As for what language to use for creating NETHooks? You can use VB.NET, C# or even C++/CLI (though this would be unusual). If you know VB and are comfortable with it - use it. If someone is just starting out, I always suggest C#

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