×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

JOURNAL to change part annotation prefrences

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.

RE: JOURNAL to change part annotation prefrences

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources