Adding a Prefix to the family list in the project browser in Dynamo

#1

Hi All, Im new to Dynamo,

Have learned how to rename families using a script in Dynamo, but now id like to add my company code to the start of each family that doesn’t have anything before it

for instance before to rename the family i used a script to change

“GCD_ SURVEY_ Basic Wall” to “SVP_ SURVEY_ Basic Wall”

Now id like to add “SVP” to all the family list that just has it name and no ‘String’,
Just “Basic wall” or “Cylinder part 1” or " Basic Ceiling"

Hope you can help

Bets Wishes

0 Likes

#2

Hi,

Can you show us what you’re doing in the .dyn file?

Durmus

0 Likes

#3

This is how i renamed the families first time round,
now I’d like to put SVP start like this…
Screenshot%20(9)

0 Likes

#4

Use string.Contains and List.FilterByBooleanMask to get only the elements you need (i.e. those without the prefix), as you already know how to do it.

Then you can use a code block to add the prefix to the name, and use this new name as input for Element.SetName

0 Likes

#5

Thank you @lucamanzoni,

So i use the existing script and add yours in?
or just use this one?

Sorry im new to this, also I cant find Elements.Type, do you know what package that would be in?

Bets wishes

0 Likes

#6

Just replace the String.Replace node (together with node blocks “GCD” and “SVP”) in your graph with the green group of mine. Of course instead of NEW youd need to write the prefix you want :wink:

Element.Type is from Archillab package, you don’t actually need for it, but download the package anyway because it’s great

1 Like

#7

Like this? or do i need to change more?

0 Likes

#8

Thats worked so Far. but hasn’t done all of them

Thank you @lucamanzoni

0 Likes

#9

This workflow works with system families, like walls, floors, etc… because you are actually renaming the type.
For normal families I guess you want to rename the Family, not the Type.

Take a look at other posts in the forum like this:

1 Like

#10

Thank you @lucamanzoni, Ive done it!!

Sorry I didnt explain it very well, but wanted to change the system family names.

But thank you so much for your help :raised_hands:

I used this script

not sure why the “Elements” is in yellow tho, but it worked

:raised_hands:

0 Likes

#11

If you hover over the little speech box above the yellow node it will give you a message to give a clue as to what’s wrong :slight_smile:

0 Likes