Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.


Register Today
COE 2009 Annual PLM Conference & TechniFair

COE DISCUSSION FORUM
Subject: Selection.PasteSpecial method does not work?

You are not authorized to post a reply.   
Page 1 of 212 > >>
Author Messages
COE-FORUM-USER

31 Aug 2001 02:06 PM
The code below shows my attempt to perform a "Copy - Paste Special As Result WIth Link"
operation in Visual Basic. It is coded according to the documentation for the Catia Selection object class.
Everything runs without errors, and the surface is selected, the new body is created, but no copy is created.

If I replace this line:

Pick.PasteSpecial ("AsResultWithLink")

with this line:

Pick.Paste

then a copy is created, but not one with a link back to the original.

Has anybody tried this, or does anyone have a suggestion? I'm running V5R7.

Thanks!
Don Hinson

------------------------------------------------------------------------------------------------------
Private Sub cmdCopyPaste_Click()
Dim Pick As Selection
Dim NewBody As HybridBody

Set Pick = CATIA.ActiveDocument.Selection
'Find the surface called CopyMe
Pick.Search "'Part Design'.Surface.Name=CopyMe,all"

'Copy the surface to the clipboard
Pick.Copy

'create a new openBody
Set NewBody = CATIA.ActiveDocument.Part.HybridBodies.Add()
CATIA.ActiveDocument.Part.Update
'name the OpenBody
NewBody.name = "CopyBody"

'make the new body the in-work object
CATIA.ActiveDocument.Part.InWorkObject = NewBody

'select the new body
Pick.Search "'Part Design'.OpenBody.Name=CopyBody,all"

'Pick.Paste works, but
'Pick.PasteSpecial ("AsResultWithLink") does nothing
Pick.PasteSpecial ("AsResultWithLink")
CATIA.ActiveDocument.Part.Update
End Sub
------------------------------------------------------------------------------------------------

Author: Donald J. Hinson
You are not authorized to post a reply.
Page 1 of 212 > >>

Forums > COE Forums > CATIA V5 > Selection.PasteSpecial method does not work?



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)