We model our walls as seperate walls for each layer, this means we also have to join the multiple walls. For this I was working on a script which worked fine, however I realised today while running it on a proejct that its not working.
I begin by using a selection to filter out the wall I want parallel walls to join to (I havent figured out how to group parallel walls yet). typically this would be the insulation layer which is then joined to an internal and an external layer.The script uses Element.GetLocation to make lines for each wall. For the insulation lines I make a perpendicular line which I then intersect with the other lines. I make these lines on a per level basis. This worked well in a test environment, however in a project I realise not all walls are hosted on the same level, therefor the lines I am clashing also don’t have the same Z position, so there are few clashes than I would expect because the perpendicular line and the wall line are at different heights.
How can I split up the walls so they use the same set of baselevels, so that the clashing is all done at the same Z height?
I didn’t opened your script. But can make some suggestions.
If you are doing the joining for the walls located on one level per one Dynamo run, you can recreate location lines with 0.00 Z - coordinate
You can do it in different ways, by translating/projecting original lines, or re-creating them as I described below
Take the Element.GetLocaion, and then get start and end points of location curves. Based on these points, you cat use them to get X and Y values
Then just create new points with proper X,Y, but put 0 to the Z coordinate of all points
And by these points recreate lines by start end point. So that all location lines are on the same elevation. And you can check for intersection with perpendicular line.
There is another option that you can use. Now you checking for intersection wall location lines with perpendicular . But instead, you can use wall’s solid geometry
Just get Element.Geometry from walls, or create cuboids from wall bounding boxes. And check intersection of solids with the perpendicular line.
It is more reliable than with location lines
Your last option is the way to go for this, I started exploring it yesterday but I didnt get very far. I tried it with bounding boxes which took a long time to run, are cuboids quicker?
Each floor has 3 levels in our projects, different walls are on different levels which means I can do it per level (also why the intersection didn work). Unless I can somehow chack if a wall is on a particular level?
edit
I just realised, while I have 3x levels per floor, each level has the same preffix relevant to the level. I can use this to sort by level, and then normalize the Z offset for each wall so they lines intersect.
Im still curious to know if using cuboids or bounding boxes for each wall works better than intersecting lines?