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

Custom Tool point of insertion

Recommended Posts

Hi,

 

I'm making a custom tool that places text, with data attached, onto the drawings.

 

If the user picks a point on the drawing, how do I determine where that is? How do you get feedback from the tool?

 

Share this post


Link to post

The click to insert the object into the drawing will be the origin (0,0) of everything you code inside the object. Just like in a symbol.

You can get a handle to the PIO with GetCustomObjectInfo. Then you can get the coordinates of the insertion point with GetSymLoc3D.

Share this post


Link to post

That could help if I needed to move the text from 0, 0 at a later stage ☺️

 

But I would like to know where to move it. I would like to know where the user clicked to place the text.

 

If the tool was set up with parameters (eg. x1 - X Coordinate, y1 - Y Coordinate), would the recordHandle record them and how do I get them out?

 

Share this post


Link to post

Check out the User Interactive procedures in the Function Reference. Specifically the one you probably want is:

 

PROCEDURE   GetPt

(VAR pX:REAL;

 VAR pY:REAL

) ;

 

This returns the X and Y coordinates of the position the user clicked at. Use that as the insertion point for your object.

Share this post


Link to post

That's too simple, but it works ☺️

 

I tried MouseDown without luck to I thought it needed some Tool command.

 

Thanks.

 

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.

×