NXOpen - Dual Dimensions
NXOpen - Dual Dimensions
(OP)
Dear Forum,
How do I find out if a dimension is dual dimensioned with NXOpen?
How do I find out if a dimension is dual dimensioned with NXOpen?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: NXOpen - Dual Dimensions
please have a look into attached screenshot....
in the namespace --> NXOpen.Annotations.TextComponent.TextComponentTextType
you will succeed in the end....
lklo
RE: NXOpen - Dual Dimensions
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
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
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
www.nxjournaling.com
RE: NXOpen - Dual Dimensions
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 Modulewww.nxjournaling.com
RE: NXOpen - Dual Dimensions
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.