Hi all,
we have several drawings where tags were placed with the bold button activated in the text editor (Word Processor) box.
We would like to reset them to a normal (not bold) textstyle.
Is there a way to do this by vba?
Probably by assigning the active textstye to them - but there is not bold property we could explicitly adress....
Any hint appreciated.
Ingo
Ingo said:we have several drawings where tags were placed with the bold button activated in the text editor (Word Processor) box.
Which version (e.g. v10.x.y.z) of MicroStation or other product are you using?
Ingo said:We would like to reset them to a normal (not bold) textstyle
You need to create a new tag element using the desired active text style, copying the tag values from the original tag. Then delete the original tag element.
Regards, Jon Summers LA Solutions
(how quick ... !)
and uh - how hard.
We are using both CE updt10 (10.10.00.23) and ss4 (08.11.09.867). But we are trying to have scripts running for both versions.
Probably there are no new properties in CE for tags...
Ingo said:Is there a way to do this by vba?
Yes, but as Jon wrote, probably you have to recreate them.
Ingo said:Probably by assigning the active textstye to them
Tags do not support Text Styles. I am quite sure only basic font data (font name and size) is stored with tags, nothing else.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Ingo said:and uh - how hard.
There's some code that may help published here.
Ingo said:We are using both CE updt10 (10.10.00.23) and ss4 (08.11.09.867). But we are trying to have scripts running for both versions
Your VBA source code should compile unchanged on both versions. If your code calls any MDL or Win32 functions you will have to make minor changes to the VBA function declarations.
Jon Summers said:There's some code that may help published here.
That's a good starting point. We'll mix it up with some of our code.
Thanks, Ingo
Hello Ingo,
I have a sub to revise the tag font for your reference.
Sub ReviseTag() Dim oScanCriteria As New ElementScanCriteria Dim oElementEnum As ElementEnumerator Dim oTag As TagElement Dim MyFont As Font oScanCriteria.ExcludeAllTypes oScanCriteria.IncludeType msdElementTypeTag Set oElementEnum = ActiveModelReference.Scan(oScanCriteria) While oElementEnum.MoveNext Set oTag = oElementEnum.Current 'If oTag.Value <> "" Then Debug.Print oTag.Value & " " & oTag.Font.Name & " " & oTag.Font.Type If oTag.Font.Name = "Tahoma" Then Debug.Print oTag.Value & " " & oTag.Font.Name & " " & oTag.Font.Type oTag.Font = ActiveDesignFile.Fonts.Find(msdFontTypeWindowsTrueType, "Arial Unicode MS") oTag.Rewrite End If Wend End Sub