Change Opening's Host using Dynamo

Hi all,

I’m trying to create a new script that split a wall, which have some opening (windows/door on that)

My process is to take the geometry of the wall, which is a line, than split the line into lines, and create new walls based on these lines. After that, the old wall will be deleted.

However, I encountered a problem, when I delete the old wall, all the openings on that wall will also be deleted. So I tried to change the host of these wall into the newly created walls. However, when I tried to change the host, it says that host ID is a read-only parameter. You guys can see the pictures below:

I tried to find solution on google and forum, and it seems that RevitAPI doesn’t support this, we have to change it by using change host command in Revit UI.

Is there any solution that I don’t know? Please help me if you have any idea. Appriciate very much!

Can anyone give me some help :frowning:

Hello @thongle3103
it’s not possible to use this method, Host property has no set method (only getter)

before delete/split your wall, get BoundaryCurves (or BoundaryRect ) property, then create a new Opening with this property


As a workaround, you can collect the families on the wall and place them after generate new walls.
Here is a similar flow of mine.

1 Like

Thank you Mr.Kim, I’ll follow your advice :slight_smile: