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

Tracking PIO movement

Recommended Posts

Is there an event code that will indicate that the PIO moved, and returning where it was and where it is.  Here is the problem.  I have a control point that is at the end of a line pointing to an object, a place on an object, that is outside the PIO.  When I move the PIO, I want the end of the line to stay ending at the location it was at before the PIO was moved.  Currently the line is drawn from the center of the PIO to the control point.  When the PIO moves, the control point moves, and the control point is no longer at the place on the external object that the user wishes to be.  So, my first thought is that if I know the change, from where to where, that the PIO moved I can place the control point back where it was by moving it in the opposite direction.  If there is no such event, then a way to retrieve that same information during a reset event would also work, but I don't know how to do that either.  I had another thought that I might place a locus and draw back to that, but, obviously, the locus moves just as the control point moves.  Any help out there?

 

TIA.

Share this post


Link to post

You might be able to do it in the reset evert (3) using this:

 

Flag := vsoStateGetParamChng(ghParm, gOutWidgID, gn, gsOldParmValue);

 

gOutWidgID is the widget ID of the param that has changed.

gsOldParmValue is the previous parameter value.

 

I've never used it with control points though, so good luck.

Share this post


Link to post

You can do it with object states — there is a vsoStateGet call for moving and one for rotating objects (see Beam Draw as an example). 

 

This gets trickier if the PIO is also rotated and you should decide how you want to handle mirroring and duplicating. 

Share this post


Link to post

I received detailed help from Andy Dunning.  As Josh pointed out the key was a vslStateGet call

 

FUNCTION   vsoStateGetPos( ObjHandle;VAR X, Y , Z : REAL; VAR outIs3D:BOOLEAN) :BOOLEAN ;

 

Andy gave me an example and a heads up about converting results from mm to drawing units.

 

Thanks all.

Share this post


Link to post

Another way to structure the pio is to have the pio origin at the object it is connected to and have the control point as the moving part of the pio.

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.

×