×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Make Catia command wait for user interaction.

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

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
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

RE: Make Catia command wait for user interaction.

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

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources