hello Ferdo, could you please see t
hello Ferdo, could you please see t
(OP)
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 --> 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
Call objBlubb.SelectElement3(Array("HybridBody", "Body"), "SELECT BODIES & GEO SETS TO PASTE IN NEW FILE", False, CATMultiSelTriggWhenUserValidatesSelection, True)
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 




RE: hello Ferdo, could you please see t
Did you checked in Tools-References in VBA editor what you have in one CATIA version and not in other one ?
This could be one of the reasons why is not working....and by the way, which is the error message ?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: hello Ferdo, could you please see t
there were 2 of them unchecked in v18 comparing to R20.. I did checked them. Please attached image...
and below code suppose to ask user to select bodies. This does not do anything in R18 for some reason..
CODE --> code
Call objBlubb.SelectElement3(Array("HybridBody", "Body"), "SELECT BODIES & GEO SETS TO PASTE IN NEW FILE", False, CATMultiSelTriggWhenUserValidatesSelection, True)thanks
appvid
RE: hello Ferdo, could you please see t
RE: hello Ferdo, could you please see t
In the error message is saying that a library is missing.
Please scroll up/down in Tools-References and look at all libraries and uncheck where you will see Missing....
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: hello Ferdo, could you please see t
Now the problem is with this code
says can not load dll file.
CODE --> code
Call objBlubb.SelectElement3(Array("HybridBody", "Body"), "SELECT BODIES & GEO SETS TO PASTE IN NEW FILE", False, CATMultiSelTriggWhenUserValidatesSelection, True)why so...
regards
RE: hello Ferdo, could you please see t
this code works
CODE --> code
const CATMultiSelTriggWhenUserValidatesSelection=2 oSel = objBlubb.SelectElement3(Array("HybridBody", "Body"), "SELECT BODIES & GEO SETS TO PASTE IN NEW FILE", False, 2, True)I know the problem now. I need to declare every object
example (Dim objSel as Objec, Dim Filename as Integer)
and
I'm using Mid, Replace in my code to change file name. How do I declare them?? Any Idea
thanks
Appvid
RE: hello Ferdo, could you please see t
You don't need to declare.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208