'Sub CATMain ( ) Dim Datei As CATBSTR Dim ADoc1 As Document Datei = CATIA.FileSelectionBox ("Datei öffnen" , "*.CATDrawing", CATFileSelectionModeOpen) If Datei <> " " Then Set ADoc1 = CATIA.Documents.Open ( Datei ) Dim ADoc2 As Document Datei = CATIA.FileSelectionBox ("Datei öffnen" , "*.CATDrawing", CATFileSelectionModeOpen) If Datei <> " " Then Set ADoc2 = CATIA.Documents.Open ( Datei ) Dim StrParam1 As StrParam Set StrParam = parameters1.Item ("Source") ' Dim Value As String ( 2 ) 'Source.Value = Drawing 'Target.Value = Drawing Sub CATMain(Source, Target) Dim oDrawingSource As DrawingDocument Set oDrawingSource = oDrawingSource.Value ' Fit in window the opened document CATIA.ActiveWindow.ActiveViewer.Reframe ' Retrieve the sheet containing the view to be duplicated Dim oSheetSource As DrawingSheet Set oSheetSource = oDrawingSource.Sheets.Item("Sheet.1") ' Retrieve the view to be duplicated Dim oViewSource As DrawingView Set oViewSource = oSheetSource.Views.Item("Front view") ' Create an object of selection for the source document Dim oSelectionSource As Selection Set oSelectionSource = oDrawingSource.Selection ' Clear the selection oSelectionSource.Clear ' Add the view to be duplicated in the selection oSelectionSource.Add oViewSource ' Copy the view oSelectionSource.Copy ' Clear the selection oSelectionSource.Clear ' Create the Drawing document where the view will be pasted Dim oDrawingTarget As DrawingDocument Set oDrawingTarget = oDrawingTarget.Value ' Retrieve the where the view will be pasted Dim oSheetTarget As DrawingSheet Set oSheetTarget = oDrawingTarget.Sheets.Item("Sheet.1") ' Set the sheet paper size 'oSheetTarget.PaperSize = catPaperA0 ' Create an object of selection for the source document Dim oSelectionTarget As Selection Set oSelectionTarget = oDrawingTarget.Selection ' Clear the selection oSelectionTarget.Clear ' Add the sheet where the view will be pasted in the selection oSelectionTarget.Add oSheetTarget ' Paste the clipboard oSelectionTarget.Paste ' Clear the selection oSelectionTarget.Clear ' Fit in window the active document CATIA.ActiveWindow.ActiveViewer.Reframe ' Clear the variables Set oSelectionTarget = Nothing Set oSheetTarget = Nothing Set oDrawingTarget = Nothing Set oSelectionSource = Nothing Set oViewSource = Nothing Set oSelectionSource = Nothing Set oDrawingSource = Nothing End Sub