BlakeET Posted August 22, 2011 Share Posted August 22, 2011 I have a script that prints a simple line of text with the XY dims of a mouse click. It works great on my drawing layer. I'm wondering if it's possible to have this same functionality inside a viewport under edit annotations. Changing the origin using the set origin tool doesn't work because it seems to use the sheet layer scale instead of the scale from the layer that the viewport is referencing. Thanks. For reference my script is below. PROCEDURE XYloc; VAR X, Y : REAL; X1, Y1 : REAL; BEGIN GetPt(X,Y); REPEAT UNTIL MouseDown(X1,Y1); TextOrigin(X1, Y1); BeginText; Concat('X:',Num2StrF(X),' Y:',Num2StrF(Y)) EndText; END; RUN(XYloc); Quote Link to comment
maarten. Posted August 23, 2011 Share Posted August 23, 2011 Didn't test it so could be wrong. With GetObjectVariableReal(Handle to viewport,1003) you can get the scale, so then it's just your coordinates * that scale. But i think you also need the position of that viewport. 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.