Entmod

Discussion in 'AutoCAD' started by Alan Henderson @ A'cad Solutions, Oct 12, 2004.

  1. vlide
    help

    here is a short lisp routine to show you how to change the text value of an
    attribute
    this assumes a block named "BlockName" with at least 1 attribute, that is
    inserted at least once in the drawing

    (setq SS (ssget "X" (list (cons 0 "INSERT") (cons 2 "BlockName")))) ; find
    all BlockName blocks in drawing
    (setq EG (entget (ssname SS 0))) ; get 1st block in selection set
    (setq A1 (entget (entnext (cdr (assoc -1 EG))))) ; get 1st attribute in
    block
    (setq AT (cdr (assoc 1 A1))) ; get text value of attribute
    (setq NA1 (subst (cons 1 "NewText") (assoc 1 A1) A1)) ; store new text value
    for attribute
    (entmod NA1) ; update attribute value
    (entupd (cdr (assoc -1 EG))) ; redisplay the block with the new attribute
    value
     
    Alan Henderson @ A'cad Solutions, Oct 12, 2004
    #1
  2. Alan Henderson @ A'cad Solutions

    The Cad Man Guest

    Anyone know what I can fine some info on entmod. I need to learn to use it.
    Mainly to update attributes in blocks.

    Thanks.
     
    The Cad Man, Oct 12, 2004
    #2
  3. Alan Henderson @ A'cad Solutions

    The Cad Man Guest

    Thanks you...this helps me a lot!
     
    The Cad Man, Oct 12, 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.