Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Inherit dimension settings from costumer defaults (journal)

Status
Not open for further replies.

rafl

Mechanical
May 30, 2011
41
0
0
PL
I have a journal that inherits settings from costumer defaults. The problem is that it doesn’t retain tolerances and fits.
How to make it read the tolerance (fit) value and assign it to the dimension once again.
Here’s the code:

Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Drawings
Imports NXOpen.UF

Module reset_all_views_and_dim_to_customer_defaults

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

    Sub Main()

        Dim workPart As Part = theSession.Parts.Work
        For Each myDim As Annotations.Dimension In workPart.Dimensions

            Dim objects1(0) As NXOpen.DisplayableObject
            objects1(0) = myDim
            Dim editSettingsBuilder1 As Annotations.EditSettingsBuilder
            editSettingsBuilder1 = workPart.SettingsManager.CreateAnnotationEditSettingsBuilder(objects1)
            editSettingsBuilder1.InheritSettingsFromCustomerDefault()
            Dim nXObject1 As NXObject
            nXObject1 = editSettingsBuilder1.Commit()
            editSettingsBuilder1.Destroy()
        Next

    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        Return Session.LibraryUnloadOption.Immediately
    End Function

End Module
 
Replies continue below

Recommended for you

I would suggest collecting the tolerance type, tolerance values, appended text, and any other dimension style settings that you would like to save then reapply the values after inheriting the customer default settings. The dimension settings can be queried through various builders; for example, you can get the tolerance type from the {edit settings builder}.AnnotationStyle.DimesionStyle.ToleranceType.

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