Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations Ron247 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

JOURNAL to change part annotation prefrences

Status
Not open for further replies.

aluminum2

Aerospace
Apr 27, 2010
218
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.
 
Replies continue below

Recommended for you

Here's a code example. I'm using NX 8.

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 Module

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor