Frozen Layer

Discussion in 'AutoCAD' started by GaryDF, Jan 15, 2005.

  1. GaryDF

    GaryDF Guest

    Step one:
    (setq OldLayer (getvar "CLAYER"))

    Step two:
    Set another layer as current, and freeze the previous layer

    Step three:
    How would I thru lisp check if OldLayer has been frozen?

    (defun Thaw-OLDLAYER ()
    (setq OldLayer (getvar "CLAYER"))
    (if (..........
    (command ".-layer" "thaw" OldLayer "")
    )
    )

    Gary
     
    GaryDF, Jan 15, 2005
    #1
  2. GaryDF

    GaryDF Guest

    This is getting closer, but still having trouble.


    (defun Thaw-OLDLAYER ()
    (setq lay (entget (tblobjname "layer" OldLayer)))
    (setq clr (cdr (assoc 62 lay)))
    (if (= clr -1)(command ".-layer" "thaw" OldLayer ""))
    )

    Gary
     
    GaryDF, Jan 15, 2005
    #2
  3. GaryDF

    Jeff Mishler Guest

    Is this what you're after?
    Code:
    (setq oldLayer (getvar "clayer"))
    (setvar "clayer" "Layer1")
    (setq lay (entget (tblobjname "layer" oldLayer)))
    (entmod (subst '(70 . 1) (assoc 70 lay) lay))
    (if (= 1 (cdr (assoc 70 lay)))
    ;it's frozen
    ;it's not frozen
    )
    
     
    Jeff Mishler, Jan 15, 2005
    #3
  4. GaryDF

    GaryDF Guest

    OldLayer has already been set by a previous routine.
    I want to thaw that layer if it has been frozen

    The following is still not working, and I am brain dead right now.

    (defun Thaw-OLDLAYER ()
    (setq lay (entget (tblobjname "layer" oldLayer)))
    (if (< (cdr (assoc 62 lay)) 0)
    (command ".-layer" "thaw" OldLayer "")
    )
    )

    Gary


     
    GaryDF, Jan 15, 2005
    #4
  5. GaryDF

    Jeff Mishler Guest

    Gary, note the use of assoc 70
    assoc 62 is for color, a negative color turns OFF the layer.....

    --
    Jeff
    check out www.cadvault.com
     
    Jeff Mishler, Jan 15, 2005
    #5
  6. GaryDF

    GaryDF Guest

    I got this to work...was mixing apples and oranges.

    (setq OldLayern "A-DETL-03")



    (defun Thaw-OLDLAYER ()
    (setq lay (entget (tblobjname "layer" OldLayern)))
    (if (< (cdr (assoc 62 lay)) 0)
    (command ".-layer" "on" OldLayern "")
    )
    (if (= (cdr (assoc 70 lay)) 1)
    (command ".-layer" "thaw" OldLayern "")
    )
    )

    Thanks


    Gary

     
    GaryDF, Jan 15, 2005
    #6
  7. GaryDF

    Jeff Mishler Guest

    FYI, this:
    (< (cdr (assoc 62 lay)) 0)
    can also be written as:
    (minusp (cdr (assoc 62 lay)))

    --
    Jeff
    check out www.cadvault.com
     
    Jeff Mishler, Jan 15, 2005
    #7
  8. GaryDF

    GaryDF Guest

    Thanks again

    Gary


     
    GaryDF, Jan 15, 2005
    #8
  9. GaryDF

    TCEBob Guest

    Actually, you don't need to know if a layer is frozen. Thaw it anyway; no harm
    shall come to thee.

    rs
     
    TCEBob, Jan 17, 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.