I am trying to create a macro that copies and pastes a drawing component from the background view to another view. So far I've tried this (not written perfectly, written for readability):
Dim bubble as DrawingComponent
Set bubble = CATIA.ActiveDocument.Views....Components.Item('Bubble1')
Dim viewToPasteInto as DrawingView
Set viewToPasteInto = CATIA.ActiveDocument....
Dim sel as Selection
Set sel as CATIA.ActiveDocument.Selection
sel.Clear
sel.Add bubble
viewToPasteInto.Activate()
sel.Paste
The macro pastes the bubble, but not in the desired view. It will paste the bubble in the original view: the background view. For some reason, sending the windows key command CTRL+V in subsitute of sel.Paste will give the desired outcome. That is,
Dim bubble as DrawingComponent
Set bubble = CATIA.ActiveDocument.Views....Components.Item('Bubble1')
Dim viewToPasteInto as DrawingView
Set viewToPasteInto = CATIA.ActiveDocument....
Dim sel as Selection
Set sel as CATIA.ActiveDocument.Selection
sel.Clear
sel.Add bubble
viewToPasteInto.Activate()
' press CTRL+v
I've tried using PasteSpecial with all of the input parameters possible but nothing.
Dim bubble as DrawingComponent
Set bubble = CATIA.ActiveDocument.Views....Components.Item('Bubble1')
Dim viewToPasteInto as DrawingView
Set viewToPasteInto = CATIA.ActiveDocument....
Dim sel as Selection
Set sel as CATIA.ActiveDocument.Selection
sel.Clear
sel.Add bubble
viewToPasteInto.Activate()
sel.Paste
The macro pastes the bubble, but not in the desired view. It will paste the bubble in the original view: the background view. For some reason, sending the windows key command CTRL+V in subsitute of sel.Paste will give the desired outcome. That is,
Dim bubble as DrawingComponent
Set bubble = CATIA.ActiveDocument.Views....Components.Item('Bubble1')
Dim viewToPasteInto as DrawingView
Set viewToPasteInto = CATIA.ActiveDocument....
Dim sel as Selection
Set sel as CATIA.ActiveDocument.Selection
sel.Clear
sel.Add bubble
viewToPasteInto.Activate()
' press CTRL+v
I've tried using PasteSpecial with all of the input parameters possible but nothing.