Sam Jones Posted November 29, 2018 Share Posted November 29, 2018 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. Quote Link to comment
Julian Carr Posted November 30, 2018 Share Posted November 30, 2018 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. Quote Link to comment
JBenghiat Posted November 30, 2018 Share Posted November 30, 2018 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. Quote Link to comment
Sam Jones Posted November 30, 2018 Author Share Posted November 30, 2018 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. Quote Link to comment
Miguel Barrera Posted November 30, 2018 Share Posted November 30, 2018 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. 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.