REVIT-DYANAMO Replace the last string with another, in the family name

Good afternoon to the community.

I am writing to ask for your help, I am generating a definition that replaces the last words in the names of the families, I am using another as a base, which replaces the first letters.

Here is the problem, I did the test with the node of String.Rempace but everything that is similar to the condition replaces me. I tried the String.Remove node but when joining them it does not remove the condition.

I hope you can help me and thank you very much in advance.

You haven’t shown what you’re providing the nodes, only their outputs. We need to see what you’re actually doing as well as an example of your intended output.

One option might be to use String.Split if the suffix follows a known “separation” character. Then just replace the string at the last index.

Upgrade to a full image of the routine.

Regarding your recommendation to use the String.Split node, arbitrarily split the name as shown in the image. What you would need is for you to divide it by the last digit to its left.

Correct. That’s what I meant by a “separation” character. If your naming convention is prefix-name-suffix then you can split the string by "-" to get the individual parts of the naming convention.

You just need to really think about how your names are defined and how much of that you can reliably trust. If you’re trying to replace the ".60" at the end of the string and you know it’s always part of a dimension matching A x B then use "x .60" or even " .60" instead. Make the string match your format.