JOURNAL to change part annotation prefrences
JOURNAL to change part annotation prefrences
(OP)
I tried to record a journal to change the prefrenes for preferences->annotation then under lettering tab character size to .1 , but nothing recorded because it wasn't supported. I tried to look under in the api reference and found the following
Namespaces ► NXOpen.Preferences ► AnnotationPreferences ► SetLetteringPreferences
C# Visual Basic Visual C++
public void SetLetteringPreferences(
LetteringPreferences letteringPrefs
)
I am not sure how to read it or know what it is trying to tell me to do. I tried to do
workPart.Preferences.AnnotationPreferences.SetLetteringPreferences.Size = 0.1
but didn't have any luck.
I would like to add this preference and others in my journal and think this would be a good one to start with.
Namespaces ► NXOpen.Preferences ► AnnotationPreferences ► SetLetteringPreferences
C# Visual Basic Visual C++
public void SetLetteringPreferences(
LetteringPreferences letteringPrefs
)
I am not sure how to read it or know what it is trying to tell me to do. I tried to do
workPart.Preferences.AnnotationPreferences.SetLetteringPreferences.Size = 0.1
but didn't have any luck.
I would like to add this preference and others in my journal and think this would be a good one to start with.





RE: JOURNAL to change part annotation prefrences
CODE
Option Strict Off Imports System Imports NXOpen Module Module1 Sub Main() Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work 'get current lettering preferences Dim myLetteringPreferences As Annotations.LetteringPreferences = workPart.Annotations.Preferences.GetLetteringPreferences 'get general text preferences Dim myLettering As Annotations.Lettering myLettering = myLetteringPreferences.GetGeneralText 'change character size myLettering.Size = 0.1 'set general text preferences myLetteringPreferences.SetGeneralText(myLettering) 'do the same for appended text, dimension text, and tolerance text myLettering = myLetteringPreferences.GetAppendedText myLettering.Size = 0.1 myLetteringPreferences.SetAppendedText(myLettering) myLettering = myLetteringPreferences.GetDimensionText myLettering.Size = 0.1 myLetteringPreferences.SetDimensionText(myLettering) myLettering = myLetteringPreferences.GetToleranceText myLettering.Size = 0.1 myLetteringPreferences.SetToleranceText(myLettering) 'set the new preferences to the work part workPart.Annotations.Preferences.SetLetteringPreferences(myLetteringPreferences) End Sub End Modulewww.nxjournaling.com