×
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

NXOpen - Dual Dimensions

NXOpen - Dual Dimensions

NXOpen - Dual Dimensions

(OP)
Dear Forum,

How do I find out if a dimension is dual dimensioned with NXOpen?

RE: NXOpen - Dual Dimensions

(OP)
That's great. But I am cycling through the dimensions in the workpart. How do I get the
annotations properties of the "dimension" object. Code Snippet Below:


For Each myDim As Dimension In workpart.dimension
Dim editSettingsBuilder1 As NXOpen.Annotations.EditSettingsBuilder
editSettingsBuilder1 = DrumMaterialDrawingPart.SettingsManager.CreateAnnotationEditSettingsBuilder({myDim})
If Me.rbMetricOnly.Checked Then
editSettingsBuilder1.AnnotationStyle.UnitsStyle.DualDimensionFormat = NXOpen.Annotations.DualDimensionPlacement.None
Else
editSettingsBuilder1.AnnotationStyle.UnitsStyle.DualDimensionFormat = NXOpen.Annotations.DualDimensionPlacement.Below
End If
editSettingsBuilder1.Commit()
editSettingsBuilder1.Destroy()
Next

RE: NXOpen - Dual Dimensions

Quote (EngProgrammer)

How do I find out if a dimension is dual dimensioned with NXOpen?

Check the value of the .DualDimensionFormat; if it is set to "None", it is not dual dimensioned. If it is set to one of the other styles, it is dual dimensioned.

www.nxjournaling.com

RE: NXOpen - Dual Dimensions

(OP)
Hi Cowski,

I don't see "DualDimensionFormat" as a property of the dimension object.

I am cycling through all the dimension in the workpart using the loop below. I am not seeing "DualDimensionFormat" as a property or method of mydim object of a dimension class.


For myDim as dimension in workpart.dimensions



next

RE: NXOpen - Dual Dimensions

You can access it through the settings builder as shown in your previous post.

www.nxjournaling.com

RE: NXOpen - Dual Dimensions

Looks like you can also get it through the dimension preferences.

CODE

Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpen.UF

Module Module2

    Dim theSession As Session = Session.GetSession()
    Dim theUfSession As UFSession = UFSession.GetUFSession()

    Dim lw As ListingWindow = theSession.ListingWindow

    Sub Main()

        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "report dims")

        lw.Open()

        For Each tempDim As Annotations.Dimension In theSession.Parts.Work.Dimensions
            lw.WriteLine("tag: " & tempDim.Tag)

            If tempDim.GetDimensionPreferences.GetUnitsFormatPreferences.DualDimensionPlacement = Annotations.DualDimensionPlacement.None Then
                lw.WriteLine("-- not a dual dimension")
            Else
                lw.WriteLine("++ dual dimension")
            End If
            lw.WriteLine("")
        Next

        lw.Close()

    End Sub

    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

    End Function

End Module 

www.nxjournaling.com

RE: NXOpen - Dual Dimensions

(OP)
Aha. A double get. Good find. I was looking at the first level of the dimension class property under the "getUnitsFormarPreferences" but I was only looking at the properties I didn't check out the methods.

I like using this one instead of getting it from the builder. It makes sense because both of these classes are in the Annotations namespace.

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