Sub CATMain() Dim anzahl As Integer Dim durchlaeufe As Integer Dim dateien As String dateien = "" anzahl = InputBox("Bitte die Anzahl der auszuspielenden Objekte eingeben: ", "Anzahl") Datum = Right(Date, 2) & Mid(Date, 4, 2) & Left(Date, 2) & "_" Dim oPartDoc1 As Document Set oPartDoc1 = CATIA.ActiveDocument Dim selection1 As Selection Set selection1 = oPartDoc1.Selection Dim visPropertySet1 As VisPropertySet Set visPropertySet1 = selection1.VisProperties Dim part1 As Part Set part1 = oPartDoc1.Part ordner = oPartDoc1.Path & "\" For durchlaeufe = 1 To anzahl ' Was selectiert werden soll Dim E 'As Object CATBSTR Dim Was(0) Was(0) = "HybridShape" ' Vorhandene Selektion leeren 'Dim UserSel As Object Set usersel1 = oPartDoc1.Selection usersel1.Clear E = usersel1.SelectElement2(Was, "Bitte Objekt wählen", True) Set ohybridshape = usersel1.Item(1).Value Set test = usersel1.Item(1) 'MsgBox "Folgendes Element wurde selektiert : " & ohybridshape.Name ' Test weil Was(0) vorher AnyObject war und das dann nur richtig aus dem Baum angezeigt wurde, sonst Refernce... 'Original Recorderaufnahme 'Show Object 'Dim hybridShapeLinePtDir1 As HybridShapeLinePtDir 'Set hybridShapeLinePtDir1 = hybridShapes1.Item("Line.1") 'Set hybridShapes1 = hybridShapeLinePtDir1.Parent 'Dim bSTR4 As String 'bSTR4 = hybridShapeLinePtDir1.Name 'selection1.Add hybridShapeLinePtDir1 'Hideshow vorbereitung selection1.Add ohybridshape Set visPropertySet1 = visPropertySet1.Parent Dim bSTR5 As String bSTR5 = visPropertySet1.Name Dim bSTR6 As String bSTR6 = visPropertySet1.Name visPropertySet1.SetShow 0 selection1.Clear oPartDoc1.ExportData ordner & Datum & ohybridshape.Name & ".igs", "igs" selection1.Add ohybridshape visPropertySet1.SetShow 1 selection1.Clear dateien = dateien & vbLf & vbLf & Datum & ohybridshape.Name & ".igs" Next MsgBox "Objekt(e) wurde(n) als Datei(en) : " & dateien & vbLf & vbLf & "im Ordner : < " & ordner & " > erstellt" End Sub