Lisp text style change ??

Discussion in 'AutoCAD' started by George Drayton, Sep 15, 2004.

  1. My routine below attempts to change the text style of an existing attribute
    to a new text style "Attribute". The program "looks" OK via the 2005 VLIDE,
    but doesn't actually change the entities in the drawing. Can anyone see
    what is wrong? Thanks

    ;;;converts attribute text to use new text style "attribute" with arial font

    (defun c:at2a ()

    (command "-style" "Attribute" "arial.ttf" "" "" "" "" "")
    (setq attributes (ssget "x" '((0 . "ATTDEF"))))
    (setq attributel (sslength attributes))
    (setq count 0)
    (repeat attributel
    (setq temp (cdr (entget (ssname attributes count))))
    (setq temp1 (subst (cons 7 "ATTRIBUTE") (assoc 7 temp) temp))
    (entmod temp1)
    (setq count (1+ count))
    ) ;_ end of repeat

    ) ;_ end of defun
     
    George Drayton, Sep 15, 2004
    #1
  2. George Drayton

    Jeff Mishler Guest

    You can't get a selection set of attributes. You CAN get a selection set of
    all block inserts that contain attributes '(0 ."INSERT)'(66 . 1). Then you
    will need to step through the block reference for the attributes. There have
    been a handful or two of these steps posted in the past few months.

    If you need additional help, just ask.
     
    Jeff Mishler, Sep 15, 2004
    #2
  3. Sorry I shoukld have said- I'm really trying to change the text style of an
    Attdef
     
    George Drayton, Sep 15, 2004
    #3
  4. George Drayton

    Jeff Mishler Guest

    Heh, and if I would've looked closer at the filter list I would've seen
    that........So back to the drawing board.....

    Now I don't follow what you are doing. If you are changing the attdef's, you
    will need to redefine the block(s) they belong to. Once that is done any NEW
    inserts of that block will have the updated attribute style, BUT all exiting
    attributes will retain the style that was in effect at the time they were
    created. Which leads me back to my last response..... ;-) that is, if you
    want them to look the same (which it sounds like you do)
     
    Jeff Mishler, Sep 15, 2004
    #4
  5. I have a large number of individual DWG's which are inserted as blocks into
    DWGs. I want to edit the text style in the DWG which is just a block
    definition.
     
    George Drayton, Sep 15, 2004
    #5
  6. George Drayton

    Jeff Mishler Guest

    OK, I'm following you now....I think.

    Nonetheless, your code WILL work if you adjust this line:
    (setq temp (cdr (entget (ssname attributes count))))
    to this:
    (setq temp (entget (ssname attributes count)))

    By using the (cdr) of (entget) you were removing the (assoc -1) of the
    entity list....which (entmod) needs to work.....
     
    Jeff Mishler, Sep 15, 2004
    #6
  7. Thanks very much - I'm not going mad after all!
     
    George Drayton, Sep 15, 2004
    #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.