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 markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Set Assembly Arrangement") Dim arrangement1 As Assemblies.Arrangement = CType(workPart.ComponentAssembly.Arrangements.FindObject("AZ_0_EL_0"), Assemblies.Arrangement) workPart.ComponentAssembly.RootComponent.SetUsedArrangement(arrangement1) Dim markId2 As Session.UndoMarkId markId2 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Replace Reference Set") Dim components1(3) As Assemblies.Component Dim component1 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("Teil 1"), Assemblies.Component) components1(0) = component1 Dim component2 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("Teil 2"), Assemblies.Component) components1(1) = component2 Dim component3 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("Teil 3"), Assemblies.Component) components1(2) = component3 Dim component4 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("Lichtstrahl"), Assemblies.Component) components1(3) = component4 Dim errorList1 As ErrorList errorList1 = workPart.ComponentAssembly.ReplaceReferenceSetInOwners("Entire Part", components1) errorList1.Dispose() '######## ALLGEMEINE VARIABLEN-EINFÜHRUNG #### Dim expression1 As Expression = CType(workPart.Expressions.FindObject("Azimuth"), Expression) Dim expression2 As Expression = CType(workPart.Expressions.FindObject("Elevation"), Expression) Dim unit1 As Unit = CType(workPart.UnitCollection.FindObject("Degrees"), Unit) Dim i As Integer = 0 Dim AZ (2) Dim EL (2) AZ(0) = "-130.60" AZ(1) = "-128.62" AZ(2) = "-121.18" EL(0) = "112.38" EL(1) = "111.71" EL(2) = "108.98" For i=0 To AZ.GetUpperBound(0) Dim markId3 As Session.UndoMarkId markId3 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Expression") workPart.Expressions.EditWithUnits(expression1, unit1, AZ(i)) workPart.Expressions.EditWithUnits(expression2, unit1, EL(i)) ' --> --> HIER SOLLTE "Lichtstrahl" JEWEILS KOPIERT WERDEN <-- <-- Dim nErrs1 As Integer nErrs1 = theSession.UpdateManager.DoUpdate(markId3) Next End Sub End Module