Jump to content
Developer Wiki and Function Reference Links Read more... ×
AFDesign

How to detect screen plane/layer plane?

Recommended Posts

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

Share this post


Link to post

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. 

Share this post


Link to post

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?

Share this post


Link to post

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.

Share this post


Link to post

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!

Share this post


Link to post

Try GetPlanarRef(). I can’t recall off the top of my head if 0 is ground or screen. 

Share this post


Link to post
Posted (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 by AFDesign

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×