Automatically rename planes, points, or surfaces

Hello

 

I'm looking for a macro (or other) that would allow you to rename certain functions (planes, points, surfaces, sketches, axes and coordinate systems) so that all models have identical design trees for these functions.

for example, the sketches should be called: ESQ_XXX; surfaces: SRF_XXX etc.

I did some research but without success

Do you have a real interest in doing this?

This is possible by macro but quite complicated to make and then to implement in each room, where is my request a real interest?

2 Likes

It is indeed possible, in my opinion you have to go through a search for sketches, plans, etc. and to rename them in order by ESQ_XXX.

But it may be laborious as a job and as sbadenis says, what's the point?

3 Likes

Hello, the goal is to standardize the designs so that anyone can find their way around.

moreover, going through templates in order to just rename these functions by hand is rather long

It is true that we can do without. My colleagues don't necessarily rename their functions and since I have to make sure that the designs are "harmonized", I would like to make it easier for them and speed up the process of validating our designs (and the names of the functions are part of that).

And I have a lot of functions that potentially need to be renamed. A macro could indeed help reduce errors.


arbre.png

and it will allow me to put a foot in the macros while waiting for a training...

Here's a macro that resets the design tree counters

 


reset_compteur_plan_esquisse.swp
2 Likes

and another to rename the sketches.

You have to tap the code to enter the desired sketch name


renommage_esquisse.swp
1 Like

Yannick.little one , I think you put the same macro twice.

 

tomalegorgeu it seems complicated to me given the names of the functions, if you want to automate 100% ....

 

For example, if all the files have the same arbo, you can go for a rename according to selection. You select 10 entities in the tree, and you press the macro.

The macro will rename the 1st one. TGT_1

the 2nd TGT_2 

...

 

The problem is that if you make a mistake in your selection, he'll make a mistake too. Is the computer a bit stupid:)

 

I found these two pages that can correlate to your problem with the little research I did.

IFeatureManagerMethods Help API

IFeatureManager NameUsed Help API

 

But you're tackling a big problem to begin with!

3 Likes

Hello

There's a macro that renames all sketches and resets the function counter to 0.

The other can rename all the sketches according to the name put in the macro.

, it seems complicated given your number of criteria.

You have to do a specific development, or  a methodology guide.

 

yannick

It seems impossible to me for someone who starts macros, even I who have already made 10 to 15 would not be able to do it alone.

In addition, if you want to standardize too much, you risk:

- to antagonize your colleagues

- or that it is not respected.

In itself, leaving the proper name of solidworks isn't it already standardized in itself?

Otherwise, to start macros, start with excel macros or start to learn vba if it's not the case, then start with simpler macros to then be able to go upmarket, and why not then, if the need is real, make this macro.

But personally I don't understand the fact that I want to rename sketch 1 in ESQ_XXX especially since method 1 is automatic.