×
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

coordinate indication

coordinate indication

coordinate indication

(OP)
hi

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

RE: coordinate indication

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)
)

RE: coordinate indication

(OP)
Thks IFR's
how do you program a LISP command?

RE: coordinate indication

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

RE: coordinate indication

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.

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