VBA Macro: Waiting for CATIA to finish commands
VBA Macro: Waiting for CATIA to finish commands
(OP)
Hey everybody,
I'm writing a macro that uses the "assemble" command, and it requires me to sendkeys to CATIA, since assemble always brings up a dialog box. I'm calling a .vbs to do the sendkeys, since sendkeys doesn't work in the .catvba. The problem is, when I use assemble, the command takes quite a while to execute. Unfortunately, the .vbs continues to send commands to CATIA, so many of the sendkeys aren't received while assemble is running. I used a pause for a set amount of time, which works, but it seems like a very inefficient and sloppy way to do this. Is there any way to somehow determine if CATIA is finished executing its commands? Is there anyway to call another CATIA vba, or somehow make the vba wait for the vbs to finish?
I'm writing a macro that uses the "assemble" command, and it requires me to sendkeys to CATIA, since assemble always brings up a dialog box. I'm calling a .vbs to do the sendkeys, since sendkeys doesn't work in the .catvba. The problem is, when I use assemble, the command takes quite a while to execute. Unfortunately, the .vbs continues to send commands to CATIA, so many of the sendkeys aren't received while assemble is running. I used a pause for a set amount of time, which works, but it seems like a very inefficient and sloppy way to do this. Is there any way to somehow determine if CATIA is finished executing its commands? Is there anyway to call another CATIA vba, or somehow make the vba wait for the vbs to finish?





RE: VBA Macro: Waiting for CATIA to finish commands
Part Design>Boolean operations> Assemble?
If so you can code this without send keys
Otherwise
Could you not analyse the CNEXT procees to determine its load?
Regards
Nev
RE: VBA Macro: Waiting for CATIA to finish commands
There is a very good software which will allow you to control in what way you want all processes in your computer (available under Windows OS).
Please see the link http://
Regards
Fernando
RE: VBA Macro: Waiting for CATIA to finish commands
RE: VBA Macro: Waiting for CATIA to finish commands
Then I assume you are used the following code
CATIA.StartCommand("Assemble")
This is the only way that send keys would be needed.
I would use the follow method to complete avoid the use of sendkeys
AddNewAssemble( CATIABody iBodyToAssemble) As CATIAAssemble
Regards
Nev
RE: VBA Macro: Waiting for CATIA to finish commands
That worked really great. Thanks for your help.