Change text style in blocks.

Discussion in 'AutoCAD' started by BillZ, Jul 10, 2003.

  1. BillZ

    BillZ Guest

    R14 Autolisp:

    I have many blocks in a drawing that have a visible attribute that has a text style of "style1" that is roamans, I want to change it to romand text type.
    Any ideas?

    Bill
     
    BillZ, Jul 10, 2003
    #1
  2. BillZ

    Mike Weaver Guest

    The battman command will allow you to change the style for an attribute and then syncronize this change across all insertions of the same block.



     



    HTH,



    Mike Weaver



     



    "BillZ" <> wrote in message news:...

    R14 Autolisp:

    I have many blocks in a drawing that have a visible attribute that has a text style of "style1" that is roamans, I want to change it to romand text type.
    Any ideas?

    Bill
     
    Mike Weaver, Jul 10, 2003
    #2
  3. BillZ

    BillZ Guest

    Where do I find this battman for r14?
     
    BillZ, Jul 10, 2003
    #3
  4. I know this could be refined, and made more flexible but
    real quick....

    ; Jason Piercey . June 2nd, 2003
    ; [ename] - entity name - block, insert or polyline
    ; [filter] - string, re: wcmatch()
    ; return: list of enames or nil
    (defun nEnts (ename filter / data ent rtn)
    (setq filter (strcase filter))
    (while (and ename (setq ename (entnext ename)))
    (setq data (entget ename))
    (setq ent (cdr (assoc 0 data)))
    (if (wcmatch ent filter)
    (setq rtn (cons ename rtn)) )
    (if (= "SEQEND" ent) (setq ename nil))
    )
    (reverse rtn)
    )

    ; [blockName] - string, attributed block name
    ; [oldStyle] - string, textstyle to seach for
    ; [newStyle] - stirng, textstyle for replacement
    (defun updateAttStyle (blockname oldStyle newStyle / data pair ename ss i)
    (setq oldStyle (strcase oldStyle)
    newStyle (strcase newStyle) )
    (foreach x (nEnts (tblobjname "block" blockname) "ATTDEF")
    (setq data (entget x)
    pair (assoc 7 data) )
    (if (= oldStyle (strcase (cdr pair)))
    (entmod (subst (cons 7 newStyle) pair data))
    )
    )

    (if
    (setq
    ss
    (ssget
    "x"
    (list
    '(0 . "INSERT")
    (cons 2 blockName)
    '(66 . 1)
    (cons 410 (getvar "ctab"))
    )
    )
    )
    (progn
    (setq i -1)
    (repeat (sslength ss)
    (setq ename (ssname ss (setq i (1+ i))))
    (foreach x (nEnts ename "ATTRIB")
    (setq data (entget x)
    pair (assoc 7 data) )

    (if (= oldStyle (strcase (cdr pair)))
    (entmod (subst (cons 7 newStyle) pair data))
    )
    )
    )
    )
    )
    )

    --

    -Jason
    Member of the Autodesk Discussion Forum Moderator Program


    "style1" that is roamans, I want to change it to romand text type.
     
    Jason Piercey, Jul 10, 2003
    #4
  5. BillZ

    BillZ Guest

    Great!
    Thanks :)



    Bill
     
    BillZ, Jul 10, 2003
    #5
  6. BillZ

    Mike Weaver Guest

    Upgrade.  Sorry.



    "BillZ" <> wrote in message news:...

    Where do I find this battman for r14?
     
    Mike Weaver, Jul 10, 2003
    #6
  7. BillZ

    OLD-CADaver Guest

    Is there something wrong with changing the font of style 1 to romand?
     
    OLD-CADaver, Jul 10, 2003
    #7
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.