Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Make Catia command wait for user interaction.

Status
Not open for further replies.

luvhagen

Automotive
Jun 11, 2008
2
SE
Hi,
I wounder if anyone knows how to make a Catia command wait for a user interaction.
In the few lines below, the script is supposed to start the Hole-command, and wait until user press OK or Cancle before preceeding to next command "Rectangular Pattern".
Sub CATMain()
CATIA.StartCommand ("Hole")
CATIA.StartCommand ("Rectangular Pattern")
End Sub


Thanks in advance for any answer.
Br
Lennart
 
Replies continue below

Recommended for you


you could check the number of feature in the body before the hole (assuming only 1 body)

then after the hole command, you check if the number of feature changed, if not you loop until it does.

looks like this:

Code:
Dim nbOfFeatureInBody As Integer
nbOfFeatureInBody = partDoc.Part.Bodies.Item(1).Shapes.Count
CATIA.StartCommand ("Hole")
While partDoc.Part.Bodies.Item(1).Shapes.Count = nbOfFeatureInBody
Wend

Problem is that as soon as you select the face for the hole you have a new feature in the body.

Solution is to check for update status and include that in the test of the while loop... Can someone help here ?

Eric N.
indocti discant et ament meminisse periti
 
Hi,

You can do it if you are creating the script in an external application like the hta uploaded by me here (unzip the attachment file and double click on the hta file). I tested with CATIA closed, CATIA will open, a pad will be build and a pop-up message will appear. Behind those small windows (hta app and message pop-up window) CATIA will wait to select a face in order to create a hole. After finishing the hole creation, just click on Wait button and the script will continue with your pattern command.

Regards
Fernando

- Romania
- EU
 
getfile.aspx


And here is a screen capture.

Link

Regards
Fernando

- Romania
- EU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top