;; Modified by CAB , apologies to Lee for the hack.
;; Make or Modify a layer
(defun MakeModifyLayer ( name colour linetype lineweight willplot bitflag description / ent elst layer)
;; © Lee Mac 2010
;; 06/14/2011 CAB added ability to modify existing layer data
(if (setq ent (tblobjname "LAYER" name))
(progn
(setq elst (entget ent)
elst (subst (cons 6 (if (and linetype (tblsearch "LTYPE" linetype))
linetype "CONTINUOUS")) (assoc 70 elst) elst)
elst (if (assoc 62 elst)
(subst (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7)) (assoc 62 elst) elst)
(append elst (list (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7))))
)
elst (if (assoc 70 elst) (subst (cons 70 bitflag) (assoc 70 elst) elst)
(append elst (list (cons 70 bitflag))))
elst (subst (cons 290 (if willplot 1 0)) (assoc 290 elst) elst)
elst (subst (cons 370
(if (minusp lineweight) -3
(fix
(* 100
(if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0)
)
)
)
)
(assoc 370 elst) elst)
)
(entmod elst)
(if (and description (setq layer (vlax-ename->vla-object ent)))
(if (vlax-property-available-p layer 'Description)
(vla-put-Description layer description)
)
)
)
(entmake
(append
(list
(cons 0 "LAYER")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLayerTableRecord")
(cons 2 name)
(cons 70 bitflag)
(cons 290 (if willplot 1 0))
(cons 6
(if (and linetype (tblsearch "LTYPE" linetype))
linetype "CONTINUOUS"
)
)
(cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7))
(cons 370
(if (minusp lineweight) -3
(fix
(* 100
(if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0)
)
)
)
)
)
(if description
(list
(list -3
(list "AcAecLayerStandard" (cons 1000 "") (cons 1000 description))
)
)
)
)
)
) ; endif
)
(subst (cons 6 (if (and linetype (tblsearch "LTYPE" linetype))
linetype "CONTINUOUS")) (assoc 70 elst) elst)
(subst (cons 6 (if (and linetype (tblsearch "LTYPE" linetype))
linetype "CONTINUOUS")) (assoc 6 elst) elst)
;;changing layer standard to the following:
(defun C:FixAtt ()
(MakeModifyLayer "A-SYMB-ROOM" 3 "continuous" 0.30 T 0 "Room Name Symbol Mark")
(MakeModifyLayer "A-ROOM-NOTE" 2 "continuous" 0.20 T 0 "Room Note")
(MakeModifyLayer "A-SYMB-DOOR" 30 "continuous" 0.15 T 0 "Door Symbol Mark")
(MakeModifyLayer "A-SYMB-WDW" 30 "continuous" 0.15 T 0 "Window Symbol Mark")
(MakeModifyLayer "A-SYMB-WDWT" 250 "continuous" 0.15 T 0 "Window Symbol Hidden Mark")
(command "insert" (strcat "SYMRM" "=" ARCH#CUSF "Builders Plan Service/Syms/Arch_syms/" "SYMRM") ^c^c)
(if (/= (ssget "x" '((2 . "SYMRM"))) nil)
(command "_ATTSYNC" "select" (ssget "x" '((2 . "SYMRM"))) "yes"))
(command "insert" (strcat "SYMDR" "=" ARCH#CUSF "Builders Plan Service/Syms/Arch_syms/" "SYMDR") ^c^c)
(if (/= (ssget "x" '((2 . "SYMDR"))) nil)
(command "_ATTSYNC" "select" (ssget "x" '((2 . "SYMDR"))) "yes"))
(command "insert" (strcat "SYMWDW" "=" ARCH#CUSF "Builders Plan Service/Syms/Arch_syms/" "SYMWDW") ^c^c)
(if (/= (ssget "x" '((2 . "SYMWDW"))) nil)
(command "_ATTSYNC" "select" (ssget "x" '((2 . "SYMWDW"))) "yes"))
(command "insert" (strcat "SYMWDW2" "=" ARCH#CUSF "Builders Plan Service/Syms/Arch_syms/" "SYMWDW2") ^c^c)
(if (/= (ssget "x" '((2 . "SYMWDW2"))) nil)
(command "_ATTSYNC" "select" (ssget "x" '((2 . "SYMWDW2"))) "yes"))
(princ)
)