rafl
Mechanical
- May 30, 2011
- 41
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:
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