TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Robb on February 28, 2005, 08:42:31 PM
-
Anoyone got a lisp that will offset a line multiple distances?
I horizontal lines that need to be offset from the original line 6", 8'3/4", 12" then 8'3/4".
Does anyone have something that will do this?
Thanks!
-
Here's one that might get you started in the right direction:
(defun c:offm ()
(setq userecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq ent_select (entsel "\nSelect object to offset: ")
ent_pickpt (cadr ent_select)
ent_orig (car ent_select)
);setq
(redraw ent_orig 3)
(setq off_pt (getpoint "\nPick side to offset: ")
off_angle (angle ent_pickpt off_pt)
);setq
(setq last_entity ent_orig last_pt ent_pickpt)
(while (setq off_dist (getreal "\nOffset distance: "))
(setq newoff_pt (polar last_pt off_angle 10))
(command "._offset" off_dist last_entity newoff_pt "")
(setq last_entity (entlast)
last_pt (cdr (assoc 10 (entget last_entity)))
);setq
(redraw last_entity 3)
);while
(redraw last_entity 4)
(setvar "cmdecho" userecho)
(princ)
);defun
(princ "\nStart with OFFM ")
(princ)
I'd love to give credit to the author but, I don't think I ever knew who this one was written by. I'm sure some of our local hackers can change the last part to hard code in your dimensions for you.
-
Acutually I messed around with come code I got from someone here a while back... it was a shelf routine? wll I got it to work. I will try this one though. Thank you very much!