Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA Script to automate Frame and Title Block Update 1

Status
Not open for further replies.

Arpad_Jacso

Computer
Aug 22, 2019
14
0
0
HU
Hi all,

I would like to automate the frame and Title block Update command for hundreds of drawings. Open drawings, run update, save, close.
I tried sendkeys through vbs, or inside the catvba but it doesn't seem the good solution even with sleep or doevents or anything i found on google.

I could update in command line with c:Update (activated sheet background and updated the title block) but only once.... never again.... I don't know how is it possible

Has anyone solution for this?
 
Replies continue below

Recommended for you

I managed to update the part name, the weight, and the designer.
The problem is to update the BOM list. It takes time to update, but the program doesn't want to wait for it, and goes to the next command line. I would like to place the BOM update in a cycle, but now it seems impossible. How could I force to wait for it? If I use sleep, than the sleep runs before the call and even before the open...... anyway this should not be the proper way

Here is the part of the code. The BOM_H creates or updates the specific BOM list in the background view, it takes ~20seconds to update.

For i = 1 To CATIA.Windows.Count
Set productDocument1 = documents1.Open(Location + DocName(i))
CATIA.StartCommand ("BOM_H")
Sleep 20000
CATIA.ActiveDocument.ExportData Location + DocName(i), "pdf"
CATIA.ActiveDocument.ExportData Location + DocName(i), "dwg"
CATIA.ActiveDocument.Save
CATIA.ActiveDocument.Close
Next
 
Status
Not open for further replies.
Back
Top