Jump to content
Sign in to follow this  
Dieter @ DWorks

finding the exact insertion point of pio

Recommended Posts

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.

Share this post


Link to post

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

Share this post


Link to post

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.

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.

Guest
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.

Sign in to follow this  

 

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...