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:

Zaffin_D

Verified Members
  • Posts

    374
  • Joined

  • Days Won

    1

Everything posted by Zaffin_D

  1. if (tabison) { cntrop->Tabs.AutomaticPosition = true; cntrop->Tabs.TabAll = true; cntrop->Tabs.Enabled = true; cntrop->Tabs.AutoTabByDistance = false; cntrop->Tabs.NumberOfTabs = 4; cntrop->Tabs.EntryExitMode = Mastercam::Operations::Types::TabEntryExitType::Vertical; cntrop->Tabs.TabThickness = 0.04; cntrop->Tabs.TabWidth = 0.1; } if (!tabison) { cntrop->Tabs.Enabled = false; } Sorry, this just struck me funny! I only want to write C++ when I have to; I'd much rather handle everything in C# and create a native .dll only if needed. This is likely because I know nothing about MFC so any interface I create will be WPF.
  2. Yes? public int CreateSilhouetteBoundary() { using (var apiTools = new APIToolsNative.APITools()) { return apiTools.CreateSilhouetteBoundary(); } }
  3. Yes; I did not have any issues. I pushed a new commit to the repo.
  4. For what it's worth, this is something I would consider bad practice. The postblock is called pCheckHolderName but it checks the holder name and a bunch of other, unrelated conditions.
  5. Look up the acomboinfo function in the MP documentation, it will do what you need.
  6. Yes, you can read the axis combination; what version of Mastercam are you using?
  7. This sounds like alot more work than just using a NET-Hook to do everything. I threw together a quick sample last night; it should give you an idea of what's possible. And even though I think you should use a NET-Hook to do this, if you can get a view's matrix in VBScript you can map a point. Multiplying a point's X, Y, and Z by view's matrix will give you the X, Y, and Z relative to that view.
  8. The holder name is output to the 20020 NCI line.
  9. It's been 10 years since I've touched a Haas, but I recall setting 15 not throwing an alarm if the the length offset was zero (H0). I could be wrong, but I'm pretty sure that led to a crash at one point.
  10. I started working on your BreakSplines function and the following condition jumped out at me. if (entity.id == S_ID || entity.id == NB_ID) This is unnecessary; S_ID and NB_ID are binary so we can use the bitwise operators and simplify things. if (entity.id & (S_ID | NB_ID)) Or, we can just use the SPLINE_ID definition from BaseDefines_CH.h #define SPLINE_ID (S_ID | NB_ID) //!< Spline: parametric or NURBS if (entity.id & SPLINE_ID)
  11. I wasn't trying to be short; you just seem to be in a "I need this to work" situation and not a "I need this to work AND be maintainable, well organized, etc." situation. Take everything you read below with a grain of salt; I'm largely self-taught and this is not my field of expertise. Anyway, I took a look at your code over the holiday break. At this point I only have a few of your functions refactored; if time allows I’ll do more. I made this a CLI/CLR project with a WPF interface so I could quickly test everything. I also moved to a more traditional project layout with definitions in the header files and implementations in the source files. The first thing I noticed is that you have two functions that do almost the same thing; BlankAllNonSolidEnts and UnBlankAllNonSolidEnts. I merged BlankAllNonSolidEnts and UnBlankAllNonSolidEnts into one method BlankUnblankAllNonSolids. int APIToolsNative::APITools::BlankUnblankAllNonSolids(bool unblank) { int numberOfEntitesModified = 0; auto entityPointer = db_start; while (entityPointer != nullptr) { if (entityPointer->eptr->id != SOLID_ID) { numberOfEntitesModified++; if (unblank) { sel_bit_turn_off(entityPointer->eptr, BLANK_BIT); entityPointer->eptr->color = MC_RED; } else { sel_bit_turn_on(entityPointer->eptr, BLANK_BIT); } write_ent_sel(entityPointer->eptr, entityPointer->eptr->eptr); } entityPointer = entityPointer->next; } if (numberOfEntitesModified > 0) repaint_graphics(); return numberOfEntitesModified; } In addition to combining the functions, I went with a while loop to traverse the linked list. You can review everything I’ve done on my GitHub Hope that helps.
  12. My process was much the same, with a slight modification. I would calibrate the laser, the measure a new tool in a good holder. With the measured tool I would then cut a flat on a sacrificial block of material, set the datum, and calibrate the probe on the newly machined flat. This process made sure that to tool setter and the probe agreed.
  13. To generate the ASCII NCI, enable the check box shown below in the Post processing dialog In my example part, the ASCII NCI looks like this; I've highlighted the feed rate values for clarity; -2 = Rapid move -1 = Feed rate has not changed Any positive value = feed rate in UPM The first thing you should do is make sure the reduced feed rate is being output in the NCI.
  14. Have you looked at the NCI to determine if the problem is upstream? Do you have the Post documentation?
  15. I found another half hour so I added a method to save a locked file. FileLocker1_1.zip
  16. I used 2020 to develop it, but I think it should work for any version later than 2017. It only uses the NET-Hook API to get the current file name and to write to the event log.
  17. I put about half an hour into the below solution; it's worth about the time I put into it... It sets and resets the Windows 'Read-only' attribute of the current Mastercam file. When you attempt to save a Mastercam file that's has it's 'Read-only' attribute set you get the below error message. Attached is a .zip archive containing the .dll and .ft files. Make sure that the .dll is unblocked, then copy it and the .ft file to Mastercam's Chooks folder. The source can be found on my GitHub. FileLocker1_0.zip
  18. Yes, the links work now. Sorry for the delay, I've been working on my own projects as of late. Honestly I'm not sure where to begin with the native project, it's in quite a state. Is there a reason you defined and implemented functions in the header files? You're also allocating memory on the heap and never freeing it; that's less than ideal. I'm not much of a developer or a C++ guy, but I'll give refactoring this a shot; it's just going to be a bit.
  19. I went to take a look at this tonight but both links 404'd. I checked your GitHub user name and it shows that you have no repos.
  20. M.2 is a form factor, so that will be fine. If you mean NVMe, that's even better. Threadripper would not be my first choice. Currently toolpath generation favors single thread performance, so I'd look at the Ryzen 7 3800, Ryzen 9 3900 or the i9-9900.
  21. I looked over the thread where you detail the issue and I do see a few odd things in the managed code. Is the entire Visual Studio solution available some where? I'd like to see if I can duplicate the behavior.
  22. I wouldn't say I'm advanced; I have so much to learn it's crippling at times. I'm extremely fortunate to work with great people that are willing to share the knowledge they have amassed over the years. I have done several C++/C# interop hooks and I've never had an issue. I wouldn't expect F# to make any difference; doesn't it compile to the same intermediate language as 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...