color, etc bylayer

Discussion in 'AutoCAD' started by TCEBob, Aug 6, 2003.

  1. TCEBob

    TCEBob Guest

    Is there a routine that will identify an object's color, linetype,
    lineweight even tho they are "bylayer"? It's a pain to have to go to the
    layer dialog. Also a pain when trying to replicate a color
    programmatically. I've started one, but hate to rebuild a pyramid if
    it's already out there.

    rs
     
    TCEBob, Aug 6, 2003
    #1
  2. TCEBob

    James Buzbee Guest

    (setq color
    (cdr(assoc 62
    (entget(tblobjname "layer"
    (cdr(assoc 8(entget(car(entsel))))))))))

    or

    (setq color(vla-get-color
    (vla-item
    (vla-get-layers(vla-get-activedocument(vlax-get-acad-object)))
    (vla-get-layer(vlax-ename->vla-object(car(entsel)))))))

    jb
     
    James Buzbee, Aug 6, 2003
    #2
  3. TCEBob

    TCEBob Guest

    Thank you, sir.

    rs
     
    TCEBob, Aug 6, 2003
    #3
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.