' NX 6.0.5.3 ' Journal created by langent on Thu Jan 17 07:08:30 2013 Mitteleuropäische Zeit ' Option Strict Off Imports System Imports NXOpen Module NXJournal Sub Main() Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Dim displayPart As Part = theSession.Parts.Display Dim response2 As Selection.DialogResponse Dim response As Selection.DialogResponse Dim theUI As UI = UI.GetUI() Dim point4 As Point3d Dim cursor3 As Point3d Dim cursor As Point3d ' ---------------------------------------------- ' Menü: Einfügen->Symbol->Identification Symbol... ' ---------------------------------------------- Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim nullAnnotations_IdSymbol As Annotations.IdSymbol = Nothing Dim idSymbolBuilder1 As Annotations.IdSymbolBuilder idSymbolBuilder1 = workPart.Annotations.IdSymbols.CreateIdSymbolBuilder(nullAnnotations_IdSymbol) idSymbolBuilder1.Origin.SetInferRelativeToGeometry(True) idSymbolBuilder1.Type = Annotations.IdSymbolBuilder.SymbolTypes.RoundedBox idSymbolBuilder1.Origin.Anchor = Annotations.OriginBuilder.AlignmentPosition.MidCenter idSymbolBuilder1.UpperText = "18" idSymbolBuilder1.Size = 10.0 theSession.SetUndoMarkName(markId1, "Identification Symbol Dialogfenster") idSymbolBuilder1.Origin.SetInferRelativeToGeometry(True) Dim leaderData1 As Annotations.LeaderData leaderData1 = workPart.Annotations.CreateLeaderData() leaderData1.StubSize = 5.0 leaderData1.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledArrow idSymbolBuilder1.Leader.Leaders.Append(leaderData1) leaderData1.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledDot leaderData1.StubSide = Annotations.LeaderSide.Inferred idSymbolBuilder1.Origin.SetInferRelativeToGeometry(True) idSymbolBuilder1.Origin.SetInferRelativeToGeometry(True) leaderData1.StubSize = 0.0 response = theUI.SelectionManager.SelectScreenPosition("Ursprung auswählen...", workPart.Views.WorkView, cursor) Dim cursor5(2) As Double cursor5(0) = cursor.X cursor5(1) = cursor.Y Dim coordinates1 As Point3d = New Point3d(cursor5(0), cursor5(1), 0.0) Dim point1 As Point point1 = workPart.Points.CreatePoint(coordinates1) Dim point2 As Point3d = New Point3d(cursor5(0), cursor5(1), 0.0) leaderData1.Leader.SetValue(point1, workPart.Views.WorkView, point2) Dim leaderData2 As Annotations.LeaderData leaderData2 = workPart.Annotations.CreateLeaderData() leaderData2.StubSize = 5.0 leaderData2.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledArrow idSymbolBuilder1.Leader.Leaders.Append(leaderData2) leaderData2.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledDot leaderData2.StubSide = Annotations.LeaderSide.Inferred leaderData2.StubSize = 0.0 Dim point3 As Point3d = New Point3d(cursor5(0), cursor5(1), 0.0) leaderData1.Leader.SetValue(point1, workPart.Views.WorkView, point3) Dim assocOrigin1 As Annotations.Annotation.AssociativeOriginData assocOrigin1.OriginType = Annotations.AssociativeOriginType.Drag Dim nullView As View = Nothing assocOrigin1.View = nullView assocOrigin1.ViewOfGeometry = nullView Dim nullPoint As Point = Nothing assocOrigin1.PointOnGeometry = nullPoint assocOrigin1.VertAnnotation = Nothing assocOrigin1.VertAlignmentPosition = Annotations.AlignmentPosition.TopLeft assocOrigin1.HorizAnnotation = Nothing assocOrigin1.HorizAlignmentPosition = Annotations.AlignmentPosition.TopLeft assocOrigin1.AlignedAnnotation = Nothing assocOrigin1.DimensionLine = 0 assocOrigin1.AssociatedView = nullView assocOrigin1.AssociatedPoint = nullPoint assocOrigin1.OffsetAnnotation = Nothing assocOrigin1.OffsetAlignmentPosition = Annotations.AlignmentPosition.TopLeft assocOrigin1.XOffsetFactor = 0.0 assocOrigin1.YOffsetFactor = 0.0 assocOrigin1.StackAlignmentPosition = Annotations.StackAlignmentPosition.Above idSymbolBuilder1.Origin.SetAssociativeOrigin(assocOrigin1) response2 = theUI.SelectionManager.SelectScreenPosition("Position des ID Symbols auswählen...", nullView, cursor3) point4 = cursor3 idSymbolBuilder1.Origin.Origin.SetValue(Nothing, nullView, point4) idSymbolBuilder1.Origin.SetInferRelativeToGeometry(True) leaderData1.StubSide = Annotations.LeaderSide.Left Dim markId2 As Session.UndoMarkId markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Identification Symbol") Dim nXObject1 As NXObject nXObject1 = idSymbolBuilder1.Commit() theSession.DeleteUndoMark(markId2, Nothing) theSession.SetUndoMarkName(markId1, "Identification Symbol") theSession.SetUndoMarkVisibility(markId1, Nothing, Session.MarkVisibility.Visible) idSymbolBuilder1.Destroy() Dim markId3 As Session.UndoMarkId markId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Start") Dim idSymbolBuilder2 As Annotations.IdSymbolBuilder idSymbolBuilder2 = workPart.Annotations.IdSymbols.CreateIdSymbolBuilder(nullAnnotations_IdSymbol) idSymbolBuilder2.Origin.SetInferRelativeToGeometry(True) idSymbolBuilder2.Type = Annotations.IdSymbolBuilder.SymbolTypes.RoundedBox idSymbolBuilder2.Origin.Anchor = Annotations.OriginBuilder.AlignmentPosition.MidCenter idSymbolBuilder2.UpperText = "18" idSymbolBuilder2.Size = 10.0 theSession.SetUndoMarkName(markId3, "Identification Symbol Dialogfenster") idSymbolBuilder2.Origin.SetInferRelativeToGeometry(True) Dim leaderData3 As Annotations.LeaderData leaderData3 = workPart.Annotations.CreateLeaderData() leaderData3.StubSize = 5.0 leaderData3.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledArrow idSymbolBuilder2.Leader.Leaders.Append(leaderData3) leaderData3.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledDot leaderData3.StubSide = Annotations.LeaderSide.Inferred leaderData3.StubSize = 0.0 idSymbolBuilder2.Origin.SetInferRelativeToGeometry(True) idSymbolBuilder2.Origin.SetInferRelativeToGeometry(True) ' ---------------------------------------------- ' Dialogfenster Anfang ID-Symbol ' ---------------------------------------------- idSymbolBuilder2.Destroy() theSession.UndoToMark(markId3, Nothing) theSession.DeleteUndoMark(markId3, Nothing) ' ---------------------------------------------- ' Menü: Werkzeuge->Journal->Stop Recording ' ---------------------------------------------- End Sub End Module