TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on November 25, 2015, 06:17:13 AM
-
After a long pause I have to fight against DBX again :whistling:
I want to check all layers, which are used by objects in an objectlist, if they are "off" or "frozen". In Lisp I check if
- DXF-GC 70 contains "1" (frozen)
- DXF GC 62 is negative (off)
(foreach bild ObjLst
(setq bildlayer (cdr (assoc 8 (entget bild))))
; DXF-Code: 70 enthält 1 -> gefroren; 62 (Farbe) ist negativ -> ausgeschaltet
(setq bildlayer_dxf (tblsearch "layer" bildlayer))
(if (or
(= (logand 1 (cdr (assoc 70 bildlayer_dxf))) 1); wenn der GC 70 den Bitcode 1 = gefroren
(< (cdr (assoc 62 bildlayer_dxf)) 0) ; negativ -> ausgeschaltet
)
(setq layerflag 1)
)
)
Please help me to make it with DBX.
Thanks and regards
-
Peter;
I have to fight against DBX again
You may need to explain this so it's understandable in the context of the code you posted.
-
(tblsearch) searches tables in the current document and can therefore not be use in an (O)DBX context.
-
Thanks Roy ... I'm blind as well as silly.
-
(setq item (vla-item (vla-get-layers doc) "LayerName"))
(equal (vla-get-freeze item) :vlax-true) ; returns t if layer is frozen
(equal (vla-get-layeron item) :vlax-true) ; returns t if layer is on
-
You may need to explain this so it's understandable in the context of the code you posted.
Sorry, Kerry. When I'm under pressure and I have the feeling that a "common dbx two-liner" will do the job but I don't have any clue - then my postings are not as precise as they should be :embarrassed:
(setq item (vla-item (vla-get-layers doc) "LayerName"))
(equal (vla-get-freeze item) :vlax-true) ; returns t if layer is frozen
(equal (vla-get-layeron item) :vlax-true) ; returns t if layer is on
Thanks - exactly the two-liner I hoped for. :yay!: