Rename Style with null name

Discussion in 'AutoCAD' started by Marc'Antonio Alessi, Jan 7, 2004.

  1. I need to rename a STYLE with null name (2 . "")

    Command: (setq stdata (entget (tblobjname "style" "")))

    (
    (-1 . <Nome entità: 400a45f8>)
    (0 . "STYLE") (330 . <Nome entità: 400a4108>)
    (5 . "273961CE31FF") (100 . "AcDbSymbolTableRecord")
    (100 . "AcDbTextStyleTableRecord")
    (2 . "") ; >>> null name
    (70 . 1) (40 . 0.0) (41 . 1.0) (50 . 0.0)
    (71 . 0) (42 . 150.0) (3 . "ltypeshp.shx") (4 . "")
    )

    Command: (entmod (subst '(2 . "STILExxx") (assoc 2 stdata) stdata))
    nil

    do not works and (vlax-put-property Table 'Name ...) method too.

    Any workaround?

    --
     
    Marc'Antonio Alessi, Jan 7, 2004
    #1
  2. Marc'Antonio Alessi

    Doug Broad Guest

    Marco,
    Have you tried something like?

    (vlax-for n
    (vla-get-textstyles
    (vla-get-activedocument
    (vlax-get-acad-object)))
    (if (= "" (vla-get-name n))
    (vla-put-name n "myname")))

    This should work assuming that you don't have
    more than one style with a blank name (I think)
    Haven't tested it because I can't create a style
    with the blank name.
     
    Doug Broad, Jan 7, 2004
    #2
  3. Marc'Antonio Alessi

    ECCAD Guest

    Marc'Antonio,
    If you .zip a .dwg with the problem STYLE, and the .shx file,
    maybe someone here could examine it, and possibly show
    how to fix it.
    Bob
     
    ECCAD, Jan 7, 2004
    #3
  4. Marc'Antonio Alessi

    Doug Broad Guest

    Marco,
    Sorry. The name property is read-only for text styles.
    The only way I can think of to do what you want is
    to create a new text style with the name you want,
    and use all the properties of the nameless text style.
    Then parse the document and change the text/mtext/
    dimension/... objects to the new style and then delete
    the old style.

    Perhaps someone else has an easier method.

    Regards,
    Doug
     
    Doug Broad, Jan 7, 2004
    #4
  5. Marc'Antonio Alessi

    ECCAD Guest

    Doug,
    That sounds like the fix. Replace with another style, or at least a 'named' one.
    Bob
     
    ECCAD, Jan 7, 2004
    #5
  6. Thanks Doug,

    I tryed vla-... methods.

    See my answer to ECCAD.

    Cheers.

    Marco

    --
    ________________________________________________

    O.S. = XP Pro 2002 - Sp.1 - Ita
    AutoCAD = 2004 Ita - Sp.1
    ________________________________________________
     
    Marc'Antonio Alessi, Jan 8, 2004
    #6
  7. Marc'Antonio Alessi

    Doug Broad Guest

    Robert,
    That's too easy. Couldn't you make it a bit harder? ;-)
     
    Doug Broad, Jan 8, 2004
    #7
  8. I could try... ;^)

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | Robert,
    | That's too easy. Couldn't you make it a bit harder? ;-)
    |
    |
    | > The blank style is for a complex linetype (ltypeshp.shx).
    | >
    | > I used dxfout on the file, added a name to the blank group 2 code, and
    | > changed the 70 group code to 0.
    |
    |
     
    R. Robert Bell, Jan 8, 2004
    #8
  9. Thanks,

    but I am looking for a different solution.

    Open the file, then look for every table with null names
    (block, styles, etc.) then purge.

    R15 and above has the ability to find null names of blocks
    (not anonymous) and to correct them with the command
    "recover" (the new name is like "AUDIT_I_xxxx....").

    Why doesn't this happen with the styles?


    Ciao.

    --
     
    Marc'Antonio Alessi, Jan 8, 2004
    #9
  10. Well, submit a bug report... ;-)


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    "Marc'Antonio Alessi" <maalessi at tin dot it> wrote in message
    | Thanks,
    |
    | but I am looking for a different solution.
    |
    | Open the file, then look for every table with null names
    | (block, styles, etc.) then purge.
    |
    | R15 and above has the ability to find null names of blocks
    | (not anonymous) and to correct them with the command
    | "recover" (the new name is like "AUDIT_I_xxxx....").
    |
    | Why doesn't this happen with the styles?
    |
    |
    | Ciao.
    |
    | --
    |
     
    R. Robert Bell, Jan 8, 2004
    #10
  11. Well, submit a bug report... ;-)

    Humm...

    I don't have a lot of trust in an answer of AutoDesk,
    I am waiting for years still for a solution for:

    - purge unused (empty) groups

    - with a large number of dimensions with a parent dimstyle
    and I draw a new dimension the dragging is very slow
    and sometime AutoCAD crash

    - ...

    These problems (and others) continue to still exist in R16
    even if AutoDesk has known them for time.


    I have had good answers only from this NG.


    Thanks to all.

    Ciao.

    Marco
     
    Marc'Antonio Alessi, Jan 9, 2004
    #11
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.