Zaffin_D
Verified Members-
Posts
374 -
Joined
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Everything posted by Zaffin_D
-
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.
-
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.
-
Look up the acomboinfo function in the MP documentation, it will do what you need.
-
Yes, you can read the axis combination; what version of Mastercam are you using?
-
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.
-
The holder name is output to the 20020 NCI line.
-
Using Productivity Plus inside Mastercam
Zaffin_D replied to PcRobotic's topic in Post Processor Development Forum
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. -
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)
-
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.
-
How do I change words in the DRILL CYCLE?
Zaffin_D replied to PcRobotic's topic in Post Processor Development Forum
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. -
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.
-
Locking multiple sessions of the same part
Zaffin_D replied to AHarrison1's topic in Industrial Forum
I found another half hour so I added a method to save a locked file. FileLocker1_1.zip -
Locking multiple sessions of the same part
Zaffin_D replied to AHarrison1's topic in Industrial Forum
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. -
Locking multiple sessions of the same part
Zaffin_D replied to AHarrison1's topic in Industrial Forum
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 -
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.
-
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.
-
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.