Hello,
I made an automation that work fine on Windows 10.
When I put it on Windows 7 or Windows 2012. (they both have framework higher that 4.5.2 installed)
I get the following exception when doing Marshal.GetActiveObject("CATIA.Application");
Exception:
Unhandled Exception...
Hello Alan,
Would GetUpdateStamp() on CATISpecObject what you need?
Go through all the parts. Cast them to CATISpecObject and try GetUpdateStamp().
I'm not giving more detail as this is CAA and I don't know if you asking in CAA or Automation?
Talou;
One workaround:
From CAA --> Call CATScriptUtilities::ExecuteScript(Launcher.catvbs)
and from Launcher.catvbs call -> CATIA.SystemService.ExecuteBackgroundProcessus(Automation.exe)
Then it come back to CAA and when the CAA command finish, the Automation.exe start.
The down side is no error...
Hello,
The I need to call "Delete Useless Elements" command in Catia.
From CAA, I could call it with CATAfrStartCommand.
But how to click the “OK” button on the dialog that appear?
Tks,
Talou;
Hello,
I build a Catia command in CAA.
In the CAA code, I reorganize the Geometrical Set. (that work fine)
The I need to call Delete Useless Elements. I could call the Catia command “Delete Useless Elements” with CATAfrStartCommand. But I didn’t know how to click the “OK” button on the...
And now, here is the answer of the question I had for that thread:
The real question was how to know if the user selected the Part itself or the Document under the part.
The following function will return an object on the Document, whatever the selection made by the user.
Thanks Tesak, the key...
Thank you LWolf!
Why do I suck so much at this!
I tried to feed the selection1.Add with PartDocument, ProductDocument, Document... Nothing was working.
When I'm reading the doc; I'm still confuse between CATIAPartDocument (which I guess it the .Part) and PartDocument which is something else...
Hello,
New question, new thread...
I want to launch the command "Delete Useless Elements" which is in the "Part Design" workbench.
In the following pic. We can see that the user selected the Document. However, the active object is a product. Therefore we are on the "Assembly" workbench...
Hello Tesak,
I need your help again.
In the following simple assembly. If the user select the Document, the workbench "Assembly" is still active as the user didn't double click on the document.
Therefore it failed when I try to launch the command "Delete Useless Elements" which belong to the...
By the way Tesak, I LOVED the post you provide for Product reordering in CATIA V5 VBA.
https://www.eng-tips.com/viewthread.cfm?qid=445034
That what made me start writing in VB.net.
I think it would be better for me to go with CSharp. I have code example on other framework that I will probably...
There is something weird with my object...
If I do File, New Product and New Part and use the code on those. Then the code works.
But if I use it on the object on which I need to work on. It's doing that error.
On these, it's works:
On these, it's not working:
Some_Part_3 seem standard...
Hello tesak,
tks again for helping.
I'm getting the following error when I run the code:
An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll
Additional information: Public member 'ReferenceProduct' on type 'Part' not found.
on the line:
Dim...
Hello,
I would like to know if the user selected the Part or the Product.
To go around the problem, I cast the object into a Part and if it’s fail I suppose I’m on the Product and I cast to the Product.
I would prefer to find what object I’m on before casting it.
Thank you,
Vincent...
Hello Tesak,
Nice! That allowed me to connect some dot in my head.
I found the objects I need in the object browser and I can see from there which lib/tlb that I need to add my project references.
I'm able to build and execute.
But I don't get theses dll. Would you know how they get built...
Hello,
I have to do some automation in VBA or VB.Net as there is not CAA API for the commands I want to use.
One of them is "Delete Useless Elements" (in Tools, when you are in the Part Design Workbench)
I found a thread where they speaking about Product reordering in CATIA V5 VBA.
"itsmyjob"...