Originally Posted by
marc.verdaasdonk697335
I need to be able to use this code with variables. I need to create layers from the tool pallet so that's why I want to code to use something like:
(CreateLayer "layername" 0 50 "continuous" 1 50 "description")
So here it goes ....
Code:
(defun CreateLayer (Name FrzLock Color LType Plot LWeight Desc)
(setq l (entmakex (list (cons 0 "LAYER")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLayerTableRecord")
(cons 2 Name)
(cons 70 FrzLock)
(cons 62 Color)
(cons 6 LType)
(cons 290 Plot)
(cons 370 LWeight)
)
)
)
(if l
(progn (vla-put-Description (vlax-ename->vla-object l) Desc) (setvar "CLAYER" Name))
)
)
(vl-load-com)
Code:
(CreateLayer "54_00-P" 0 50 "continuous" 1 50 "Gas general (primary)")
EDIT : Name of Layer were written instead of the variable name