Please help to get this done!
Please help to get this done!
(OP)
I am using AutoCAD 2002. My question is:
I would like to write a simple routine to realize this:
In the paper space, say, layout, if I pick a point in a viewport which is representing an elevation view of the 3D model, How can I retrieve the Z coordinate of that point in the model space and annotate its elevation at the same point in the paper space?
I would like to realize it by only clicking the mouse button.
Thank you very much!
Foresthills
I would like to write a simple routine to realize this:
In the paper space, say, layout, if I pick a point in a viewport which is representing an elevation view of the 3D model, How can I retrieve the Z coordinate of that point in the model space and annotate its elevation at the same point in the paper space?
I would like to realize it by only clicking the mouse button.
Thank you very much!
Foresthills





RE: Please help to get this done!
You may want to change the "53" to your desired OSnap setting and possibly get rid of the X and Y coordinate portions.
(DEFUN C:PTT (/ osm p1 x y z s h p2) ; ID a point, place coordinates text
(setq osm (getvar "osmode"))
(command "osmode" 53)
(command "MSPACE")
(setq p1 (getpoint "\nPick the point to be ID'd: ")
x (car p1)
y (cadr p1)
z (caddr p1)
s (strcat "(" (rtos x) "," (rtos y) "," (rtos z) ")" )
h (getvar "textsize")
)
(command "osmode" 0)
(command "PSPACE")
(setq p2 (getpoint "\nPick point for middle of text: "))
(COMMAND "TEXT" "Ju" "M" p2 h "0" s)
(command "osmode" osm)
)
RE: Please help to get this done!
Your lisp works greatly!
The only issue is:
In my drawing, anytime when I use lisp routine to write a piece of text, I cannot set textheight in the command line, otherwise it will always put the rotation angle in, i.e., I cannot say this:
(command "text" startpoint textheight angle text)
but only:
(command "text" startpoint angle text)
And, if I don't want to pick a point on the screen again for the position of the text, in another word, I just want to draw a lead line from the point I picked already in the model space to put the elevation text, the only difference is the line and text will be in the paper space, is that possible?
I appreciate your help!
Foresthills
RE: Please help to get this done!
(setq p2 (getpoint "\nPick point for middle of text: "))
(COMMAND "TEXT" "Ju" "M" p2 h "0" s)
with
(COMMAND "LEADER" pause pause "" s "")
Let us know if that works like you want.