-
Posts
61 -
Joined
-
Last visited
Recent Profile Visitors
1,032 profile views
Compaq007's Achievements
-
I thought that for any educational versions of Mastercam, you can't post or export anything. Is that right?
-
I experienced it since June, 2023 and been waiting for someone to chime in about View Sheets Groups. It is a great idea, I hope they work it out for the next MasterCAM release.
-
Compaq007 changed their profile photo
-
Suggest me a book that is about Self development.
Compaq007 replied to imran98k's topic in Educational Forum
Very noble of you. thank you -
Suggest me a book that is about Self development.
Compaq007 replied to imran98k's topic in Educational Forum
Another useful resource is eaprentice.net. At least it was for me. I learned about MP postprocessing language. Not sure if they are still in business anymore. But it was an enlightening course and it made me more confident at my job. -
I hope that the images above make any sense in my explanation. Tried to upload them at the very beginning for clarity but I had some trouble in doing so. Like I said before, I lack experience at this, and I trying my best. Just wondering if anyone has experience the same issue and can point me in the right direction. Here is a snippet of the code I am using ; public static class PointTransformXY { //bool GetPointFromUser(bool display, string prompt, ref Mastercam.Math.Point3D pt) public static Mastercam.Math.Point3D GetPointFromUser(bool display, string prompt) { var pt = new Mastercam.Math.Point3D(); Mastercam.Database.MCView cPlane = Mastercam.IO.ViewManager.CPlane; Array allViews = Mastercam.IO.ViewManager.GetAllViews(true); var strTargetPlane = cPlane.ViewName; // Ask the user to select a single POINT geometry item. bool result = Mastercam.IO.SelectionManager.AskForPoint(prompt, Mastercam.IO.Types.PointMask.Null, ref pt); if (result) { string dataWorld = string.Format("X: {0}\nY: {1}\nZ: {2}", pt.x, pt.y, pt.z); MessageBox.Show(dataWorld, "Point (World)", MessageBoxButtons.OK, MessageBoxIcon.Information); } // Convert the World coordinates of the point to a specific View# (in this case the CPlane) //Mastercam.Math.Point3D ptInView = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, cPlane.ViewNumber); //Mastercam.Math.Point3D ptInView1 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(ptInView, cPlane.ViewNumber); Mastercam.Math.Point3D ptInView1 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, cPlane.ViewID); Mastercam.Math.Point3D ptInView2 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, 2); Mastercam.Math.Point3D ptInView3 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, 3); Mastercam.Math.Point3D ptInView4 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, 4); Mastercam.Math.Point3D ptInView5 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, 5); Mastercam.Math.Point3D ptInView6 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, 6); Mastercam.Math.Point3D ptInView7 = Mastercam.IO.ViewManager.ConvertToWorldCoordinates(pt, 7); // Mastercam.Math.Point3D ptInView = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt); // Convert the World coordinates of the point to the current CPlane View Mastercam.Math.Point3D ptInView11 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(ptInView1, cPlane.ViewID); Mastercam.Math.Point3D ptInView22 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt, 2); Mastercam.Math.Point3D ptInView33 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt, 3); Mastercam.Math.Point3D ptInView44 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt, 4); Mastercam.Math.Point3D ptInView55 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt, 5); Mastercam.Math.Point3D ptInView66 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt, 6); Mastercam.Math.Point3D ptInView77 = Mastercam.IO.ViewManager.ConvertToViewCoordinates(pt, 7); if (display) { string dataView = string.Format("View#: {0}\nName: {1}\nX: {2}\nY: {3}\nZ: {4}", cPlane.ViewNumber, cPlane.ViewName, ptInView77.x, ptInView77.y, ptInView77.z); MessageBox.Show(dataView, "Point (View)", MessageBoxButtons.OK, MessageBoxIcon.Information); } return pt; } } Cheers!
-
The next slide, is the debug mode and it shows the results at runtime. You can see the non-standard view 53 (2a_FRONT_PLANE) is being used for world transformation of the point coordinates. But instead looks like it is transforming from World coordinates to the standard MasterCAM's view 2 (Front). The actual point coordinate values are circled above Line 32. At line 44 the values are converted to view coordinates using the values from ptInView1 in refence to view 53. The results should be X1.1,Y-2.3,Z-4.7, instead we have X1.1,y2.2Z-3.3. as sown at line 42.
-
Compaq007 started following Chook convert to view coordinates
-
I am working on this Chook for Mastercam 2021, I don't have a lot of experience, but what I'm trying to do is convert the X Y Z of a single-point from a given view to another view and output that information to a text file. I am using the viewManager.IO.ConvertToWorldCoordinates and viewManager.IO.ConvertToWorldCoordinates . One thing I notice about this functionality is that it does don't work for non-standard (custom) Mastercam views. It always defaults to one of the standard Views. So, it outputs the dimensions referencing the standard View and not the custom View. I ran a few tests and came up empty.
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.