I am having issues with the code below, in that if the kayer 'Insulation' does not exist the layer is created
and everyting works fine.
However
If the layer exists everything executes as expected, but at the end the (CD_SHAPE) is exucuting a second time??
.
Code: Select all
; Create Insulation Layer + layer attributes
(defun MKLAY_INS ()
(princ "\n start MKLAY_INS ")
;
(if (tblsearch "layer" "Insulation")(CD_SHAPE)
(progn
(regapp "accmtransparency")
(entmakex
(list
(cons 0 "LAYER") ;defines create new layer
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLayerTableRecord")
(cons 2 "Insulation") ; Layer name
; (cons 6 "Continuous") ; linetype
; (cons 370 LWeight) ; lineWeight
(cons 62 2) ; Layer color
; (cons 70 0) ; on, unlocked, thawed
; (cons 290 1) ; Plot/No Plot : 0->No plot
; (cons 440 "65") ; Layer Transparency
(cons -3 ; transparency
(list(list "accmtransparency" ; transparency
(cons 1071 (LM:trans->dxf 65)) ) ) ); transparency
);end list
);end entmake
);end progn
); end If
(CD_SHAPE)
) ;end MKLAY_INS
.
I then tried to add this code, commenting out the 'IF' statement above. This works fine except, it has an issue where the color for layer 'Insulation' is changed back to white (7)
.
Code: Select all
;Check if layer 'insulation' exists
(defun CK_LAY ()
(if (tblsearch "layer" "Insulation")
(CD_SHAPE)
(MKLAY_INS)
):END IF
);END CK_LAY
.
full lsp file attached.
CMS INTELLICAD 12.1.243.153262.PE+.VC16.x64.CMS121
i9-12900k / 64gb-3200 - NVIDIA GeForce TRX 3060 Ti 8Gb Windows 11 Pro
www.stylemarkdesigns.co.uk