×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Please help to get this done!

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

RE: Please help to get this done!

This quick LISP might be a start for you.
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!

(OP)
Thank you, IFRs,

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!

I think you want to replace the lines

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources