Is this even possible? (Reassign Family Type based on Excel)

Let’s say I have a pipe model from a subconsultant, and they are using their own internal pipe types. But for my quantification purposes, I need to reassign the pipe family types to correspond with my own internal system.

I have (or can create) an Excel file that correlates the two lists (Their Type A equals Our Type 1, B/2, etc).

Is it even possible to use Dynamo to read this Excel file and change the assigned type based on what it finds there? Or would I be better off just pulling the pipe schedule with Their codes and changing the resulting Excel file instead?

Sounds doable. Changing family type should be pretty easy, you can search on the forums for examples on how to do that. It sounds like the main part you are wondering is how to link the excel file’s data to the pipes in the Revit model.

There are plenty of ways to do this but it would help us if you could show what the excel file looks like or how you determine which pipe family should be changed to what. If it is a simple A to 1 and B to 2, you shouldn’t even need an excel file.

For the sake of adaptability and use on other projects/clients/subs, the plan was to read the pipe types from two separate files (our internal standard where I’ve created them all but haven’t used them) and an external file (i.e. from the sub) into Excel, use various techniques there to correlate them, then read the Excel back into Dynamo and change the type assignments. Ultimately, I guess the Excel file can look like whatever it needs to?

Dunno, maybe I’m overthinking it?

The best way would likely to be with a dictionary. Your Excel file would map the subs pipe type to your pipe type by name. You could use Dynamo to create a dictionary with this information and then map the pipe type names to the actual PipeTypes for each instance in your model. I’m guessing you’ll also have to do this with fittings.

Depending on how many types you have in your model this could save you a lot of time, but you also have the option to Select All Instances and switch out the types with the type selector.

As @Nick_Boyts said, a dictionary would be the best way if it is a simple A = 1, B = 2 change. When you say you are using Excel and “various techniques there to correlate them”, are you saying that there are more strict requirements for determining which pipe family should be changed to what?

If that is the case, you should export the Element ID with the pipes as well so when you edit the Excel file, you still have a marker to link each new pipe family instance with the pipe in the sub’s model. Then when you import the excel data into Dynamo, you can match everything up.

I guess ultimately, I’m not sure I’m using the right words to describe what I’m trying to do?

I have my company standards in Excel. I will be relying on the provided model files (I assume) to extract the sub’s types from (this much I’ve figured out). I just need some way to say "If subtype = A, then change to companytype 1. For each instance of subtype.

and I assumed it would be easiest to correlate the types in excel, then read the excel to tell dynamo to change A to 1 for all cases of A

Okay, then after you have the Excel file that correlates subtype A to companytype 1, you can make a dictionary that holds that info in Dynamo. Then when you go through each subtype in the Revit model, lookup the subtype in the dictionary to find the correct companytype and change the Family Type to it.

This is about as much as we can help you until you try it yourself in Dynamo. When you get stuck at specific parts, come back and we can help you solve them. At least get to the point where you have the data from the Excel file imported into Dynamo.

1 Like

Perfect, thanks all for the guidance. :smiley: