Lisp to define points for cnc path
Lisp to define points for cnc path
(OP)
How do I change the following Lisp program so that the first number is the x-value and the second is y-value but shows as 2X the value(is diameter instead of radius)?
(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)
)
Thank You
(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)
)
Thank You





RE: Lisp to define points for cnc path
Then this:
CODE
(graphscr)
(setq osm (getvar "osmode"))
(command "osmode" 53)
(setq p1 (getpoint "\nSNAP to point to be ID'd: ")
x (car p1)
y (cadr p1)
2y (* 2 y);;added this line
s (strcat "(" (rtos x) "," (rtos 2y) ")")
)
(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 to define points for cnc path
We want to define the contour of a formed Roll from a "zero" point. This "zero" point is on the centerline axis and on one face of the Roll. We need all tangent points of the contour so that we can write a CNC program from these points. Each point is a distance from the "zero face" and on a radius(but the program needs the Diameter-therefore 2 times y value).
I hope this clears up the question.
TIA
11991
RE: Lisp to define points for cnc path
RE: Lisp to define points for cnc path
I do not understand why 2y would define the
diameter from the zero axis. If your input
is the diameter instead of the radius, then
you want to define y as the diameter divided
by 2 or diameter times 0.50 for the y value.
RE: Lisp to define points for cnc path
http:
RE: Lisp to define points for cnc path
And a question for you- did you try the lisp routine I posted? It did incorporate the "y=2*y" you keep mentioning. :)
RE: Lisp to define points for cnc path
I also tried altering the PPP Lisp from above with your changes with no luck. I only get the (x,y) values.
RE: Lisp to define points for cnc path
RE: Lisp to define points for cnc path
s (strcat "(" (rtos x) "," (rtos 2y) ")")
RE: Lisp to define points for cnc path
11991