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 automation - macro for renaming 1

Status
Not open for further replies.

boiboi

New member
Apr 25, 2013
1
0
0
FR
Hi there,

I'm trying to manage to uderstand how catvba works with the follinwg example.

I'm trying to do following action with a macro

[ul]
[li]open all catproduct in a folder[/li]
[li]for each product :
- get revision number of each catpart
- append revision number to partnumber and instance number
- save as in output folder and rename all catpart and catproduct with "partname_revision.CATPart"
[/li]
[/ul]

Actually i'm stuck at the very first beginning :
how to get revison number from part properties ?

some help will be really appreciated
 
Replies continue below

Recommended for you

boiboi said:
how to get revison number from part properties ?

one simple example..

Code:
Set productRoot = CATIA.ActiveDocument.Product
Set UserProps = productRoot.Products
Part_Revision = UserProps.Item(1).Revision

Just iterate on all parts..


boiboi said:
save as in output folder and rename all catpart and catproduct with "partname_revision.CATPart"

You can use CATIA Send To Service

______

Alex ,
 

I'm trying to manage to uderstand how catvba works with the follinwg example.

I'm trying to do following action with a macro



learn VBA first, there are many books for Office VBA. that way you will understand what are objects, core of the language and get some experience in reading the developer documentation and programming macros.
then search for V5Automation.chm in the catia install dir and read it first (not all of course, at least documentation about some relevant tasks to you, but before trying to program anything).
in about 3 months you will be well on the way like this.
on the other hand, if you only need something fast (auto populate as mentioned for example), just look for it in this forum, it's one of those tasks, that have been discussed 432898 times already.
 
Status
Not open for further replies.
Back
Top