I'm trying to change a routine i just wrote that draws 3d pipes.
I wanted to make it so that when a user selects the beginning point and ending point of the pipe,
the LISP changes the ucs to that vector, draws the circle at the beginning point
and extrudes it to the second point.
It actually works great except when the ucs changes, so do my user points because of teh origin change.
Is ther a better way I might get this to do what I wnat it to?
(setq ip (getpoint "\nPick First Point:")) (setq ep (getpoint "\nPick Second Point:")) (command ".ucs" "za" ip ep) (setvar "osmode" 0) (command ".circle" ip "d" od) (command ".extrude" (entlast) "" (distance ip ep)) (command ".ucs" "w") (setvar "osmode" oldsnap))
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@Anonymous wrote:....when a user selects the beginning point and ending point of the pipe, the LISP changes the ucs to that vector, draws the circle at the beginning point and extrudes it to the second point.
It actually works great except when the ucs changes, so do my user points because of teh origin change.
....
(setq ip (getpoint "\nPick First Point:")) (setq ep (getpoint "\nPick Second Point:")) (command ".ucs" "za" ip ep) (setvar "osmode" 0) (command ".circle" ip "d" od) (command ".extrude" (entlast) "" (distance ip ep)) (command ".ucs" "w") (setvar "osmode" oldsnap))
No time to test it, but I think you can either do:
(command ".circle" "0,0,0" "d" od)
since you've made that location the origin point of the current UCS, or
(command ".circle" (trans ip 0 1) "d" od)
to (trans)-late that point from the WCS coordinates that it will be saved in to the current UCS.
Wow! I was way over thinking that one.
I just used 0,0,0 to insert the circle and it works perfectly.
Thanks for all your help, Kent. I just started learning LISP this week and I'm alot farther along than I expected to be thanks to all the people here that are willing to share their knowledge.
-Anthony