Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

PhillySurveyor

Civil/Environmental
Aug 6, 2006
3
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.
 
Replies continue below

Recommended for you

Add a "\P" to break a line. ie try (strcat "N:" (rtos y)"'\P" " E:" (rtos x)"'" )
 
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.
 
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!
 
I knew it was a slash something! Good work!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor