;Modified by Bill DeShawn from MTCH.LSP written by Jim Needham ;Setting ddrmodes by picking an entity. ;***JGN-07/25/90-CROW--JIM NEEDHAM--PCC INSTRUCTOR ;**modified by Bill DeShawn for Rel 13 (defun c:ddebyl () (command ".linetype" "s" "bylayer" "" "color" "bylayer") (princ) ) (defun c:ddeset (/ sset num ent elist layr ltyp lts colr); index) (menucmd "s=more3") (setvar "cmdecho" 0) (graphscr) (setq Ent (entsel "\nSelect entity whose properties you want to MATCH: ")) (if (null ent)(progn (alert "No object found") (exit))) (setq elist (entget (car ent))); (setq Layr (cdr(assoc 8 elist))) (setq Ltyp (cdr(assoc 6 elist))) (setq Lts (cdr(assoc 48 elist))) (setq Colr (cdr(assoc 62 elist))) ; index 0 (if (= (cdr (assoc 0 elist)) "LWPOLYLINE") (setvar "PLINEWID" (cdr (assoc 43 elist))) ) ;If Match Entity Ltype, Color, Layer, Ltscale have values... (cond ( (and (boundp 'ltyp) (boundp 'colr) (boundp 'layr) (boundp 'lts) ) (progn (command ".layer" "s" layr "" "linetype" "s" ltyp "" ".color" colr) (prompt (strcat "\nLinetype scale of this entity is " (rtos lts) ". It's ltscale property is not presetable.")) ) ) ;If Match Entity has Layer, Ltype & Ltscale but NOT Color... ( (and (boundp 'ltyp) (boundp 'layr) (boundp 'lts) (not (boundp 'colr) ) ) (progn (command ".layer" "s" layr "" ".linetype" "s" ltyp "" ".color" "bylayer") (prompt (strcat "\nLinetype scale of this entity is " (rtos lts) ". It's ltscale property is not presetable.")) ) ) ;If Match Entity has Layer, Ltype & Color but NOT Ltscale... ( (and (boundp 'ltyp) (boundp 'layr) (boundp 'colr) (not (boundp 'lts) ) ) (command ".linetype" "s" ltyp "" ".layer" "s" layr "" ".color" colr) ) ;If Match Entity has Layer & Color, but NOT Ltype or LTScale... ( (and (boundp 'colr) (boundp 'layr) (not (boundp 'lts) ) (not (boundp 'ltyp) ) ) (command ".color" colr ".layer" "s" layr "" ".linetype" "s" "bylayer" "") ) ;If Match Entity has Layer ONLY... ( (and (boundp 'layr) (not (boundp 'lts) ) (not (boundp 'ltyp) ) (not (boundp 'colr) ) ) (command ".layer" "s" layr "" ".linetype" "s" "bylayer" "" ".color" "bylayer") ) ;If Match Entity has Layer & LType, but not Color or LTScale... ( (and (boundp 'layr) (not (boundp 'lts) ) (boundp 'ltyp) (not (boundp 'colr) ) ) (command ".layer" "s" layr "" ".linetype" "s" ltyp "" ".color" bylayer) ) ;If Match Entity has Layer, LTScale, No color, No Ltype... ( (and (boundp 'layr) (boundp 'lts) (not (boundp 'ltyp) ) (not (boundp 'colr) ) ) (progn (command ".layer" "s" layr "" ".linetype" "s" "bylayer" "" ".color" "bylayer") (prompt (strcat "\nLinetype scale of this entity is " (rtos lts) ". It's ltscale property is not presetable.")) ) ) ) (princ) )