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:

JKLINE

Verified Members
  • Posts

    166
  • Joined

  • Last visited

Everything posted by JKLINE

  1. I do have that. I'm logged in and still have access to NET-Script downloads idk, I emailed their sales department.
  2. How new is this? And where is it? It looks like I have lost access to the SDK Downloads, C-Hook downloads, and NetHook downloads
  3. Nethooks are easy because of the Nethook API documentation. How do you find the terms/names of items in C++? -- Using Visual Studio 2022 and Mastercam 2022 by the way.
  4. I'm not against taking the first steps towards a Chook instead of a NetHook if you can introduce me
  5. That's a negative. It's angled at either 10, 15, 20, or 30 degrees at a negative depth. This here is an example of an end result. White line is the supplied geometry. We offset the green geometry. And then draft a surface down.
  6. And to think, I added all that nonsense to prevent such a thing from happening It definitely fixed it. You're absolutely right, I've forgotten about that. First I tried the 'equals' method but that didn't work so I switched to calculating the area. Wanting it to offset everything except for the bounding box when selecting the 'area'. -------- Thankfully we've all been using the same resolution or the cursor point wouldn't have worked I greatly appreciate the help! This has completed all my tickets I've emailed in except for the last one, asking about converting. (I think it'll just be a matter of refactor/rename/find+replace but I'm a rookie) I've sent it to your sales email. As for surfaces, I've asked about creating a draft surface. 98% of what this company does is offset chains (worked my way through that) and then drafting surfaces from those chains. There's an API that might be able to help since there are no Surface Creation tools in the Nethook API kit.
  7. Are you referring to the ChainData API kit? I'm not sure if I'm allowed to give it out I sent SDK@Mastercam an email requesting that and the surfaces API kit. If Roger says I can then I'll email it over to you. I haven't gotten the surface kit yet though.
  8. This has been what I have been doing var cutResultGeometry = SearchManager.GetResultGeometry(); foreach (var entity in cutResultGeometry) { entity.Color = 11; entity.Selected = true; entity.Commit(); }
  9. Running translate(); findIntersectionOfLines(); findIntersectionOfArcs(); clearTempLinesAndArcs(); breakArcsWithPoints(); selectNewGeo(); colorCrossovers(); movePoints(); seperateGeometry(); Results in -------------------------------------------------------------------------------------- Running translate(); findIntersectionOfLines(); findIntersectionOfArcs(); clearTempLinesAndArcs(); breakArcsWithPoints(); selectNewGeo(); colorCrossovers(); movePoints(); seperateGeometry(); offsetCutchain80(); Results in (level 81 got moved to level 501) -------------------------------------------------------------------------------------- Running translate(); findIntersectionOfLines(); findIntersectionOfArcs(); clearTempLinesAndArcs(); breakArcsWithPoints(); selectNewGeo(); colorCrossovers(); movePoints(); seperateGeometry(); offsetCutchain81(); Results in (level 80 got moved to level 501) -------------------------------------------------------------------------------------- This is not the result you are having Roger?
  10. I've tried that, but there's an error. "no overload for method 'repaint' takes 2 arguments" That second overload was added in the 2023 package. I've changed this and level 81 still went missing If you ommit offSetCutChain80() and only run those first few it completes level 80 and 81.
  11. //invalidate the list of geometry geometryFound = null; //ask to reclaim the memory from the list System.GC.Collect(); These are new terms for me, and I appreciate the knowledge I've tried this in different areas of the program to no avail. https://github.com/UberGamz/CustomNethook MCAM file included. -- if ran AS IS, geometry from level 81 gets moved to level 501.
  12. That's where I keep getting lost. At no point do I tell it anything about level 81, but the geometry on level 81 gets moved. The geometry on level 75 gets duplicated in translate() and those duplicates are deleted in clearTempLinesAndArcs(). The geometry on level 75 is then broken in breakArcsWithPoints(). The geometry on level 75 is then colored in colorCrossovers() and then half of the geometry is moved to level 80 and the other half is moved to level 81 in seperateGeometry(). After all of this is done, there are no errors but when I run offsetCutChain80() it completes the void but the geometry on level 81 gets moved. offsetCutChain80() offsets the geometry on level 80, not on level 81. And when I run offsetCutChain81() instead of offsetCutChain80(), the geometry on level 80 gets moved I believe this is the root of all my issues How do you reset/update the geometry? var levels = LevelsManager.GetLevelNumbersWithGeometry(); foreach (var i in levels){ var geometryFound = SearchManager.GetGeometry(i); foreach (var t in geometryFound){ t.Commit(); t.Retrieve(); } GraphicsManager.Repaint(true); } I've tried running this before offsetCutChain80()
  13. The geometry ends up on a different level. It gets corrupt because there is no geometry on the certain level of activities. That part is completely my fault. But the moving geometry is odd. Because it only moves if the whole thing is ran. I've tried Graphics.clear(true) after each method as well. Also tried a sleep.
  14. My geometry disappears after the dashed line. If I run all the methods before the dash line, everything is great. If I run all the methods after the dash line, everything is great. If I run all the methods before the dash line, save and exit, then run all the methods after the dash line, everything is great. If I run all the methods, geometry goes missing and my file becomes corrupt. Because it works after a reload, that would suggest there is no error in the code. Perhaps it's a memory leak? There is no memory usage increase while running the NetHook though. I could separate it into two different files, but I need the data stored in the first half. translate(); findIntersectionOfLines(); findIntersectionOfArcs(); clearTempLinesAndArcs(); breakArcsWithPoints(); selectNewGeo(); colorCrossovers(); movePoints(); seperateGeometry(); ------------------- offsetCutchain80(); offsetCutchain81(); shortenChains500(); shortenChains501();
  15. Solution. It's about as ugly as it gets. void offsetCutchain80(){ var commonParams = new BoundingBoxCommonParams { CreateLinesArcs = true }; var rectangularParams = new BoundingBoxRectangularParams {ExpandXMinus = 2.0,ExpandXPlus = 2.0,ExpandYMinus = 2.0,ExpandYPlus = 2.0}; var boundingBox = Mastercam.GeometryUtility.GeometryCreationManager.RectangularBoundingBox(commonParams, rectangularParams); var boundingBoxChain = ChainManager.ChainGeometry(boundingBox); GraphicsManager.FitScreen(); void SendLeftClick(int posX, int posY){ Cursor.Position = new Point(posX, posY); mouse_event(MouseEventLeftDown, 0, 0, 0, new System.IntPtr()); Thread.Sleep(100); mouse_event(MouseEventLeftUp, 0, 0, 0, new System.IntPtr()); } new System.Threading.Timer((x) => { GraphicsManager.SetFocusToGraphicsWindow(); }, null, 1000, Timeout.Infinite); new System.Threading.Timer((x) => { SendKeys.SendWait("{A}"); }, null, 2000, Timeout.Infinite); new System.Threading.Timer((x) => { SendLeftClick(1200,600); }, null, 3000, Timeout.Infinite); new System.Threading.Timer((x) => { SendKeys.SendWait("{ENTER}"); }, null, 6000, Timeout.Infinite); var selectedCutChain = ChainManager.GetMultipleChains(""); foreach (var chain in selectedCutChain){ foreach (var t in boundingBoxChain){ if (chain.Area != t.Area){ chain.Direction = ChainDirectionType.Clockwise; chain.OffsetChain2D(OffsetSideType.Right, .0225, OffsetRollCornerType.None, .5, false, .0001, false); GraphicsManager.ClearColors(new GroupSelectionMask(true)); } } } foreach (var entity in boundingBox){ entity.Retrieve(); entity.Delete(true); } GraphicsManager.Repaint(true); } offsetCutchain80(); return MCamReturn.NoErrors;
  16. I was more interested in selecting an area for the chaining portion. GetMultipleGeometry() -- but have it select instead of prompt
  17. I've found a way to delay input, so it can be sent during a Mastercam Prompt() This works void SendLeftClick(int posX, int posY){ Cursor.Position = new Point(posX, posY); mouse_event(MouseEventLeftDown, 0, 0, 0, new System.IntPtr()); Thread.Sleep(100); mouse_event(MouseEventLeftUp, 0, 0, 0, new System.IntPtr()); } new System.Threading.Timer((x) => { GraphicsManager.SetFocusToGraphicsWindow(); }, null, 2000, Timeout.Infinite); new System.Threading.Timer((x) => { SendKeys.SendWait("{A}"); }, null, 5000, Timeout.Infinite); new System.Threading.Timer((x) => { SendLeftClick(1200,600); }, null, 6000, Timeout.Infinite); new System.Threading.Timer((x) => { SendKeys.SendWait("{ENTER}"); }, null, 7000, Timeout.Infinite);
  18. Is there a way to have Mastercam simulate a user? SendKeys.Send doesn't work so I have to use SendKeys.SendWait. This will not always work. Specifically asking about mouse clicks (to include moving the mouse) and pressing hotkeys (like the key 'W' for "Window") Do I need to make a new UIEventData and then have a GetEvent and then Dispose()?
  19. That is definitely a clever idea! FirstID & LastID with isFlipped, add it to a list and then later delete it. Very clever indeed. Thank you
  20. In your earlier post, you said I can not get the outcome I desire because they are not closed chains. That gave me the idea of using the 'area' method in the Chain Selection UI. (Inside a bounding box). Since there's no 'area' method in the ChainManager, I'm thinking I could automate the user input portion. ex. Hotkey "a" then Mouse.LeftButton = pressed
  21. If you create a box around all the geometry, and use 'area' upon selection, everything turns out correctly I don't see a way to capture area as a chain. System.Console.CursorLeft?
  22. I just committed the code. I thought 'push' overwrote everything. The new code only contains those few lines needed. #noob

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