Setting User Defined Diameter Symbol

Hello!
I tried to journal the change the setting of the Diameter Symbol in "Annotation Preferences --> Radial" to the the diameter symbol that is created by keyboard-input Alt+0216 Ø

But this change is not recorded by journaling.


Is it possible to make changes in "Annotation Preferences" by code and start this code in a toolbar?


Thanks for help!


'NXJournaling
'May 7, 2014
'change diameter dimension symbol preference

Option Strict Off
Imports System
Imports NXOpen

Module Module1

Sub Main()

Dim theSession As Session = Session.GetSession()
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If

Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()

Const undoMarkName As String = "NXJ set diameter symbol preference"
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName)

Try

'show current setting
lw.WriteLine("current diameter symbol pref: " & workPart.Annotations.Preferences.GetDimensionPreferences.GetDiameterRadiusPreferences.DiameterSymbol.ToString())

'get current settings
Dim myDimPref As Annotations.DimensionPreferences = workPart.Annotations.Preferences.GetDimensionPreferences
Dim myDiaRadPref As Annotations.DiameterRadiusPreferences = myDimPref.GetDiameterRadiusPreferences

'change the diameter symbol as desired
myDiaRadPref.DiameterSymbol = Annotations.DiameterSymbol.UserDefined
myDiaRadPref.DiameterSymbolText = "Ø"

'save changes to dimension preferences
myDimPref.SetDiameterRadiusPreferences(myDiaRadPref)
workPart.Annotations.Preferences.SetDimensionPreferences(myDimPref)

'show the new current setting
lw.WriteLine("new diameter symbol pref: " & workPart.Annotations.Preferences.GetDimensionPreferences.GetDiameterRadiusPreferences.DiameterSymbol.ToString)

Catch ex As NXException
theSession.UndoToMark(markId1, undoMarkName)
MsgBox(ex.Message)

Finally

End Try

lw.Close()

End Sub

End Module

Hi!

This script works really fine, perfect.

Thank you very much for the fast solution to my question.

kind regards, Martin