×
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 for Coordinate Dimensioning

Lisp for Coordinate Dimensioning

Lisp for Coordinate Dimensioning

(OP)
Does anyone know where I could get a LISP program that would give me point dimensions like (x,y) with leader to the point?

RE: Lisp for Coordinate Dimensioning

You have sparked my curiousity. What do you need this lisp for?

RE: Lisp for Coordinate Dimensioning

(OP)
It is very useful when dimensioning a CNC path which is to be programmed into a machine. When you ordinate dimension you have longer leaders and separated dimensions.

RE: Lisp for Coordinate Dimensioning

I see. Would ordinate dimensions work for that application? Or are you looking for something a little more efficient?

RE: Lisp for Coordinate Dimensioning

(OP)
With ordinate dimensions it is still necessary to track two(2) leaders for each point. I had a lisp at one time that did this but I did not remember to save before a computer meltdown!

RE: Lisp for Coordinate Dimensioning

A friend suggests the following:
-------
http://www.ferris.edu/htmls/academics/course.offerings/hillm/CDTD130/Dimensioning%20Rules.htm

"for that work i would suggest that he simply export it do DXF and then pull it into a GERBER languaage converter of some sort...
and let the CNC machine read it direct
QuickTrans-CAD Translator
Easily convert formats DXF, Gerber, GDSII, OASIS and more. Free Tryout!
http://www.gdstools.com
-------

RE: Lisp for Coordinate Dimensioning

Please clarify - do you want a LISP that will allow you to select a point and then draw a leader from that point to another point you select and include the X,Y,Z coordinates of the first point as the leader text?  If so, that's easy.  Let me know....

RE: Lisp for Coordinate Dimensioning

(OP)
All I want to be able to do is go around the contour ot a tool and pick points that are ends of lines and/or arcs and/or centers of arcs and get the x,y values and be able to place them in a convenient position for clear reading. It would be nice to also have a leader from picked point to place dimension is placed.

RE: Lisp for Coordinate Dimensioning

Here is a "quickie"
Save it as a file with a lsp extension
In AutoCAD, on the command line go (load"file.lsp") where "file.lsp" is your filename.  Then run the command by typing PPT.  Pick the point to ID and then the place for the other end of the leader.

(DEFUN C:PTT (/ osm p1 x y z 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)
        z (caddr p1)
        s (strcat "(" (rtos x) "," (rtos y) "," (rtos z) "))
  )
 (command "osmode" 0)
 (setq p2 (getpoint "\nPick point for end of Leader: "))
 (COMMAND "DIM1" "LE" p1 p2 "" s)
 (command "osmode" osm)
 (princ)
)

RE: Lisp for Coordinate Dimensioning

(OP)
I am unable to get this lisp to work. I had no trouble getting it loaded into AutoCad(2000) but it does not react when, I named it PPC, is typed in the Command Bar.
Also, I do not need but x,y since this is 2D work.

RE: Lisp for Coordinate Dimensioning

type in PTT

RE: Lisp for Coordinate Dimensioning

(OP)
No luck. Tried PTT, PPT & PPC.

RE: Lisp for Coordinate Dimensioning

The fragment DEFUN C:PTT( names the command as "PTT".
To get the z-coordinate removed, just take away the  "," (rtos z) .  Does this work for anybody else?

RE: Lisp for Coordinate Dimensioning

It doesn't work because of an error on 1 line (missing a quote):

change:
 s (strcat "(" (rtos x) "," (rtos y) "," (rtos z) "))

to

 s (strcat "(" (rtos x) "," (rtos y) "," (rtos z) ")")

Another minor change allows a "drag line" for picking text location. Here's the entire code for ease of copy & pasting:
------------------------------------------
(DEFUN C:PTT (/ osm p1 x y z 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)
        z (caddr p1)
        s (strcat "(" (rtos x) "," (rtos y) "," (rtos z) ")")
  )
 (command "osmode" 0)
 (setq p2 (getpoint p1 "\nPick point for end of Leader: "))
 (COMMAND "DIM1" "LE" p1 p2 "" s)
 (command "osmode" osm)
 (princ)
)

RE: Lisp for Coordinate Dimensioning

Nicely done.  Thanks.

RE: Lisp for Coordinate Dimensioning

(OP)
This does exactly. Thanks to all for the help.

RE: Lisp for Coordinate Dimensioning

FOr only X and Y:

(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 "(" (rtos x) "," (rtos y) ")")
  )
 (command "osmode" 0)
 (setq p2 (getpoint p1 "\nPick point for end of Leader: "))
 (COMMAND "DIM1" "LE" p1 p2 "" s)
 (command "osmode" osm)
 (princ)
)

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