AFDesign Posted May 6, 2019 Share Posted May 6, 2019 Hi, I'm working with a 2D path object plugin, and I'd like to detect if the path has been created on a screen plane or layer plane. I tried this: GetObjectVariableBoolean(handle, 1160); using both plugin and path handles, but I always get the same result drawing in screen plane or layer plane. Any advice is appreciated, thanks! Andrea Quote Link to comment
Pat Stanford Posted May 6, 2019 Share Posted May 6, 2019 Try using GetObjectVariableBoolean (handle, 651) This should return True for a Screen Plane Object. Also take a look at 650 which will return true for a 3D (Layer Plane) object. Quote Link to comment
AFDesign Posted May 6, 2019 Author Share Posted May 6, 2019 Thank you Pat, I tried but I always receive the same result, using 650 and 651. Maybe it is possible to detect if the plane is horizontal or tilted? Quote Link to comment
Pat Stanford Posted May 6, 2019 Share Posted May 6, 2019 Can you post a small sample file showing this issue. I just tested this before I posted. I drew a line in layer plane. Duplicated it and converted to Screen Plane and then ran the following one-line script. Message(Date(2,2),' 650:',GetObjectVariableBoolean(FSActLayer,650),' 651:',GetObjectVariableBoolean(FSActLayer,651)); Message(Date(2,2),' 650:',GetObjectVariableBoolean(FSActLayer,650),' 651:',GetObjectVariableBoolean(FSActLayer,651)); I get reversed results between the Layer and Screen plane versions. Quote Link to comment
AFDesign Posted May 6, 2019 Author Share Posted May 6, 2019 Sorry I'm using a 2D path plugin so I can't post a small sample. I will create a new 2d path plugin and I will try your advice on it! I will let you know if it works tomorrow. Thank you! Quote Link to comment
JBenghiat Posted May 6, 2019 Share Posted May 6, 2019 Try GetPlanarRef(). I can’t recall off the top of my head if 0 is ground or screen. Quote Link to comment
AFDesign Posted May 7, 2019 Author Share Posted May 7, 2019 (edited) GetPlanarRef doesn't work too. I created a new 2d path plugin and GetObjectVariableBoolean 650 and 651 works correctly, Pat! I will check what's wrong in my code. EDIT: Now I understood. Variable 650/651 read if an object is 2D or 3D: a 2D object in a custom plane is detected as 3D. For this reason the new plugin I created works, because I only created a 2D polyline to test. But my plugin use the 2D path to create a 3D object, so I receive the same value because my object is a 3D object, in both screen or plan mode. The only way to solve my problem is being able to read the custom plane tilt, but I didn't find a command for this. (I found GetWorkingPlaneN but it isn't relative to an object) Thank you all! Edited May 7, 2019 by AFDesign Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.