Layers not visible after creating them with (entmake ...)
Hi All
When I make a set layers with code similar to the following:
(entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 "just-a-test") (cons 70 5) (cons 62 -1) (cons 6 "continuous") (cons 290 0) ) )
And it is called directly or chain loaded from on_doc_load.lsp, the layer set is not visible in the layer pull down menu. However, after a layer related command like layer
or (setvar 'clayer "just-a-test")
, they suddenly become visible.
When I paste this (same code) on the command line - so not on document opening time -, things work fine:
(entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 "just-a-test") (cons 70 5) (cons 62 -1) (cons 6 "continuous") (cons 290 0)))
A workaround is to force the internal layer handling by issuing a (setvar 'clayer "just-a-test")
when document loading.
When using a (command "-layer" ...)
syntax, there is no problem, but competition prohibits (command ...)
statements on document loading time, outside s::startup
.
I have not tried an object approach (vlax-put-property ...)
because I expected this to work. Tested on V17 Windows. Suggestions welcome.
Comments
-
@Wiebe van der Worp:
This problem does not occur in V14 and V15, so maybe this bug is the result of some form of regression. The best thing you can do is send in a Support Request. The (setvar "clayer" "just-a-test") workaround does not work in V16 as the newly created layer is frozen. I do not have a V17 license.0 -
Hi Roy, thanks for responding. Despite the error
(setvar "clayer" "just-a-test")
creates, it is enough to initialize visibility of layers in the pull down. I'll do the request as you suggested.Addition: competition doesn't like
(setvar 'clayer "just-a-test")
on document start, so the workaround becomes:(if (getvar "vendorname") (progn (setvar 'clayer "just-a-test") (setvar 'clayer "0") ) ) ;; Q&D
0 -
By the way, this workaround is not needed any more in newer BricsCAD versions.
Thanks Bricsys!
0