Jump to content
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?



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

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.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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.

  • Create New...