Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Macro: Waiting for CATIA to finish commands

Status
Not open for further replies.

xgibbousx

Aerospace
Jul 3, 2007
5
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?
 
Replies continue below

Recommended for you

Which assemble command?
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
 
Yes, I am using Part Design > Boolean operations > Assemble.
 
xgibbousx,

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
 
Hey Nev,

That worked really great. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor