DavidQ
Industrial
- Oct 11, 2012
- 53
Is there is a simply way to create 10, 15, 30...notes using this code lines: (the main concern is to avoid repeating 30 times the same block of lines but with diferent counter (14))
Dim nullAnnotations_SimpleDraftingAid14 As Annotations.SimpleDraftingAid = Nothing
Dim draftingNoteBuilder14 As Annotations.DraftingNoteBuilder
draftingNoteBuilder14 = workPart.Annotations.CreateDraftingNoteBuilder(nullAnnotations_SimpleDraftingAid14)
draftingNoteBuilder14.Origin.Plane.PlaneMethod = Annotations.PlaneBuilder.PlaneMethodType.XyPlane
draftingNoteBuilder14.Origin.SetInferRelativeToGeometry(False)
draftingNoteBuilder14.Origin.SetInferRelativeToGeometry(True)
draftingNoteBuilder14.Origin.Anchor = Annotations.OriginBuilder.AlignmentPosition.BottomLeft
Dim text14(0) As String
text14(0) = "Fecha1"
draftingNoteBuilder14.Text.TextBlock.SetText(text14)
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextSize = 1.3129
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextCharSpaceFactor = 0.8945
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextAspectRatio = 0.8945
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextColor = workPart.Colors.Find("Black")
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextFont = 2
Dim fontIndex14 As Integer
fontIndex14 = workPart.Fonts.AddFont("ge_font5")
Dim assocOrigin14 As Annotations.Annotation.AssociativeOriginData
assocOrigin14.OriginType = Annotations.AssociativeOriginType.Drag
Dim nullView14 As View = Nothing
assocOrigin14.View = nullView14
assocOrigin14.ViewOfGeometry = nullView14
Dim nullPoint14 As Point = Nothing
assocOrigin14.PointOnGeometry = nullPoint14
assocOrigin14.VertAnnotation = Nothing
assocOrigin14.VertAlignmentPosition = Annotations.AlignmentPosition.TopLeft
assocOrigin14.HorizAnnotation = Nothing
assocOrigin14.HorizAlignmentPosition = Annotations.AlignmentPosition.TopLeft
assocOrigin14.AlignedAnnotation = Nothing
assocOrigin14.DimensionLine = 0
assocOrigin14.AssociatedView = nullView14
assocOrigin14.AssociatedPoint = nullPoint14
assocOrigin14.OffsetAnnotation = Nothing
assocOrigin14.OffsetAlignmentPosition = Annotations.AlignmentPosition.TopLeft
assocOrigin14.XOffsetFactor = 0.0
assocOrigin14.YOffsetFactor = 0.0
assocOrigin14.StackAlignmentPosition = Annotations.StackAlignmentPosition.Above
draftingNoteBuilder14.Origin.SetAssociativeOrigin(assocOrigin14)
Dim point14 As Point3d = New Point3d(92, 26, 0.0)
draftingNoteBuilder14.Origin.Origin.SetValue(Nothing, nullView14, point14)
draftingNoteBuilder14.Origin.SetInferRelativeToGeometry(True)
Dim nXObject14 As NXObject
nXObject14 = draftingNoteBuilder14.Commit()
draftingNoteBuilder14.Destroy()
Is possible that some lines are missing but the code works.
Regards
Dim nullAnnotations_SimpleDraftingAid14 As Annotations.SimpleDraftingAid = Nothing
Dim draftingNoteBuilder14 As Annotations.DraftingNoteBuilder
draftingNoteBuilder14 = workPart.Annotations.CreateDraftingNoteBuilder(nullAnnotations_SimpleDraftingAid14)
draftingNoteBuilder14.Origin.Plane.PlaneMethod = Annotations.PlaneBuilder.PlaneMethodType.XyPlane
draftingNoteBuilder14.Origin.SetInferRelativeToGeometry(False)
draftingNoteBuilder14.Origin.SetInferRelativeToGeometry(True)
draftingNoteBuilder14.Origin.Anchor = Annotations.OriginBuilder.AlignmentPosition.BottomLeft
Dim text14(0) As String
text14(0) = "Fecha1"
draftingNoteBuilder14.Text.TextBlock.SetText(text14)
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextSize = 1.3129
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextCharSpaceFactor = 0.8945
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextAspectRatio = 0.8945
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextColor = workPart.Colors.Find("Black")
draftingNoteBuilder14.Style.LetteringStyle.GeneralTextFont = 2
Dim fontIndex14 As Integer
fontIndex14 = workPart.Fonts.AddFont("ge_font5")
Dim assocOrigin14 As Annotations.Annotation.AssociativeOriginData
assocOrigin14.OriginType = Annotations.AssociativeOriginType.Drag
Dim nullView14 As View = Nothing
assocOrigin14.View = nullView14
assocOrigin14.ViewOfGeometry = nullView14
Dim nullPoint14 As Point = Nothing
assocOrigin14.PointOnGeometry = nullPoint14
assocOrigin14.VertAnnotation = Nothing
assocOrigin14.VertAlignmentPosition = Annotations.AlignmentPosition.TopLeft
assocOrigin14.HorizAnnotation = Nothing
assocOrigin14.HorizAlignmentPosition = Annotations.AlignmentPosition.TopLeft
assocOrigin14.AlignedAnnotation = Nothing
assocOrigin14.DimensionLine = 0
assocOrigin14.AssociatedView = nullView14
assocOrigin14.AssociatedPoint = nullPoint14
assocOrigin14.OffsetAnnotation = Nothing
assocOrigin14.OffsetAlignmentPosition = Annotations.AlignmentPosition.TopLeft
assocOrigin14.XOffsetFactor = 0.0
assocOrigin14.YOffsetFactor = 0.0
assocOrigin14.StackAlignmentPosition = Annotations.StackAlignmentPosition.Above
draftingNoteBuilder14.Origin.SetAssociativeOrigin(assocOrigin14)
Dim point14 As Point3d = New Point3d(92, 26, 0.0)
draftingNoteBuilder14.Origin.Origin.SetValue(Nothing, nullView14, point14)
draftingNoteBuilder14.Origin.SetInferRelativeToGeometry(True)
Dim nXObject14 As NXObject
nXObject14 = draftingNoteBuilder14.Commit()
draftingNoteBuilder14.Destroy()
Is possible that some lines are missing but the code works.
Regards