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:

Mick from CNC Software Inc.

CNC Software
  • Posts

    1,012
  • Joined

  • Last visited

Everything posted by Mick from CNC Software Inc.

  1. There was a C-Hook developed a few years ago that allowed users to bind short cut key commands to actions that would switch to different views and automatically fit the contents to the screen. I re-created the add on as a C# NET-Hook and added support for additional views. I have attached the add on to this post for those who might find it useful. To install: Save the attached zip file to your desktop and unzip it. Right click the DLL and the FT file and go to properties and make sure each file is not blocked, if so unblock and apply. Copy both files to your Mastercam 2017 chooks folder. Start Mastercam, go to the Ribbon Bar and right click to customize the ribbon, from there you can choose what views you would like keys bound too. Any questions please reply to this thread. If you found this add on to be useful please consider leaving some feedback in the very short customer survey in my signature. ViewFit_NETHook.zip
  2. As long as the C-Hook or NET-Hook has a matching FT file with it that exposes functions you will see them under "customize ribbon", select the option "commands not in the ribbon" and search for it in the list of functions displayed, once you find it select it and click the "Keyboard shortcuts" customize button to assign a shortcut command. The attached image shows my test NET-Hook function "System Directories Example" that I can set a key bind too.
  3. If a user opens up a RPX file in the designer they can certainly make edits, also the RPX files are just XML so anyone can open and edit the files in a text editor if they wanted.
  4. mmmm, I believe there is a LevelManager.Update or Refresh or something like that, i'll need to check.
  5. SearchManager.SelectAllGeometryOnLevel(1, true); var geometry = SearchManager.GetSelectedGeometry(); foreach (var g in geometry) { g.Delete(); g.Commit(); } You need to commit the change(s) to the database.
  6. What configuration change are you referring to?
  7. I just (re)published the old NET-Hook templates for Visual Studio 2010 so you should now see it when you search extensions online from within Visual Studio. Any trouble let me know. I just mentioned adding in a flag that the NET-Hook sets when it is run so that the event is not processed every single time posting is executed unless that is the process you are after.
  8. You could write a NET-Hook to do some processing after posting and write the data to disk or merge with an existing data source.
  9. Try something like the attached image. You want to wrap the call in a Using statement so that the connection is closed and disposed of once it falls out of scope.
  10. Take a look at the following namespaces: Mastercam.IO.SettingsManager Mastercam.IO.FileManager
  11. On a Windows 10 machine and possibly Win 7, 8 if you unzip a file into your program files folder, in this case C:\Program Files\mcam2017\chooks both files will be blocked. You must extract the files to a temp folder first, right click and unblock each file then copy them to your chooks folder in order for Mastercam to recognize them.
  12. The delay is possibly caused by displaying a MIN/MAX value which forces a read of the binary NCI file. FAQ 50333: https://kb.mastercam.com/KnowledgebaseArticle50333.aspx If you don't think this is the case would you be able to send us example drawings and the report you are using so we can run some performance tests to help improve performance? To be clear, this is not Setup Sheet Report Viewer (ActiveReports) that is slow it is Mastercam generating the XML data for the report viewer from the binary NCI as stated in the FAQ above.
  13. I'd recommend posting this on the official mastercam forums.
  14. Make sure the files are not blocked. Copy all the files out of the Mastercam chooks folder to any temp folder, right click each file and go to properties and unblock and apply, once they are not blocked copy them back to the chooks folder.
  15. I have updated the zip file containing the NET-Hook as I had a senior moment and broke the report selection. Anyway the zip file above now has the updated NET-Hook and the source code has been updated.
  16. I whipped up a NET-Hook that is using a C-Hook function that is wrapped in a support dll (thanks Roger). The NET-Hook will display a dialog that you can specify some properties, select a report and set the xml file name. When you click OK on the dialog the xml is created in the usual place , for example, C:\Users\Public\Documents\shared mcamx9\common\reports\XML. There is no other interaction, there is no viewer displayed. I did not have time to save/load previous values but the source is there so if anyone feels like it they can implement it. For those interested the project source is located -> https://github.com/Predatorie/SetupSheetXML Unzip the attached zip file to a temp folder then right click each file and make sure none are blocked. Then copy all files to your X9 chooks folder. You can create a toolbar button for the NET-Hook as shown in the attached image. When you run the NET-Hook you will be presented with the dialog as shown in the attached image. I did not spend a lot of time on this so if you run into any issues or have questions just reply to this thread. The NET-Hook project is written in WPF C# using Visual Studio 2015 and is compatible with Visual Studio Community Edition 2015 UPDATE: The dialog will now save the values from the previous session and load them for the current session. Source updated accordingly. SetupSheet.zip
  17. I don't see anything that allows generating the XML only from Mastercam or via a NET-Hook, I'd have to take a look to see if its possible via a C-Hook. In the meantime, I have written some NET-Hooks for customers that they run after running a setup sheet that copies and renames the XML to a folder, basically you run the report as usual then run a NET-Hook from a toolbar click. If this is something that might be of use let me know.
  18. I believe Mastercam currently allows for a billion levels or something crazy like that. Pretty sure your bases are covered. Dim activeLevels = Mastercam.IO.LevelsManager.GetActiveLevelNumbers() Dim levelsWithGeometry = Mastercam.IO.LevelsManager.GetLevelNumbersWithGeometry() Dim levelsWithNames = Mastercam.IO.LevelsManager.GetLevelNumbersWithNames() Dim visibleLevels = Mastercam.IO.LevelsManager.GetVisibleLevelNumbers() ​
  19. Just to be clear, if a level has either a name or geometry or both that is fine and I am pretty sure that covers everything for you. If you find this not to be the case feel free to send me a sample drawing (if possible) and I'll take a closer look.
  20. Give me a couple and I'll test something Edit: Actually you will get all levels that have either a name or contain geometry or both, if there is nothing named and no geometry the level essentially doesn't exist, at least that's how I see it. If you create some new levels with nothing on them then save the drawing they are removed.
  21. I'll ask the obvious, why would you need a list of levels that contain nothing? If I recall, and someone can correct me if I am wrong, we allocate a huge amount of empty levels when a drawing is opened or created.
  22. Hi calsev, All setup sheets use XML for their datasource that is created when you select the Setup Sheet context menu from the operations manager. Currently there is no way to generate this output via an API command, name the file or set its location, we do have stories to address these issues but not currently. Having said that I have written a number of NET-Hooks that merges external data into the XML file, I have also written my own XML file for use with ATP reports so there are options. When the Setup Sheet menu is clicked Mastercam simply shells out the to the ActiveReports viewer located in your Mastercam program files folder under common\reports and passes the name of the rpx file (report) to use and the name and location of the xml file as its datasource.

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