Code:
Option Strict Off
Imports NXOpenModule set_posnr_text_to_arial
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Sub Main()
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "change general text to Arial")
Dim numBad As Integer = 0
Dim fntArial As Integer = workPart.Fonts.AddFont("Arial", FontCollection.Type.Standard)
For Each idSymbol1 As Annotations.IdSymbol In workPart.Annotations.IdSymbols
Dim symbolPreferences1 As Annotations.SymbolPreferences
symbolPreferences1 = idSymbol1.GetSymbolPreferences()
Dim letteringPreferences1 As Annotations.LetteringPreferences
letteringPreferences1 = idSymbol1.GetLetteringPreferences()
Dim generalText1 As Annotations.Lettering
If generalText1.Size <> 0.01 Then
numBad += 1
generalText1.Size = 3.5
' generalText1.CharacterSpaceFactor = 0.0
generalText1.AspectRatio = 1.0
generalText1.LineSpaceFactor = 1.0
generalText1.Cfw.Color = 7
generalText1.Cfw.Font = fntArial
generalText1.Cfw.Width = Annotations.LineWidth.Thin
' generalText1.Italic = False
letteringPreferences1.SetGeneralText(generalText1)
End if
idSymbol1.SetLetteringPreferences(letteringPreferences1)
letteringPreferences1.Dispose()
Dim nErrs1 As Integer
nErrs1 = theSession.UpdateManager.DoUpdate(markId1)
Next
If numBad > 0 Then
theSession.SetUndoMarkVisibility(markId1, "change dim text to Arial", Session.MarkVisibility.Visible)
End If
End Sub
End Module