resetting to bylayer or color

Discussion in 'AutoCAD' started by Kiwi Russ, Mar 4, 2004.

  1. Kiwi Russ

    Kiwi Russ Guest

    How can I reset to the previous used current color? I find that this is no
    problem if the layer is color bylayer, but if the layer is set to a color
    (rather than bylayer) then the color is not reset.
    I know if a layer is set to a color then then is bad practice- but there are
    certain objects in our dwgs that have the same layer but different colors.
    thanks Russ

    (defun C:MX1( / )
    (setq OldCmd (getvar "CMDDIA")
    OldLay (getvar "CLAYER"))

    etc
    etc
    etc

    (setvar "CLAYER" OldLay)
    (setvar "CMDECHO" OldCmd)
    (princ)
    )
     
    Kiwi Russ, Mar 4, 2004
    #1
  2. Kiwi Russ

    Joe Burke Guest

    Hi Russ,

    Check the CECOLOR variable.

    Command: (setq cclr (getvar "cecolor"))
    "BYLAYER"
    Command: (setvar "cecolor" "2")
    "2"
    Command: (setvar "cecolor" cclr)
    "BYLAYER"

    Joe Burke
     
    Joe Burke, Mar 4, 2004
    #2
  3. Kiwi Russ

    OLD-CADaver Guest

    there are certain objects in our dwgs that have the same layer but different colors. <<

    Oh? Why?
     
    OLD-CADaver, Mar 4, 2004
    #3
  4. Kiwi Russ

    Joe Burke Guest

    The flip side of that question is do you think the software should not allow a color
    or linetype assigned to an object?

    Joe Burke
     
    Joe Burke, Mar 4, 2004
    #4
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.