Layer table question

Discussion in 'AutoCAD' started by Kurt Westerlund, Feb 3, 2005.

  1. i use the following conditional experesion to control groups of layers
    on/off status.

    (if(<(cdr(assoc 62(tblsearch "layer" "1a")))0)

    since negative values for 62 indicate that the layer is off it works
    fine. Exept instead of testing on/off, I'd like to test freeze/thaw status.

    I think I need to use 70 but I don't know how to test.

    Any ideas?
     
    Kurt Westerlund, Feb 3, 2005
    #1
  2. If it's frozen dxf 70 = 1.

    (if (=(cdr(assoc 70 (tblsearch "layer" "1a")))1)
    (princ "Frozen")
    (princ "Thawed")
    )

    Ken Alexander
     
    Ken Alexander, Feb 3, 2005
    #2
  3. Hi Ken,

    You gettin' rusty with this stuff, since you haven't
    been around much these days? ;)

    I'd suggest using logand.
     
    Jason Piercey, Feb 3, 2005
    #3
  4. Anyone know I can find a list of table values? I've tried the vlisp
    help and my two books but can't find one.
     
    Kurt Westerlund, Feb 3, 2005
    #4
  5. Help -> Developer Help -> DXF Reference ->
    Tables -> Layer
     
    Jason Piercey, Feb 3, 2005
    #5
  6. Kurt Westerlund

    Don Butler Guest

    Kurt:



    LAYER group codes

    Group code

    Description

    100

    Subclass marker (AcDbLayerTableRecord)

    2

    Layer name

    70

    Standard flags (bit-coded values):
    1 = Layer is frozen; otherwise layer is thawed
    2 = Layer is frozen by default in new viewports
    4 = Layer is locked
    16 = If set, table entry is externally dependent on an xref
    32 = If both this bit and bit 16 are set, the externally dependent xref has
    been successfully resolved
    64 = If set, the table entry was referenced by at least one entity in the
    drawing the last time the drawing was edited. (This flag is for the benefit
    of AutoCAD commands. It can be ignored by most programs that read DXF files
    and need not be set by programs that write DXF files)

    62

    Color number (if negative, layer is off)

    6

    Linetype name

    290

    Plotting flag. If set to 0, do not plot this layer

    370

    Lineweight enum value

    390

    Hard-pointer ID/handle of PlotStyleName object



    In otherwords...

    (defun LayerFrozen (lyr)
    (= 1
    (logand 1
    (cdr (assoc 70 (entget (tblobjname "layer" lyr))))
    )
    )
    )

    Don
     
    Don Butler, Feb 3, 2005
    #6
  7. Kurt Westerlund

    Don Butler Guest

    Just to show you there is another way as well...

    (defun LayerFrozen (lyr)
    (= :vlax-true
    (vla-get-freeze
    (vla-item (vla-get-layers
    (vla-get-activedocument (vlax-get-acad-object))
    )
    lyr
    )
    )
    )
    )

    Don
     
    Don Butler, Feb 3, 2005
    #7
  8. Kurt Westerlund

    Tom Smith Guest

    (= (logand (cdr(assoc 70 (tblsearch "layer" "0"))) 1) 1)

    Or conversely

    (defun thawed (layer)
    (zerop (logand (cdr (assoc 70 (tblsearch "layer" layer))) 1)))
     
    Tom Smith, Feb 4, 2005
    #8
  9. True enough.

    Good to see everyone still keeps you in check. I need another can of WD40.
    <g>
     
    Ken Alexander, Feb 4, 2005
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.