Dieter @ DWorks Posted December 15, 2007 Share Posted December 15, 2007 maybe I'm overlooking it, but how can you find the exact insertion point of the pio currently executing. (so from in the pio itself). I tried Get2DPt, but this will give the center of the group of objects in my pio. I can't use GetBBox because the insertion point is somewhere inside it, and not in the middle. Quote Link to comment
ccroft Posted December 15, 2007 Share Posted December 15, 2007 Don't know if it works in a currently executing PIO, but GetSymLoc looks promising. Quote Link to comment
Vectorworks, Inc Employee Robert Anderson Posted December 15, 2007 Vectorworks, Inc Employee Share Posted December 15, 2007 CCroft is right; GetSymLoc() should do it. Quote Link to comment
Gerard Jonker Posted December 16, 2007 Share Posted December 16, 2007 Hi Robert, Please allow me to quote from my own work: ....snip....The coordinates of the insertion point (the position of the object) can be read by the object's code, too. However, they always return the position of the Plug-in Object relative to the Internal Origin, whether the User Origin was moved or not. It seems like the User Origin is temporarily is reset to (0,0), making it impossible to let the object retrieve it's own location relative to the User Origin. Of course there are only a small number of Plug-In Object types that really need such possibilities. Therefore there has been only a limited number of complaints about this issue on the VectorScript list, showing a false image of reality. I ensure you that every end user who has ever tried to make a Plug-In object will immediately write a simple "I Show My Current Location" type of Plug-In once that barrier is lifted. http://www.vectorlab.info/index.php?title=Absolute_Origin#Plug-In_Objects PROCEDURE HereAmI; VAR hParm, hParmRecord, hWall : HANDLE; PIOName, txtStr: STRING; x, y : REAL; BEGIN IF GetCustomObjectInfo(PIOName, hParm, hParmRecord, hWall) THEN BEGIN GetSymLoc(hParm, x, y); txtStr:= Concat(x, ' / ', y); Locus(0, 0); TextOrigin(0, 0); BeginText; txtStr EndText; END; END; Run (HereAmI); Thanks, Gerard Quote Link to comment
Dieter @ DWorks Posted December 17, 2007 Author Share Posted December 17, 2007 thx guys, it works now, I've just overseen this function. (feeling stupid) It doesn't matter if it gives the coordinates relative to the intern origin. I'm using it for getting the distance between the pio's. Who does change the origin? I never done that, and it should never be done. It only bring problems. 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.