Retrieve part of the SmartProperties document name

Hello

My Solidworks document names are in the form 1_2_3_4. All words are separated by a _.

I would like to retrieve the string 2_3 (in the example) using a property,  i.e. delete the first and last word. Knowing that the name of my document is composed of a variable number of words: 1_2_3_4_5 or 1_2_3_4_5_6 or etc...

Do you have an idea?

Kind regards

You have to try with the string option by taking the option recover characters up to n starting and then the split option.

On the other hand, as you have several separators to get your new property, you may have to do it in several steps.

Do a few tests on documents you create and see what happens as you go along.

But in the idea I think you have to use a split for field 2, another for field 3 and you concatenate everything.

Unless you manage to do it in one step

1 Like

Hello

Use 2 strings with the Split option and then a concatenation, I made you a Word file with screenshots.

Have a nice day

Mick


param_smart.docx
2 Likes

Apparently, @sbadenis was quicker :)

I had thought about it unfortunately since my word count is variable, it's complicated.

Because in my example 1_2_3_4 I still have to take into account the eventality or it would be 1_2_3_4_5.

So I would have to do 3 split functions (for 2, for 3 and for 4) but if I reuse SmartProperties for a room in 1_2_3_4, the 4 would be taken into account in my concatenation.

In this case instead of spit you take the function at the beginning instead of split and then the function at the end.

what gives function to the beginning excludes you the beginning up to  _

1_2_3_4_5_6

which gives 2_3_4_5_6

then at the end

which gives

2_3_4_5 or 2_3 for example 1_2_3_4

With at the beginning or at the end, he comes to look for what is before or after the first chosen character he encounters:

so for 1_2_3_4_5

at the beginning 1_

at the end _2_3_4_5

1 Like

Effectively after trying it takes into account the 1st separator the one just after the 1 in any case.

I am afraid that there is no working solution at the moment.

On the other hand, in any case, you make a request to the hotline via a ticket so if there is no solution, a request for improvement could be made.

 

Finally, there will be the macro solution that launches into the smart via execute for example but now I can't help you in vba anymore!

Okay, thank you anyway for your answers!