Auto rename features

Is there an easy way to auto rename a feature based on the sketch name, or vice versa, the sketch name based on the feature ?

(Appending an "S" on the sketch to discriminate)

Also, and more important, is there a way to make the feature name itself based, for example, on the most prominent characteristics of the sketch ?

Let me give examples:

A cylinder of 10 Diameter and 50 length would be auto named like D10L50Cyl

A rectangle of 10x20x50 would be auto named like A10B20H50Rect

And more:

A 10mm offset of the front datum plane could be named F10

And so on...

SolidworksParts And Features
Answers 8
DB
DB 2017-07-08 Best Answer

I dare say you would be looking at a macro or something to do this Lucas.

Have you tried using the magnifying glass (top right corner) and searching the forum to see if there is already one created because somebody has posed the same question before?

Dave.

LS
LS 2017-07-08

Yes. Macro serves

Where do I begin ?

Is it macro buggy or consistent ?

Can you sketch an approach or backbone that I could use to develop the macro ? I'll learn the rest

And no, there's no similar question on the whole forum or google.

Surprising that no one else had this issue before

As I type the title of the question, suggestions are shown. Neither even tangentiate the question

JS
JS 2017-07-08

​

For future searches take a look here https://forum.solidworks.com/thread/208328#760492 first and download the excel file to match (which in your case is Macros) and using excel find you should be able to find a similar post in a few minutes..

Take a look here

https://forum.solidworks.com/message/196380#comment-196380

comment imagecomment image
LS
LS 2017-07-16

Two helpful tips

I've followed the comments in there and absorbed what I could, but I wonder if maybe someone has a closer to this case answer

Cause non object oriented C is a walk in the park close to these macros

Thank you so far

LS
LS 2017-07-16

Some people really like coding. I'm on the opposite side, with the job not leaving me with time and brain to learn new stuff, like macros

If someone could make this favor, or even half of it, I'll buy a beer

(In heaven, of course. Very likely the helpful person will live on the other side of the world)

DB
DB 2017-07-16

Don't look at me, wouldn't know where to start!...........

Dave.

LS
LS 2017-07-16

Forgiven. I know the feeling...

CC
CC 2017-07-17

I'd avoid using auto-rename feature because you'll end up spend more time to fix it

<span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-size: 14px;">Is there an easy way to auto rename a feature based on the sketch name, or vice versa, the sketch name based on the feature ?</span>

what happens if a sketch is shared with more than one feature? the program will crash or you can alternatively add prefix/suffix to the features which will be confused since a boss and a hole will be the same name with a prefix or suffix

<p style="font-size: 14px; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; color: #333333;">Also, and more important, is there a way to make the feature name itself based, for example, on the most prominent characteristics of the sketch ?</p><p style="font-size: 14px; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; color: #333333;">Let me give examples:</p><p></p><p style="font-size: 14px; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; color: #333333;">A cylinder of 10 Diameter and 50 length would be auto named like <span style="font-weight: inherit; font-family: inherit; font-style: inherit;"><em>D10L50Cyl</em></span></p><p style="font-size: 14px; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; color: #333333;">A rectangle of 10x20x50 would be auto named like <span style="font-weight: inherit; font-family: inherit; font-style: inherit;"><em>A10B20H50Rect</em></span></p>

There are few ways to model a cylinder, it can be a circle with an extrude, or a rectangle with revolve or two circle with sweep. which one you pick for your cylinder? For consistency, you're tied up with one way to model a cylinder

Who would want to sit down, write a program and provide many options then the users have to do all kind of setup to auto-rename features right?

<span style="color: #333333; font-family: Verdana, 'Verdana Ref', Geneva, Tahoma, sans-serif; font-size: 14px;">And so on...</span>

More time than just manually rename the features