×
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

LISP Routine to place a Northing and Easting at the end of a leader

LISP Routine to place a Northing and Easting at the end of a leader

LISP Routine to place a Northing and Easting at the end of a leader

(OP)
My first post!
I found this code on this forum posted by IFRs (Petroleum)and made a couple changes based on what I was able to figure on my own.

(DEFUN C:PTT (/ osm p1 x y s p2) ; ID a point, place coordinates text
 (graphscr)
 (setq osm (getvar "osmode"))
 (command "osmode" 53)
 (setq p1 (getpoint "\nSNAP to point to be ID'd: ")
        x (car p1)
        y (cadr p1)
        s (strcat "N:" (rtos y)"'" " E:" (rtos x)"'" )
  )
 (command "osmode" 0)
 (setq p2 (getpoint p1 "\nPick point for end of Leader: "))
 (COMMAND "DIM1" "LE" p1 p2 "" s)
 (command "osmode" osm)
 (princ)
)


I would like to see the N coordinate on one line and the E coordinate below it in the graphic. Can someone show me how to accomplish this? Thanks in advance.

RE: LISP Routine to place a Northing and Easting at the end of a leader

Add a "\P" to break a line.  ie try  (strcat "N:" (rtos y)"'\P" " E:" (rtos x)"'" )

RE: LISP Routine to place a Northing and Easting at the end of a leader

(OP)
IFRs:
First of all: Thanks for posting the original code.

I still can't get the break to work though. I wind up with a "P" between my northing and easting in the graphic.

RE: LISP Routine to place a Northing and Easting at the end of a leader

(OP)
A reply from the autodesk forum works good!

Your code with the minor modifications:

(DEFUN C:PTT (/ osm p1 x y s p2) ; ID a point, place coordinates text
(graphscr)
(setq osm (getvar "osmode"))
(command "osmode" 53)
(setq p1 (getpoint "\nSNAP to point to be ID'd: ")
x (car p1)
y (cadr p1)
s (strcat "N:" (rtos y) "'" "\n" "E:" (rtos x) "'")
)
(command "osmode" 0)
(setq p2 (getpoint p1 "\nPick point for end of Leader: "))
(COMMAND "DIM1" "LE" p1 p2 "" s)
(command "osmode" osm)
(princ)
)


Again...Thanks for everything!

RE: LISP Routine to place a Northing and Easting at the end of a leader

I knew it was a slash something!  Good work!

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