Can entmod be used with an

Discussion in 'AutoCAD' started by 83RagTop50, Sep 10, 2004.

  1. 83RagTop50

    83RagTop50 Guest

    I want to change the color on a TEXT entity. I'm successful when the color attribute (62) is already in the entity's list, I simply substitue in the desired value and use entmod to update. But when the color attribute is absent when color is "bylayer", can I append a dotted pair like (62 . 6) to the entity list and then use entmod to update. Or must I delete the old entity and use entmake to get the color attribute added to a new record?

    Thanks,
    Bob
     
    83RagTop50, Sep 10, 2004
    #1
  2. 83RagTop50

    Jim Claypool Guest

    Yes you can

    (if (assoc 62 ent)
    (setq ent (subst (cons 62 6) (assoc 62 ent) ent))
    (setq ent (append ent (list (cons 62 6))))
    )
    (entmod ent)
     
    Jim Claypool, Sep 10, 2004
    #2
  3. 83RagTop50

    83RagTop50 Guest

    Thanks,

    I went back and reworked my code and all is OK. I guess I had an error masking my attempt to use entmod.

    Bob
     
    83RagTop50, Sep 10, 2004
    #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.