Results 1 to 4 of 4

Thread: Toggle Layer (Part Duex) "A State of Frozen"

  1. #1
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Toggle Layer (Part Duex) "A State of Frozen"

    Back for More:

    Ok. From the first thread I was turning a layer ON/OFF with a keystroke. If ON-turn off; if OFF-turn on.

    Well, the original intent was to totally toggle to layer. ON/OFF, LOCK/UNLOCK, FROZEN/THAW.
    To keep those setting local and put back when toggled on.

    I found that in order to do this I needed the ASSOC 62 and ASSOC 70 values of that layer.
    The 62 I could work with, but never figured out how to work with the 70 value.

    Michael S. gave the following code for a VLISP example:
    Code:
    (defun c:MKSxLayerToggle(/ lName lyr lyrCol)
      (setq lyrCol (vla-get-layers (vla-get-activeDocument (vlax-get-acad-object))))  ;;get the layer collection
      (setq lName  "0")  ;;<-set the layer name here
      (if (vl-catch-all-error-p (setq lyr (vl-catch-all-apply 'vla-item (list lyrCol lName))))  ;;get specific layer object or error code
    (princ)  ;;if error, do nothing
    (if (= (vla-get-layerOn lyr) :vlax-true)  ;;if no error, check if layer is on
      (vla-put-layerOn lyr :vlax-false)  ;;if on, turn it off
      (vla-put-layerOn lyr :vlax-true)  ;;if off, turn it on
    )
      )
      (princ)
    )
    From that I learned a few new things: vla-get-freeze, vla-get-plottable, vla-get-lock.

    So, with those I should be able to totally toggle a layer now, correct? Maybe?
    And what about FROZEN IN NEW and FROZEN IN CURRENT setting? How do I work with those?

  2. #2
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Toggle Layer (Part Duex) "A State of Frozen"

    Quote Originally Posted by todw
    ... but never figured out how to work with the 70 value....
    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 this bit and bit 16 are both 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)

    : ) Happy Computing !

    kennet

  3. #3
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Toggle Layer (Part Duex) "A State of Frozen"

    Thank you... The info I had for group 70 definitions was incorrect. it had plotting as part of the flag.

  4. #4
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Toggle Layer (Part Duex) "A State of Frozen"

    by the way. . .
    Code:
    (setq MyLayer "0" ) ; <-- change here
    (if (setq LayDxf (tblsearch "LAYER" MyLayer ) )
      (progn
    	(princ (strcat "Layer " MyLayer " is " ) )
    	(if (minusp (cdr (assoc 62 LayDxf ))) (princ "OFF" )(princ "ON" ) )
    	(if (= (logand 4 (cdr (assoc 70 LayDxf ))) 4 ) (princ ", Locked" )(princ ", UnLocked" ) )
    	(if (= (logand 1 (cdr (assoc 70 LayDxf ))) 1 ) (princ " and Frozen." )(princ " and Thawed." ) )
      )
      (princ " Layer do not exist " )
    )
    : ) Happy Computing !

    kennet

Similar Threads

  1. 2015: "make part" or "derive"...which is better?
    By No more AUGI for me. in forum Inventor - General
    Replies: 8
    Last Post: 2014-08-01, 08:25 AM
  2. Replies: 0
    Last Post: 2011-03-15, 05:44 PM
  3. Full Time "Properties" toggle palette window
    By amagill in forum Revit Architecture - General
    Replies: 0
    Last Post: 2006-06-16, 01:18 PM
  4. "Revit Redefines State of the Art" in the Latest Issue of HotNews
    By richard.binning in forum Revit Architecture - General
    Replies: 2
    Last Post: 2004-06-04, 10:32 PM
  5. "Constrain" toggle for Move / Copy?
    By m_cahoon14336 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2004-02-24, 02:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •