Rename Style with null name

Marc'Antonio Alessi

Usenet Archive
Joined
Jul 10, 2003
Messages
204
Reaction score
0
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?
 
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.
 
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
 
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,
That sounds like the fix. Replace with another style, or at least a 'named' one.
Bob
 
Robert,
That's too easy. Couldn't you make it a bit harder? ;-)
 
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.
 
Well, submit a bug report... ;-)

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

"Marc'Antonio Alessi" <maalessi at tin dot it> wrote:
| 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. | | -- |
 
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
 
Back
Top