Kenja824
Automotive
- Nov 5, 2014
- 949
I have a journal for workers to hit before working on a new job. It sets up all of the drafting settings that we need in order to keep all of the work done in a similar way for this group. We need to now add to it so it will switch UG over to modeling, select all bodies (Solid bodies, sheet bodies, etc...) and change the Edit-Display settings so the lines are solid, .35 thick.
However, I cant figure out how to make a journal switch over to modeling and then back to drafting after it does what it needs to do to the bodies.
Can anyone please help with this? I have found other threads about similar things but I am having a hard time figuring how to add these to a journal that is already working in drafting preferences. It would not matter if it does this at the beginning of the journal and then sets all the drafting preferences, or if it sets the preferences and then changes the edit display to the bodies at the end.
Here is the Journal I am needing to adjust.....
' NX 9.0.2.5
' Journal created by kschonmeier HMS Company
'
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Module NXJournal
Sub Main(ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If
Dim workPart As Part = theSession.Parts.Work
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim preferencesBuilder1 As Drafting.PreferencesBuilder
preferencesBuilder1 = workPart.SettingsManager.CreatePreferencesBuilder()
preferencesBuilder1.ViewStyle.ViewStyleGeneral.Silhouettes = True
preferencesBuilder1.ViewStyle.ViewStyleGeneral.Centerlines = False
'find closest NX color in display part color table
'Dark Gray (R,G,B) = 76, 76, 76
Dim colorValues(2) As Double
colorValues(0) = 76 / 255
colorValues(1) = 76 / 255
colorValues(2) = 76 / 255
Dim closeColor As Integer
theUfSession.Disp.AskClosestColor(UFConstants.UF_DISP_rgb_model, colorValues,
UFConstants.UF_DISP_CCM_EUCLIDEAN_DISTANCE, closeColor)
Dim myBorderColor As NXColor
myBorderColor = workPart.Colors.Find(closeColor)
'preferencesBuilder1.ViewWorkflow.BorderColor = workPart.Colors.Find("Dark Gray")
preferencesBuilder1.ViewWorkflow.BorderColor = myBorderColor
preferencesBuilder1.ViewWorkflow.PreviewStyle =
Drawings.ViewWorkflowBuilder.Style.Shaded
'Dim fontIndex1 As Integer
'fontIndex1 = workPart.Fonts.AddFont("leroy", FontCollection.Type.Nx)
preferencesBuilder1.TableCellStyle.BorderColor = 212
preferencesBuilder1.ViewStyle.ViewStyleGeneral.ExtractedEdges =
Preferences.GeneralExtractedEdgesOption.None
preferencesBuilder1.ViewStyle.ViewStyleGeneral.ViewRepresentation =
Preferences.GeneralViewRepresentationOption.PreNx85Exact
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AnglePrecision = 0
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AnglePrecision = 1
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AngleDecimalPointCharacter =
Preferences.DecimalPointCharacter.Period
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AngleShowLeadingZeros = True
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AngleShowTrailingZeros = True
preferencesBuilder1.ViewStyle.ViewStyleVisibleLines.VisibleColor =
workPart.Colors.Find(-1)
preferencesBuilder1.ViewStyle.ViewStyleVisibleLines.VisibleColor =
workPart.Colors.Find("Background")
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.HiddenLine = True
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.Color = workPart.Colors.Find(-1)
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.Color = workPart.Colors.Find
("Background")
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.Font = Preferences.Font.Dashed
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.EdgesHiddenByEdges = True
preferencesBuilder1.ViewStyle.ViewStyleSmoothEdges.Color = workPart.Colors.Find(-1)
preferencesBuilder1.ViewStyle.ViewStyleSmoothEdges.Color = workPart.Colors.Find
("Background")
preferencesBuilder1.ViewStyle.ViewStyleSmoothEdges.SmoothEdge = False
preferencesBuilder1.ViewProjectedLabel.ShowViewLabel = False
preferencesBuilder1.ViewStyle.ViewProjectedViewSettings.DisplayArrowOnParentView =
Drawings.ViewProjectedViewSettingsBuilder.DisplayArrowOnParentViewType.No
preferencesBuilder1.ViewStyle.ViewStyleSection.SheetBodies = True
preferencesBuilder1.ViewStyle.ViewStyleSection.Background = True
preferencesBuilder1.ViewWorkflow.AssociativeAlignment = False
preferencesBuilder1.AnnotationStyle.DimensionStyle.Orientation =
Annotations.TextOrientation.Horizontal
preferencesBuilder1.AnnotationStyle.DimensionStyle.ChamferSeparator =
Annotations.ChamferSeparatorType.UppercaseX
preferencesBuilder1.AnnotationStyle.DimensionStyle.LineBetweenArrows = False
preferencesBuilder1.AnnotationStyle.DimensionStyle.AngularDimensionValuePrecision = 2
preferencesBuilder1.AnnotationStyle.DimensionStyle.DimensionValuePrecision = 2
preferencesBuilder1.AnnotationStyle.DimensionStyle.TextArrowPlacement =
Annotations.TextPlacement.ManualArrowsIn
preferencesBuilder1.AnnotationStyle.LetteringStyle.AlignPosition =
Annotations.AlignmentPosition.TopLeft
preferencesBuilder1.AnnotationStyle.LetteringStyle.HorizontalTextJustification =
Annotations.TextJustification.Center
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralStandardTextCharacterSpaceFactor = 0.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextLineSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.Angle = 0.0
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstArrowheadColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowheadColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstExtensionLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondExtensionLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowheadColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstArrowLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstPosToExtensionLineDistance = 1.5
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondPosToExtensionLineDistance = 1.5
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstArrowType =
Annotations.ArrowheadType.ClosedArrow
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowType =
Annotations.ArrowheadType.ClosedArrow
preferencesBuilder1.AnnotationStyle.LineArrowStyle.StubLength = 3.0
preferencesBuilder1.AnnotationStyle.LineArrowStyle.TextToLineDistance = 1.0
preferencesBuilder1.AnnotationStyle.LineArrowStyle.LinePastArrowDistance = 2.0
preferencesBuilder1.AnnotationStyle.OrdinateStyle.DisplayDimensionLine =
Annotations.OrdinateLineArrowDisplayOption.None
preferencesBuilder1.AnnotationStyle.OrdinateStyle.PositiveDirection =
Annotations.OrdinatePositiveDirection.UpperRight
preferencesBuilder1.AnnotationStyle.OrdinateStyle.DisplayNameStyle =
Annotations.OrdinateOriginDisplayOption.NoText
preferencesBuilder1.AnnotationStyle.OrdinateStyle.OrdinateTextOrientation =
Annotations.TextOrientation.Aligned
preferencesBuilder1.AnnotationStyle.OrdinateStyle.DoglegAngle = 1.13446401379631
preferencesBuilder1.AnnotationStyle.UnitsStyle.DecimalPointCharacter =
Annotations.DecimalPointCharacter.Period
preferencesBuilder1.AnnotationStyle.UnitsStyle.DisplayTrailingZeros = False
preferencesBuilder1.AnnotationStyle.UnitsStyle.DisplayLeadingDimensionZeros = True
preferencesBuilder1.AnnotationStyle.UnitsStyle.DisplayLeadingToleranceZeros = True
preferencesBuilder1.AnnotationStyle.UnitsStyle.DimensionAngularFormat =
Annotations.AngularDimensionFormat.FractionalDegrees
preferencesBuilder1.AnnotationStyle.HoleCalloutSettings.SetLeaderAttachment
(Annotations.HoleCalloutSettingsBuilder.LeaderAttachment.Top)
preferencesBuilder1.ViewWorkflow.DisplayBorders = True
'Dim letteringPreferences1 As Annotations.LetteringPreferences
'letteringPreferences1 = workPart.Annotations.Preferences.GetLetteringPreferences()
Dim fontIndex1 As Integer
fontIndex1 = workPart.Fonts.AddFont("leroy", FontCollection.Type.Nx)
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextColor = workPart.Colors.Find
("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedStandardTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextLineSpaceFactor = 0.6
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextLineWidth =
Annotations.LineWidth.Thin
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextColor = workPart.Colors.Find
("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionStandardTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextLineSpaceFactor = 0.6
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimLineSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextLineWidth =
Annotations.LineWidth.Thin
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextColor = workPart.Colors.Find
("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceStandardTextCharacterSpaceFactor
= 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextLineSpaceFactor = 0.6
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextLineWidth =
Annotations.LineWidth.Thin
Dim nXObject1 As NXObject
nXObject1 = preferencesBuilder1.Commit()
theSession.SetUndoMarkName(markId1, "Drafting Preferences")
preferencesBuilder1.Destroy()
' ----------------------------------------------
' Menu: Edit->Sheet...
' ----------------------------------------------
Dim markId4 As Session.UndoMarkId
markId4 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim drawingSheet1 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject("SHT1"),
Drawings.DrawingSheet)
Dim drawingSheetBuilder1 As Drawings.DrawingSheetBuilder
drawingSheetBuilder1 = workPart.DrawingSheets.DrawingSheetBuilder(drawingSheet1)
drawingSheetBuilder1.ProjectionAngle =
Drawings.DrawingSheetBuilder.SheetProjectionAngle.Third
Dim nXObject2 As NXObject
nXObject2 = drawingSheetBuilder1.Commit()
theSession.SetUndoMarkName(markId4, "Sheet")
drawingSheetBuilder1.Destroy()
End Sub
End Module
However, I cant figure out how to make a journal switch over to modeling and then back to drafting after it does what it needs to do to the bodies.
Can anyone please help with this? I have found other threads about similar things but I am having a hard time figuring how to add these to a journal that is already working in drafting preferences. It would not matter if it does this at the beginning of the journal and then sets all the drafting preferences, or if it sets the preferences and then changes the edit display to the bodies at the end.
Here is the Journal I am needing to adjust.....
' NX 9.0.2.5
' Journal created by kschonmeier HMS Company
'
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Module NXJournal
Sub Main(ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If
Dim workPart As Part = theSession.Parts.Work
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim preferencesBuilder1 As Drafting.PreferencesBuilder
preferencesBuilder1 = workPart.SettingsManager.CreatePreferencesBuilder()
preferencesBuilder1.ViewStyle.ViewStyleGeneral.Silhouettes = True
preferencesBuilder1.ViewStyle.ViewStyleGeneral.Centerlines = False
'find closest NX color in display part color table
'Dark Gray (R,G,B) = 76, 76, 76
Dim colorValues(2) As Double
colorValues(0) = 76 / 255
colorValues(1) = 76 / 255
colorValues(2) = 76 / 255
Dim closeColor As Integer
theUfSession.Disp.AskClosestColor(UFConstants.UF_DISP_rgb_model, colorValues,
UFConstants.UF_DISP_CCM_EUCLIDEAN_DISTANCE, closeColor)
Dim myBorderColor As NXColor
myBorderColor = workPart.Colors.Find(closeColor)
'preferencesBuilder1.ViewWorkflow.BorderColor = workPart.Colors.Find("Dark Gray")
preferencesBuilder1.ViewWorkflow.BorderColor = myBorderColor
preferencesBuilder1.ViewWorkflow.PreviewStyle =
Drawings.ViewWorkflowBuilder.Style.Shaded
'Dim fontIndex1 As Integer
'fontIndex1 = workPart.Fonts.AddFont("leroy", FontCollection.Type.Nx)
preferencesBuilder1.TableCellStyle.BorderColor = 212
preferencesBuilder1.ViewStyle.ViewStyleGeneral.ExtractedEdges =
Preferences.GeneralExtractedEdgesOption.None
preferencesBuilder1.ViewStyle.ViewStyleGeneral.ViewRepresentation =
Preferences.GeneralViewRepresentationOption.PreNx85Exact
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AnglePrecision = 0
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AnglePrecision = 1
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AngleDecimalPointCharacter =
Preferences.DecimalPointCharacter.Period
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AngleShowLeadingZeros = True
preferencesBuilder1.ViewStyle.ViewStyleGeneral.AngleShowTrailingZeros = True
preferencesBuilder1.ViewStyle.ViewStyleVisibleLines.VisibleColor =
workPart.Colors.Find(-1)
preferencesBuilder1.ViewStyle.ViewStyleVisibleLines.VisibleColor =
workPart.Colors.Find("Background")
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.HiddenLine = True
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.Color = workPart.Colors.Find(-1)
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.Color = workPart.Colors.Find
("Background")
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.Font = Preferences.Font.Dashed
preferencesBuilder1.ViewStyle.ViewStyleHiddenLines.EdgesHiddenByEdges = True
preferencesBuilder1.ViewStyle.ViewStyleSmoothEdges.Color = workPart.Colors.Find(-1)
preferencesBuilder1.ViewStyle.ViewStyleSmoothEdges.Color = workPart.Colors.Find
("Background")
preferencesBuilder1.ViewStyle.ViewStyleSmoothEdges.SmoothEdge = False
preferencesBuilder1.ViewProjectedLabel.ShowViewLabel = False
preferencesBuilder1.ViewStyle.ViewProjectedViewSettings.DisplayArrowOnParentView =
Drawings.ViewProjectedViewSettingsBuilder.DisplayArrowOnParentViewType.No
preferencesBuilder1.ViewStyle.ViewStyleSection.SheetBodies = True
preferencesBuilder1.ViewStyle.ViewStyleSection.Background = True
preferencesBuilder1.ViewWorkflow.AssociativeAlignment = False
preferencesBuilder1.AnnotationStyle.DimensionStyle.Orientation =
Annotations.TextOrientation.Horizontal
preferencesBuilder1.AnnotationStyle.DimensionStyle.ChamferSeparator =
Annotations.ChamferSeparatorType.UppercaseX
preferencesBuilder1.AnnotationStyle.DimensionStyle.LineBetweenArrows = False
preferencesBuilder1.AnnotationStyle.DimensionStyle.AngularDimensionValuePrecision = 2
preferencesBuilder1.AnnotationStyle.DimensionStyle.DimensionValuePrecision = 2
preferencesBuilder1.AnnotationStyle.DimensionStyle.TextArrowPlacement =
Annotations.TextPlacement.ManualArrowsIn
preferencesBuilder1.AnnotationStyle.LetteringStyle.AlignPosition =
Annotations.AlignmentPosition.TopLeft
preferencesBuilder1.AnnotationStyle.LetteringStyle.HorizontalTextJustification =
Annotations.TextJustification.Center
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralStandardTextCharacterSpaceFactor = 0.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextLineSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.Angle = 0.0
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstArrowheadColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowheadColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstExtensionLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondExtensionLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowheadColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstArrowLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowLineColor =
workPart.Colors.Find("White")
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstPosToExtensionLineDistance = 1.5
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondPosToExtensionLineDistance = 1.5
preferencesBuilder1.AnnotationStyle.LineArrowStyle.FirstArrowType =
Annotations.ArrowheadType.ClosedArrow
preferencesBuilder1.AnnotationStyle.LineArrowStyle.SecondArrowType =
Annotations.ArrowheadType.ClosedArrow
preferencesBuilder1.AnnotationStyle.LineArrowStyle.StubLength = 3.0
preferencesBuilder1.AnnotationStyle.LineArrowStyle.TextToLineDistance = 1.0
preferencesBuilder1.AnnotationStyle.LineArrowStyle.LinePastArrowDistance = 2.0
preferencesBuilder1.AnnotationStyle.OrdinateStyle.DisplayDimensionLine =
Annotations.OrdinateLineArrowDisplayOption.None
preferencesBuilder1.AnnotationStyle.OrdinateStyle.PositiveDirection =
Annotations.OrdinatePositiveDirection.UpperRight
preferencesBuilder1.AnnotationStyle.OrdinateStyle.DisplayNameStyle =
Annotations.OrdinateOriginDisplayOption.NoText
preferencesBuilder1.AnnotationStyle.OrdinateStyle.OrdinateTextOrientation =
Annotations.TextOrientation.Aligned
preferencesBuilder1.AnnotationStyle.OrdinateStyle.DoglegAngle = 1.13446401379631
preferencesBuilder1.AnnotationStyle.UnitsStyle.DecimalPointCharacter =
Annotations.DecimalPointCharacter.Period
preferencesBuilder1.AnnotationStyle.UnitsStyle.DisplayTrailingZeros = False
preferencesBuilder1.AnnotationStyle.UnitsStyle.DisplayLeadingDimensionZeros = True
preferencesBuilder1.AnnotationStyle.UnitsStyle.DisplayLeadingToleranceZeros = True
preferencesBuilder1.AnnotationStyle.UnitsStyle.DimensionAngularFormat =
Annotations.AngularDimensionFormat.FractionalDegrees
preferencesBuilder1.AnnotationStyle.HoleCalloutSettings.SetLeaderAttachment
(Annotations.HoleCalloutSettingsBuilder.LeaderAttachment.Top)
preferencesBuilder1.ViewWorkflow.DisplayBorders = True
'Dim letteringPreferences1 As Annotations.LetteringPreferences
'letteringPreferences1 = workPart.Annotations.Preferences.GetLetteringPreferences()
Dim fontIndex1 As Integer
fontIndex1 = workPart.Fonts.AddFont("leroy", FontCollection.Type.Nx)
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.GeneralTextFont = fontIndex1
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextColor = workPart.Colors.Find
("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedStandardTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextLineSpaceFactor = 0.6
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.AppendedTextLineWidth =
Annotations.LineWidth.Thin
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextColor = workPart.Colors.Find
("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionStandardTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextLineSpaceFactor = 0.6
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimLineSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.DimensionTextLineWidth =
Annotations.LineWidth.Thin
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextSize = 2.5
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextAspectRatio = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextColor = workPart.Colors.Find
("White")
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceNxTextCharacterSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceStandardTextCharacterSpaceFactor
= 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextLineSpaceFactor = 0.6
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextSpaceFactor = 1.0
preferencesBuilder1.AnnotationStyle.LetteringStyle.ToleranceTextLineWidth =
Annotations.LineWidth.Thin
Dim nXObject1 As NXObject
nXObject1 = preferencesBuilder1.Commit()
theSession.SetUndoMarkName(markId1, "Drafting Preferences")
preferencesBuilder1.Destroy()
' ----------------------------------------------
' Menu: Edit->Sheet...
' ----------------------------------------------
Dim markId4 As Session.UndoMarkId
markId4 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim drawingSheet1 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject("SHT1"),
Drawings.DrawingSheet)
Dim drawingSheetBuilder1 As Drawings.DrawingSheetBuilder
drawingSheetBuilder1 = workPart.DrawingSheets.DrawingSheetBuilder(drawingSheet1)
drawingSheetBuilder1.ProjectionAngle =
Drawings.DrawingSheetBuilder.SheetProjectionAngle.Third
Dim nXObject2 As NXObject
nXObject2 = drawingSheetBuilder1.Commit()
theSession.SetUndoMarkName(markId4, "Sheet")
drawingSheetBuilder1.Destroy()
End Sub
End Module