Assign Parameter Value Based on Another Value

Pretty new to Dynamo graphs, and I’ve learned a lot from reading other posts. But I can’t find any to help me out in this situation. I may just be searching for the wrong terms.

Background: Need to assign colors to Fabrication CADmep parts in Revit that will export to Navisworks. You can assign a materials project parameter to Fabrication Pipework & Ductwork. This is separate from the Fabrication database stored material data, which you can’t change in Revit. You can’t bring those into Revit (unless I’ve missed something) and assign a color, either. With the created project parameter, you can select from Revit Materials, and give the specific Fabrication Service their own color.

As you can see in the graph, I can get this to run without error, but it assigns the same value to all the Fabrication Parts.

I’m missing a step that will assign the correct Material Element ID to the correct Fabrication part based on Fabrication Service Abbreviation.

I hope those with more knowledge can give me a hand in getting this to run correctly.

Thanks in advance

Fabrication MEP Colors.dyn (27.8 KB)

1 Like

Hi @AMS_Aaron, You can use Conditional and Looping staments such as If() and for() to achieve the same.

In the IN list you have 3 Materials left after the filtering.
You can assign only one material to every Fabrication Part, unless you have more than one Material parameter.
When you assign 3 Materials to every Fabrication Part only the last one (or firstone ) will stick.

First decide which material you need in which Fab-part and filter accordingly.

Thanks for the response @Rajkumar_Nallusamy, I’ll have to study up more on those statements. Very new to this, so this may take a while.

@m.rijsmus, thanks for replying. I understand that I can only assign the one material per part. I was hoping to assign that specific material to the part by service abbreviation without having to go through the filtering process of each service.

Try using GroupByKey on the service abbreviation.

http://dictionary.dynamobim.com/#/Core/List/Action/GroupByKey

Sorry for the late reply. But this node was what I was needing to get the proper values to populate.

Thanks all for the help.

This very handy, any chance I can get a look at the final?

Fabrication MEP Pipe Colors by Active View.dyn (59.7 KB)

Here you go. I’ve noticed that after some Revit updates, the Categories box will change. You’ll have to double check that before running this script.

Thanks, we are just switching over from Fabrication to Revit. I really appreciate it.

Regards,

McK_Horiz_MovingSafetyForward-smallestest

S. Kane Hobbs

Piping Designer

Direct: 404-624-8746

www.mckenneys.com

Voted one of Atlanta and Charlotte’s “Best Places to Work”

Follow us:

Notice – this email message contains information of McKenney’s, Inc., which may be confidential, proprietary, copyrighted and/or legally privileged. This email is intended solely for the
use of the individual or entity named on the message. If you are not the intended recipient and have received this message in error, please immediately return by email and then delete it.

One thing to note. You’ll have to add a Material Parameter to the MEP Fabrication parts so you can assign this parameter value. You will not be able to change the material of the MEP part due to it being controlled by the database.

We named it differently than Material, so we know it’s new, and not the one Revit has built-in.

Thanks, I am adding “new material” as a project parameter.

Regards,

McK_Horiz_MovingSafetyForward-smallestest

S. Kane Hobbs

Piping Designer

Direct: 404-624-8746

www.mckenneys.com

Voted one of Atlanta and Charlotte’s “Best Places to Work”

Follow us:

Notice – this email message contains information of McKenney’s, Inc., which may be confidential, proprietary, copyrighted and/or legally privileged. This email is intended solely for the
use of the individual or entity named on the message. If you are not the intended recipient and have received this message in error, please immediately return by email and then delete it.

Can we get an image of the graph so we can double-check it?
I too have noticed issues from Revit 18 to 19 on category pulldowns. I have moved to “hard coding” these by using a sting connected to Category.ByName.