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!

Macro to rename instances

Status
Not open for further replies.

150222

Mechanical
Oct 2, 2009
2
CA
Hello,

I have found in a thread a macro to rename the instances with the part number in Catia V5 that seems to be exactly what i want to do but i get an error when i try to run it.
i get a message saying CATSripErrorMessages - Scripting ERR_1002
Execute the script name of my script .catvbs.

Source: Microsoft VBScript compilation error
Description'Expected end of statement
Statement :Dim Docs As Documents
Line 2
Column 9

We use Catis V5 R20 on window 10
i am not experimented with macros. Any help would be apprecated.
 
Replies continue below

Recommended for you

Hi,
In vb scripts it is not allowed to use variable types declaration as all variables are variants. I think you have to launch this macro in VBA,
or maybe try to save it as .catscript where "As" clauses are just being ignored.

Other option is to uncomment or delete all "As" statements in your code and instead of

Dim Docs As Documents

just use

Dim Docs

Tesak

Tesak
- Play Tetris in CATIA V5 drawing
 
Good morning Tesak,

Thank you very much for taking the time to reply. I saved the macro .catscript and it worked.
Trully appreciate your help.


Regards

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top