Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

coordinate indication

Status
Not open for further replies.

mechanicaldup

Mechanical
Jun 30, 2005
155
hi

what functions could be used to indicate a coordinate of a point?
 
Replies continue below

Recommended for you

1) on the command line try ID

2) Here is a LISP macro that places the coordinates of a POINT in the drawing.

(DEFUN C:pTT (/ osm p1 x y z s h 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)
z (caddr p1)
s (strcat "(" (rtos x) "," (rtos y) "," (rtos z) ")" )
h (getvar "textsize")
)
(command "osmode" 0)
(setq p2 (getpoint "\nPick point for middle of text: "))
(COMMAND "TEXT" "Ju" "M" p2 h "0" s)
(command "osmode" osm)
)
 
its a text file, and it looks just like code IFR did. Lisp has been around for many years, there is a bunch of stuff on createing them.

Alex
 
In case you are asking how to use this snippet of code, copy and paste it into Notepad, save it as PTT.lsp somewhere that AutoCAD knows (in it's search path), then when in Autocad, load it using a pull-down or command-line (Load"PTT"). Then type PTT and go. You could also copy and paste it into your Acad.lsp file so it would always be available. If you are using any version of LT, forget it all.

If you are asking how to learn LISP, my advice is to read other people's code and experiment. Autocad Help will list the commands available. There are books out there, lots of them. There are very helpful web sites also - just search for LISP. If you have any experience programming in almost any language, you can pick up LISP in a heartbeat.

Each word in LSIP means something easy. For example (setq variable expression) means evaluate the expression and place the result in variable A. It's like learning French. Master the alphabet (ie LISP commands), get to know the grammar and then learn from the work of others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor