Offset LISP

~Jeff~

Usenet Archive
Joined
Jan 8, 2004
Messages
27
Reaction score
0
I would like this lisp (at end of this post) to offset a line to current layer (just what it does) but also offset the lines to BYLAYER for linetype and color

Example I have a line that is named P-PIPE. The line color has been forced to yellow and forced to center2. Using this lisp, I would like to offset a line to my current layer, but the linetype and color of the offset line will change to BYLAYER if required.

....any help please?

Thanks in advance,

~Jeff~
[AutoCAD 2004]

;LOffset -- Improved offset command (offsets to current layer)

(defun C:LOffset
(setq Ent1 (entlast))
(command ".OFFSET")
(while (< 0 (getvar "CMDACTIVE"))
(command pause)
(if (not (equal ent1 (entlast))) (progn
(setq ent1 (entlast))
(setq list1 (entget ent1))
(setq list1 (subst
(cons 8 (getvar "CLAYER")) (assoc 8 list1) list1))
(entmod list1)
)))
(princ)
)

(if C:LOffset
(command "UNDEFINE" "OFFSET"))
(princ)
 
(defun C:LOffset
(setq Ent1 (entlast))
(command ".OFFSET")
(while (< 0 (getvar "CMDACTIVE"))
(command pause)
(if (not (equal ent1 (entlast))) (progn
(setq ent1 (entlast))
(setq list1 (entget ent1))
(setq list1 (subst(cons 8 (getvar "CLAYER")) (assoc 8 list1) list1) list1 (subst '(6 . "BYLAYER")(assoc 6 list1) list1) list1 (append list1 '((62 . 256))) );;setq (entmod list1) ))) (princ) )
___
 

Latest threads

Back
Top