Hi there,
Does anybody know how to get the wall a curtain wall is in. With a window you can simply ask for it's host, however a curtain wall doesn't have these parameters since it's not considered being a hosted element.
So what I want is to get the wall a selected curtain wall is in (or the wall 'surrounding' the curtain wall or being the closest to the curtain wall).
Anyone ?
Solved! Go to Solution.
Solved by Joe.Ye. Go to Solution.
Hello Joe Ye,
I have a wall. In this wall I have used curtain walls. I want to replace the curtain walls for windows. In order to do so I need to know the ID of the wall the curtain wall is in. And since a curtain wall isn't considered being hosted, It doesn't tell me in what wall it's placed. (where for example a window and door have this hosted information)
The aproach I thought of taking was
1) Select te curtain wall and get it's location adn wall it is in
2) delete the curtain wall
3) place a windows family on the same ocation the curtain wall was in using doc.Create.NewFamilyInstance(points, symbol, host, host.Level, _non_rst);
I don't know if there is a way of placing a windows at a certain location, wothout having to use the host information?
Thanks Remy for the udpate. It is clear now.
Are your curtain wall totally embeded in one ordinary wall? or stand side by side with two ordinary walls?
After you delete the curtain wall, there will be a hole in the wall. Can this hole be filled automatically by Revit? Or the two walls beside the curtain wall are seperate?
You can use the XRay solution or the intersecting filter to filter out the "Host" wall from the selected curtain wall according to their position relationship.
If the host wall is one wall, using the above method, you can get the "host" wall. So just use this host wall to create window calling doc.Create.NewFamilyInstance(points, symbol, host, host.Level, _non_rst).
Revit API doesn't allow developers to create window/door without the host wall. If the "host" walls of the curtain wall are two separate walls, you can extend one wall to connect the other wall's end, and then create window in the extended wall by doc.Create.NewFamilyInstance(points, symbol, host, host.Level, _non_rst).
Thank you for your reply Joe,
I mean indeed my curtain wall is totally embedded in one wall.
Like I wrote, I first get its location, then delete the curtain wall leaving the wall without a hole. THen place a window to the prior curtain wall location with the doc.Create.NewFamilyInstance(points, symbol, host, host.Level, _non_rst) method.
So the only two things I can't figure out:
1: How do I get the ID of the wall the curtain wall was embedded in?
You say use the Xray method.. DO you have an example of it? I tried googling but didn't find a topic about it.
2: When I take my sample project and put in the hardcode ID of the wall, the routine works. BUT, the window is placed 'inside' the wall and I have to manually select the "Cut" tool to let the window cut the wall. I read something about placing the window at exactly the same wall coordinates.
This is a rather old thread, but I am having good luck with the ElementIntersectsElementFilter:
ElementIntersectsElementFilter intersect = new ElementIntersectsElementFilter(selectedWall);
List<Wall> connectedWalls = new FilteredElementCollector(doc).OfClass(typeof(Wall)).WherePasses(intersect).Select(x => x as Wall).ToList();