WhoCanDo Posted July 31, 2019 Share Posted July 31, 2019 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? Quote Link to comment
Peter Vandewalle Posted July 31, 2019 Share Posted July 31, 2019 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. Quote Link to comment
WhoCanDo Posted July 31, 2019 Author Share Posted July 31, 2019 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? Quote Link to comment
Pat Stanford Posted July 31, 2019 Share Posted July 31, 2019 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. Quote Link to comment
WhoCanDo Posted July 31, 2019 Author Share Posted July 31, 2019 That's too simple, but it works ☺️ I tried MouseDown without luck to I thought it needed some Tool command. Thanks. 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.