' NX 7.5.2.5 ' Journal created by Droste on Thu May 19 10:40:34 2011 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ü: Anwendung->Modeling... ' ---------------------------------------------- ' ---------------------------------------------- ' Menü: Anwendung->PMI ' ---------------------------------------------- Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Enter Modeling") ' ---------------------------------------------- ' Menü: Datei->Neu... ' ---------------------------------------------- Dim markId2 As Session.UndoMarkId markId2 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim fileNew1 As FileNew fileNew1 = theSession.Parts.FileNew() theSession.SetUndoMarkName(markId2, "##84New Dialogfenster") Dim markId3 As Session.UndoMarkId markId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "##84New") fileNew1.TemplateFileName = "Astralonen_Vorlage_Stator_DIN_A1.prt" fileNew1.Application = FileNewApplication.Drafting fileNew1.Units = Part.Units.Millimeters fileNew1.NewFileName = "C:\Users\Droste\Desktop\versuch_dwg3.prt" fileNew1.MasterFileName = "versuch" fileNew1.UseBlankTemplate = False fileNew1.MakeDisplayedPart = True Dim nXObject1 As NXObject nXObject1 = fileNew1.Commit() workPart = theSession.Parts.Work displayPart = theSession.Parts.Display theSession.DeleteUndoMark(markId3, Nothing) fileNew1.Destroy() ' ---------------------------------------------- ' Dialogfenster Anfang Schriftfeld ' ---------------------------------------------- Dim drawingSheet1 As Drawings.DrawingSheet = CType(workPart.DrawingSheets.FindObject("Blatt_1"), Drawings.DrawingSheet) drawingSheet1.Open() ' ---------------------------------------------- ' Menü: Anwendung->PMI ' ---------------------------------------------- Dim markId4 As Session.UndoMarkId markId4 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Enter Drafting") ' ---------------------------------------------- ' Menü: Anwendung->Modeling... ' ---------------------------------------------- ' ---------------------------------------------- ' Menü: Anwendung->PMI ' ---------------------------------------------- Dim markId5 As Session.UndoMarkId markId5 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Enter Modeling") ' ---------------------------------------------- ' Menü: Baugruppen->Replace Reference Set... ' ---------------------------------------------- Dim markId6 As Session.UndoMarkId markId6 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Start") theSession.SetUndoMarkName(markId6, "Class Selection Dialogfenster") Dim markId7 As Session.UndoMarkId markId7 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Class Selection") theSession.DeleteUndoMark(markId7, Nothing) theSession.SetUndoMarkName(markId6, "Class Selection") theSession.DeleteUndoMark(markId6, Nothing) ' ---------------------------------------------- ' Dialogfenster Anfang Reference Set ersetzen ' ---------------------------------------------- Dim markId8 As Session.UndoMarkId markId8 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Replace Reference Set") Dim components1(0) As Assemblies.Component Dim component1 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("COMPONENT versuch 1"), Assemblies.Component) components1(0) = component1 Dim errorList1 As ErrorList errorList1 = workPart.ComponentAssembly.ReplaceReferenceSetInOwners("ASTRALONE", components1) errorList1.Dispose() ' ---------------------------------------------- ' Menü: Anwendung->Drafting... ' ---------------------------------------------- drawingSheet1.Open() ' ---------------------------------------------- ' Menü: Anwendung->PMI ' ---------------------------------------------- Dim markId9 As Session.UndoMarkId markId9 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Enter Drafting") ' ---------------------------------------------- ' Menü: Werkzeuge->Journal->Stop Recording ' ---------------------------------------------- End Sub End Module