Zaffin

Verified Members
  • Content count

    268
  • Joined

  • Last visited

Community Reputation

137 Excellent

2 Followers

About Zaffin

  • Rank
    Member

Recent Profile Visitors

1,042 profile views
  1. I think I see what's going on here; by non-reserved plane you mean a view that doesn't appear in the view manager? For example the view of a rotated arc? You should be able to get the arc's view matrix by using the get_view_matrix function.
  2. Zaffin

    Siemens 3x mill post

    You should head over to Mastercam's tech exchange and download the Siemens 3x_4x mill post; the post you have is the older unsupported version.
  3. Zaffin

    Siemens 3x mill post

    Are you using the Siemens 3x post (older, no longer supported by CNC) or the Siemens 3x_4x post (currently supported)? Also not every Siemens control is supported, what control are you using?
  4. Zaffin

    Long Post Times

    Is a rapid move being wrapped? If so it's a post issue. @Chally72 can get it to the right team I'm sure.
  5. What version of Mastercam are you using? In Mastercam 2020 the GetPlanePtrByID() function works as expected in my testing. Can you share a file? C++, Why are you using a char array? And why so big? 5000 bytes of continuous memory seems excessive.
  6. Typically I create a global alias for the variable and format it, but you can also use the new address function nwadrs( ); just remember to set the format back after output.
  7. I suppose you could read/write the value to/from a text file, something like the below; return : 0 my_setting : 0 fs2 4 1 0 1 0 fmt "" 4 my_setting fbuf 1 1 1 1 0 fq 1 my_setting "Enter a number" p_load_question_defaults spathaux$ = smc_user_dir$ snameaux$ = "questionDefaults" sextaux$ = ".txt" sbufname1$ = spathaux$ + snameaux$ + sextaux$ if not(fexist(sbufname1$)), [ auxprg$ = 1 subout$ = 2 newaux$ *my_setting, e$ return = fclose(sbufname1$) subout$ = 0 ] else, [ my_setting = rbuf(1,1) ] p_save_question_defaults my_setting = wbuf(1,1) pheader$ p_load_question_defaults "Default value read from file :", *my_setting, e$ q1 "Value entered in prompt :", *my_setting, e$ p_save_question_defaults
  8. I had some time today so I dug into this. I started by drawing a 1" diameter arc in the Top view. I then copy-rotated the arc about the Y-axis giving me two arcs shown below. I wrote a quick hook to query the arcs, results below. There are a couple ways to work around this. The best thing would be to create a CLR project and call the C-Hook SDK's get_view_matrix function as shown in the .gif above, but you cold also fake it. You can fake it without using the C-Hook SDK, but the calculated matrix probably won't match the matrix from get_view_matrix; see the CreateViewFromArc(ArcGeometry arc) method below. namespace ArcMatrixExampleManaged { using System.Linq; using Mastercam.IO; using Mastercam.Database; using Mastercam.Database.Types; using Mastercam.Curves; using Mastercam.App; using Mastercam.App.Types; using Mastercam.Support; using Mastercam.Math; using ArcServiceNative; public class Main : NetHook3App { bool CreateViewFromArc(ArcGeometry arc) { arc.Data.StartAngleDegrees = 0; arc.Data.EndAngleDegrees = 90; var vectorOne = VectorManager.Normalize(arc.EndPoint1); var vectorTwo = VectorManager.Normalize(arc.EndPoint2); var vectorThree = VectorManager.Normalize(Point3D.Cross(vectorOne, vectorTwo)); var arcView = new MCView() { ViewName = $"Arc View[{arc.TimeStamp}]", ViewOrigin = arc.Data.CenterPoint, ViewMatrix = new Matrix3D(vectorOne, vectorTwo, vectorThree) }; return arcView.Commit(); } public override MCamReturn Run(int param) { using (var arcService = new ArcService()) { var arcMask = new GeometryMask(false) { Arcs = true }; var selectedArc = (ArcGeometry)SelectionManager.AskForGeometry("Select and Arc", arcMask); if (selectedArc != null) { var arcViewMatrix = selectedArc.View.ViewMatrix; var managedViewMatrix = SearchManager.GetViews(selectedArc.ViewNumber).FirstOrDefault(); var nativeViewMatrix = arcService.GetViewMatrix(selectedArc.ViewNumber); DialogManager.OK("View Matrix from ArcGeometry object\n" + $" {arcViewMatrix.Row1.ToString()}\n" + $" {arcViewMatrix.Row2.ToString()}\n" + $" {arcViewMatrix.Row3.ToString()}\n" + $"\n" + $"View Matrix from SearchManager.GetViews\n" + $" {managedViewMatrix?.ViewMatrix.Row1.ToString()}\n" + $" {managedViewMatrix?.ViewMatrix.Row2.ToString()}\n" + $" {managedViewMatrix?.ViewMatrix.Row3.ToString()}\n" + $"\n" + $"View Matrix from native get_view_matrix\n" + $" X{nativeViewMatrix.AxisX.X.ToString("0.0000")} Y{nativeViewMatrix.AxisX.Y.ToString("0.0000")} Z{nativeViewMatrix.AxisX.Z.ToString("0.0000")}\n" + $" X{nativeViewMatrix.AxisY.X.ToString("0.0000")} Y{nativeViewMatrix.AxisY.Y.ToString("0.0000")} Z{nativeViewMatrix.AxisY.Z.ToString("0.0000")}\n" + $" X{nativeViewMatrix.AxisZ.X.ToString("0.0000")} Y{nativeViewMatrix.AxisZ.Y.ToString("0.0000")} Z{nativeViewMatrix.AxisZ.Z.ToString("0.0000")}\n", "Arc View Report"); var result = CreateViewFromArc(selectedArc); } } return MCamReturn.NoErrors; } } }
  9. Are you trying to create a view from a rotated arc? If so you'll find that if the arc's view matrix is incorrect if the arc's view isn't in the database. I do have a few solutions; let me know if I'm on the right track and all post them.
  10. Zaffin

    Haas 617 alarm missing adress code

    I'd make sure there isn't anything unexpected in your output, maybe open the .nc file with a hex editor?
  11. Ahh I see the issue! The alive bit gets manipulated when moving geometry and when removing a solids history. Checking to make sure the solid is alive seems to solve the issue. std::vector<DB_LIST_ENT_PTR> GetAllSolids() { int numberOfSolidsSelected = 0; std::vector<DB_LIST_ENT_PTR> dblistptrvector; auto entityPointer = db_start; while (entityPointer != nullptr) { if (entityPointer->eptr->id == SOLID_ID && entityPointer->eptr->sel & ALIVE_BIT) { if (sel_bit_is_off(BLANK_BIT, entityPointer->eptr->sel)) { numberOfSolidsSelected++; dblistptrvector.push_back(entityPointer); } } entityPointer = entityPointer->next; } if (numberOfSolidsSelected) { repaint_graphics(); } return dblistptrvector; }
  12. In my half hour of testing both functions return the same values, I've tried blanking and hiding entities, removing them, adding non solids; they return the same vector. Are you testing the functions outside of your project?
  13. I looked over the commit and nothing jumps out at me as fixing the problem. It did raise two questions though; Why are you using memset? Why are you using NULL and not nullptr?
  14. I assume you mean std::vector<double>dogetgeometry()? I could not find a void overload for dogetgeometry(). This project is in quite the state and I don't have time to dissect it (again); I'm sure someone else can help you out.
  15. Without the entire project and steps to reproduce this is going to be tough to track down. My gut says this is not a memory issue.

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