Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

Update Textstyle Name Not working

$
0
0

I am using OpenRoads Designer CONNECT Edition Release 4 Update 6 - Version 10.06.00.38.

I wrote a VBA script that uses element enumerator to scan for all text and will pass the current enumerator as a text element to a function. This function then determines the textstyle to apply.

A portion of the main module is below



            For Each omodel In o.ActiveDesignFile.Models
                oCriteria.ExcludeAllTypes' Scan for normal cells
                oCriteria.IncludeType msdElementTypeTextNode' Scan for shared cells
                oCriteria.IncludeType msdElementTypeText

                Set oEnumerator1 = omodel.Scan(oCriteria)
                Do While oEnumerator1.MoveNext
                
                    If oEnumerator1.Current.Type = msdElementTypeText Then
                        oEnumerator1.Current.IsHighlighted = True
                        
                        replaced_text = Text_StyleFix(oEnumerator1.Current.AsTextElement)
                        If replaced_text <> "" And InStr(replaced_text, ",") > 0 Then
                            oEnumerator1.Current.Rewrite
                            update_count = update_count + 1
                        Else
                            replaced_text = "None"
                        End If
                    End If

The text_stylefix function sets the text style using below. A string is returned for tracking purposes.

        Set oText.TextStyle = ActiveDesignFile.TextStyles(Replacement_Style)

Then I rewrite at the enumerator level. This line above updates all the text attributes other than the text name. Is there a reason the textstyle name is not being updated, but everything else is?

Thanks

Jacob Armour


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>