Hallo,
die Methode die du suchst ist .FindObject. So gehts:
Language="VBSCRIPT"
Sub CATMain()
Dim InputObjectType(0)
Dim Status
Dim oSelection
If Not TypeName(CATIA.ActiveDocument) = "ProductDocument" Then
MsgBox "No .CATProduct loaded", 48, "Error"
Exit Sub
End if
Set oSelection = CATIA.ActiveDocument.Selection
InputObjectType(0) = "Line" '---nur Fläche auswählbar
Status = oSelection.SelectElement2(InputObjectType, "XXXXX Select a Line XXXXX", False) '--- UserSel
If (Status <> "Normal") Then '-------Auswahl i.O?
MsgBox "Abort" '--- nein
Exit sub
Else '------- ...wenn ja, dann...
Set oSelectedElement = oSelection.FindObject("CATIAProduct")
oSelection.Clear
oSelection.EndSelectElement
Set oDoc = oSelectedElement.ReferenceProduct.Parent
MsgBox oDoc.Name, 64, "PartDocument of Selected Feature"
End If
End Sub
Gruss TomTom
------------------
tomtom1972
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP