Dim drawingDocument1111 As DrawingDocument
Set drawingDocument1111 = CATIA.ActiveDocument
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim drawingDocument1 As DrawingDocument
If comZeichn_rah_groes.Text = "A0" Then
Set drawingDocument1 = documents1.Open("C:\temp\A0.CATDrawing")
Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection
selection1.Search "Type=*Line*,all"
If (selection1.Count2 > 0) Then
selection1.Copy
Else
MsgBox ("Keine Elemente zum Kopieren!")
End If
'Leeres Blatt aktivieren
'------------------------
Dim qwer As Selection
Set qwer = drawingDocument1111.Selection
drawingDocument1111.Activate
Set oDraw_a = CATIA.ActiveDocument 'Zeichnung als aktives Dokument bestimmen
Set oSheets_a = oDraw_a.Sheets
Set oSheet_a = oSheets_a.ActiveSheet
oSheet_a.Activate
Set oViews_a = oSheet_a.Views
oSheet_a.Views.Item(2).Activate ' BLATT001 aktivieren
Set oView_a = oViews_a.Item(2)
oView_a.Activate
Set drawingDocument2 = CATIA.ActiveDocument
Dim selection5 As Selection
Set selection5 = drawingDocument2.Selection
selection5.Paste <---------- Hier bricht das Programm ab
Elemente werden kopiert, aber beim Einfügen bricht es hier ab, mit der Fehlermeldung:
Laufzeitfehler '-2147467259 (80004005)':
The CSO ist empty. The PasteSpecial operation could not be performed.
ich habe auch so versucht:
selection5.PasteSpezial ""
geht leider auch nicht.
Könntest Du mir bitte hier weiterhelfen ?
Danke schön!
------------------
Schöne Grüße
Feyza : )
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP