appvid
Automotive
- Nov 9, 2012
- 81
hello Ferdo, could you please see this and let me know why this code does not work on R18. works great on R20..
highlighted in red is what failing when debugging--thank you
highlighted in red is what failing when debugging--thank you
Code:
Sub xpart()
'----------------------
'Dim documents1 As Documents
'Set documents1 = CATIA.Documents
Dim partDocument2 As PartDocument
Dim PartDoc1 As Part
Dim selWork As INFITF.Selection
Dim objBlubb As Object
On Error Resume Next
Set PartDoc1 = CATIA.ActiveDocument.Part
If Err.Number <> 0 Then
MsgBox ("Open Catia file to generate X FILE")
Exit Sub
End If
Set selWork = CATIA.ActiveDocument.Selection
Set objBlubb = selWork
[COLOR=#EF2929][b]Call objBlubb.SelectElement3(Array("HybridBody", "Body"), "SELECT BODIES & GEO SETS TO PASTE IN NEW FILE", False, CATMultiSelTriggWhenUserValidatesSelection, True)[/b][/color]
selWork.Copy
Dim documents2 As Documents
Set documents2 = CATIA.Documents
Set partDocument2 = CATIA.Documents.add("Part")
Dim part2 As Part
Set part2 = partDocument2.Part
Set selWork = partDocument2.Selection
selWork.add part2
Call selWork.PasteSpecial("CATPrtResultWithOutLink")
selWork.Clear
End Sub