Replace column cross-section of a column placed in Revit


#1

Hi all,

I am trying to replace the cross-sections of columns that were placed in a Revit model. Does anyone know how to achieve that ?

Like most objects in Revit, it is a simple as using the Element.SetParameterByName node. I have been trying to use a short Python script to use the same placed instances and give them a new type. I am getting a weird error “TypeError: expected FamilySymbol, got FamilySymbol”.

You can see attached my script.

Best,Python

Thomas


#2

Hi Thomas. Don’t forget to unwrap the family symbol as well.


#3

Hum, I’m still having some issue but I will find my way around it, I realized the more I do some back-and-forth between Revit and Dynamo, the more computational power it needs to run. I’ll build directly the columns in Dynamo, that way I don’t have to change the types of already created instances. I’ll just create the right ones directly…

Dimitar, since you seems to know a lot more than I do about coding, can you give a brief explanation on what UnwrapElement() actually does. Couldn’t find a satisfactory answer online.

Thanks for your help !


#4

This is the best official resource on the function:

A dynamo column type is different from a revit column type. That’s because Revit and Dynamo each process data differently.

If I may raise an analogy, Dynamo speaks a different language from Revit, and needs to wrap elements and types it pulls from Revit in a translation wrapper that translates Revitian into Dynamese :slight_smile: . When it’s time to send that element back to Revit, you have to strip that translation wrapper, otherwise Revit will receive gibberish that it can’t understand.


#5

I like the language analogy. :slight_smile:

Thanks for the tip.

Thomas