Hallo zusammen,
wie kann ich ein Teil im 3D selektieren und dieses dann öffnen - "Make Displayed Part"?
Das folgende Journal habe ich aufgezeichnet.
Vielen Dank Georg
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: Assemblies->Context Control->Set Displayed Part
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Make Displayed Part")
Dim component1 As Assemblies.Component = CType(workPart.ComponentAssembly.RootComponent.FindObject("COMPONENT 122835181350000 1"), Assemblies.Component)
Dim component2 As Assemblies.Component = CType(component1.FindObject("COMPONENT 122835181359999 1"), Assemblies.Component)
Dim component3 As Assemblies.Component = CType(component2.FindObject("COMPONENT 122835181358000 1"), Assemblies.Component)
Dim components1(0) As Assemblies.Component
components1(0) = component3
Dim errorList1 As ErrorList
errorList1 = component3.DisplayComponentsExact(components1)
errorList1.Clear()
Dim part1 As Part = CType(theSession.Parts.FindObject("122835181358000"), Part)
part1.Preferences.Modeling.CutViewUpdateDelayed = True
Dim partLoadStatus1 As PartLoadStatus
Dim status1 As PartCollection.SdpsStatus
status1 = theSession.Parts.SetDisplay(part1, False, True, partLoadStatus1)
workPart = theSession.Parts.Work
displayPart = theSession.Parts.Display
partLoadStatus1.Dispose()
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
End Sub
End Module
[Diese Nachricht wurde von GeorgK am 28. Feb. 2014 editiert.]
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP