Changing Multiple Family types within a family in a project using Dynamo

Changing Multiple Family types within a family in a project using Dynamo

rosPNXGN
Enthusiast Enthusiast
209 Views
11 Replies
Message 1 of 12

Changing Multiple Family types within a family in a project using Dynamo

rosPNXGN
Enthusiast
Enthusiast

Despite being able to change all instances of a family to an alternative, this only works on a per family basis.

To avoid any being missed out by users, I am trying to write a Dynamo script to achieve it, but I'm not convinced that it is possible.

 

I have about 10 families of varying styles, the each have 2 types within them. A Full and and Empty version.

I want to select all the full versions of all the families and replace them with the empty versions.

 

Anyone have any ideas? or is it even possible?

0 Likes
Accepted solutions (1)
210 Views
11 Replies
Replies (11)
Message 2 of 12

RDAOU
Mentor
Mentor

@rosPNXGN 

 

Post what you have been working on and I can help you fix it. Putting a graph together from scratch for you to use, at least for me is not an option. Maybe someone else has the time 🙂

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes
Message 3 of 12

rosPNXGN
Enthusiast
Enthusiast

Are you saying that you think that it can be achieved then?

 

0 Likes
Message 4 of 12

RDAOU
Mentor
Mentor

Yes and swapping families and/or types is a basic operation in dynamo which is not that complicated although you do not really need dynamo to do that …

  • Select one instance >
  • right click and select similar (in view or model) >
  • swap type from the Types drop down menu!

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes
Message 5 of 12

rosPNXGN
Enthusiast
Enthusiast

Yeah, I mentioned that at the start of my post. I need to idiot proof it, hence the requirement for Dynamo.

I'll put up what I have got so far shortly

0 Likes
Message 6 of 12

RLY_15
Advisor
Advisor

Changing a Family Instance from one Type to another Type should be pretty straightforward - SetParameterByName works here:

 

RLY_15_0-1756403708525.png

 

 The issues I usually see in this workflow:

  • Trying to cross-pollinate - you actually want to swap family files, not family types. Usually you wind up placing down a brand new family instance to avoid dealing with differences in reference planes, hosting types, etc.
  • List management - you mentioned 10 families, 2 types, and an unspecified number of instances actually modelled in the project. This is going to require some amount of mapping / list level management / lacing checks. Once you post your progress we can comment on most direct option.
  • Geometry conflicts - if the family type parameters modify geometry in such a way that hosting fails, you might wind up with error generation on the Revit side.
0 Likes
Message 7 of 12

RLY_15
Advisor
Advisor

As for idiot-proofing by Dynamo, there's a classic saying about idiots that is probably applicable here.

 

Are you trying to get everything down to execution via Dynamo Player? Basically just a one-click?

0 Likes
Message 8 of 12

rosPNXGN
Enthusiast
Enthusiast

That's exactly what I am trying to do. Yes. I can't trust everyone to do a thorough job of replacement.

0 Likes
Message 9 of 12

rosPNXGN
Enthusiast
Enthusiast

Modules for collaboration_2025-08-29_02-29-06.png

I am new to this, so I apologise in advance.

I used your example of selecting individual items and managed to get it to work with switching a Full version to and Empty version. That gives me hope that it can be done, so thankyou very much for assisting with that. 🙂

I have included the attached image showing my next stage of figuring this out, by only using one family first. Main Module 1.

The piece below it just shows the other module names with their respective numbers and that they have a full and empty version.

Obviously, what I have done doesn't work, but it is the closest I have got to a simplified version to try and put across what I am after. 

I had managed a very long winded approach previously, which did change the list of Full modules, to show Empty versions, but couldn't see how to apply it to the model itself.

 

I sense down the line I should be able to collate families in the project, perhaps by asking for any name that contains full. Then ask to switch them out with their full version.

 

Really appreciate any assistance or advice you can give on this.

Thankyou

0 Likes
Message 10 of 12

rosPNXGN
Enthusiast
Enthusiast

Modules for collaboration_2025-08-29_02-39-07.png

 Of course I need to go through all that to THEN see where I had gone wrong! 

Sometimes just talking about it does it!

 

Only question now.......it is possible to include all the versions like this or shall I just copy and select the alternative modules for each one?!

0 Likes
Message 11 of 12

RLY_15
Advisor
Advisor
Accepted solution

Okay, so you noticed that the value input needs to be the Type element and not a string, great!

 

Do each of the Types in each of the families follow the same naming convention? If you do, you can do a workflow like this:

RLY_15_0-1756484347413.png

If the naming conventions vary, you'll have to try something like a Contains filter on the names to do a partial string match.

Alternatively, you could try list management by pulling all the types for all the families:

RLY_15_1-1756484725100.png

The normal list is sorted by elementID (oldest type is index 0), but you could also do an alphabetical sort. Basically, whatever gives you a consistent result against all Types you work with.


Given that the intent is to simplify the work for others, the easiest quality control option would likely be maintaining a consistent naming convention versus using sorts/ordered lists.

Message 12 of 12

rosPNXGN
Enthusiast
Enthusiast

This has been a great. Thankyou so much for your assistance. It has been invaluable

0 Likes