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?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
Lisp for Coordinate Dimensioning
|
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
-------
htt
"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
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
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
Also, I do not need but x,y since this is 2D work.
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
To get the z-coordinate removed, just take away the "," (rtos z) . Does this work for anybody else?
RE: Lisp for Coordinate Dimensioning
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
RE: Lisp for Coordinate Dimensioning
RE: Lisp for Coordinate Dimensioning
(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)
)