Thanks.
ok..
can anyone help me to finalise the routine..with this :
(vlax-for style (vla-get-textstyles (vla-get-activedocument (vlax-get-acad-object)))
(if
(and
(= (strcase (vla-get-stylename style)) "SIMPLEX") ;;this line not working..
(/= (strcase (vla-get-fontfile style)) "SIMPLEX.SHX")
)
(vla-put-fontfile style "SIMPLEX.SHX")
)
)
You shouldn't need this. Once you change all the objects that depend on text styles, just delete the styles you don't want.
If you want to use something like this, then when you are stepping through the text style collection, you only need to check the 'Name' property, not 'StyleName' as that is only available on objects that use text objects.
The routine Patrick gave you is pretty close to what you want, but he doesn't check for 'Constant Attributes' within blocks, and nothing about 'Tables' or 'Dimensions', and nothing about text style overrides within 'Mtext' or 'Tables'.