' NX 7.5.5.4 ' Journal created by droste on Fri Aug 31 08:01:45 2012 Mitteleuropäische Sommerzeit ' 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 ' ---------------------------------------------- ' Menü: Datei->Importieren->Part... ' ---------------------------------------------- Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Start") theSession.SetUndoMarkName(markId1, "Import Part Dialogfenster") ' ---------------------------------------------- ' Dialogfenster Anfang Teil importieren ' ---------------------------------------------- Dim markId2 As Session.UndoMarkId markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Import Part") theSession.DeleteUndoMark(markId2, Nothing) theSession.SetUndoMarkName(markId1, "Import Part") theSession.DeleteUndoMark(markId1, Nothing) theSession.Parts.SetNonmasterSeedPartData("@DB/"TEMPLATE_NAME"/00") Dim markId3 As Session.UndoMarkId markId3 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Import Part") Dim importer1 As Importer importer1 = workPart.ImportManager.CreatePartImporter() Dim partImporter1 As PartImporter = CType(importer1, PartImporter) partImporter1.FileName = "@DB/"TEMPLATE_NAME"/00" partImporter1.Scale = 1.0 partImporter1.CreateNamedGroup = False partImporter1.ImportViews = False partImporter1.ImportCamObjects = False partImporter1.LayerOption = PartImporter.LayerOptionType.Original partImporter1.DestinationCoordinateSystemSpecification = PartImporter.DestinationCoordinateSystemSpecificationType.Work Dim element1 As Matrix3x3 element1.Xx = 1.0 element1.Xy = 0.0 element1.Xz = 0.0 element1.Yx = 0.0 element1.Yy = 1.0 element1.Yz = 0.0 element1.Zx = 0.0 element1.Zy = 0.0 element1.Zz = 1.0 Dim nXMatrix1 As NXMatrix nXMatrix1 = workPart.NXMatrices.Create(element1) partImporter1.DestinationCoordinateSystem = nXMatrix1 Dim destinationPoint1 As Point3d = New Point3d(0.0, 0.0, 18.0) partImporter1.DestinationPoint = destinationPoint1 Dim markId4 As Session.UndoMarkId markId4 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Import Part Commit") Dim nXObject1 As NXObject nXObject1 = partImporter1.Commit() theSession.DeleteUndoMark(markId4, Nothing) partImporter1.Destroy() ' ---------------------------------------------- ' Menü: Werkzeuge->Journal->Stop Recording ' ---------------------------------------------- End Sub End Module