Make Catia command wait for user interaction.
Make Catia command wait for user interaction.
(OP)
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
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





RE: Make Catia command wait for user interaction.
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 --> VBA
Dim nbOfFeatureInBody As Integer nbOfFeatureInBody = partDoc.Part.Bodies.Item(1).Shapes.Count CATIA.StartCommand ("Hole") While partDoc.Part.Bodies.Item(1).Shapes.Count = nbOfFeatureInBody WendProblem 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 ?
indocti discant et ament meminisse periti
RE: Make Catia command wait for user interaction.
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
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Make Catia command wait for user interaction.
And here is a screen capture.
Link
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Make Catia command wait for user interaction.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU