The wall top/profile conforms to the underside or boundary of linked structural beams, ensuring accurate coordination between architectural and structural models.
I am not able to run it correctly due to an error in the geometry intersection. Please find the attached model and also the Dynamo script.
Thanks for sharing the script.
I tried it on my side, but it is not working. I also connected the remaining required node. Please have a look at the attached Dynamo file and screenshot.
import clr
import System
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
# INPUTS
host_elements = UnwrapElement(IN[0])
link_instance = UnwrapElement(IN[1])
linked_elements = UnwrapElement(IN[2])
if not isinstance(host_elements, list):
host_elements = [host_elements]
if not isinstance(linked_elements, list):
linked_elements = [linked_elements]
# Get link transform
transform = link_instance.GetTransform()
results = []
for host in host_elements:
host_solids = []
geo = host.get_Geometry(Options())
for g in geo:
if isinstance(g, Solid) and g.Volume > 0:
host_solids.append(g)
if not host_solids:
results.append([])
continue
intersecting = []
for linked in linked_elements:
linked_geo = linked.get_Geometry(Options())
for g in linked_geo:
if isinstance(g, Solid) and g.Volume > 0:
# Transform linked solid into host coordinate system
transformed_solid = SolidUtils.CreateTransformed(g, transform)
for host_solid in host_solids:
try:
intersection = BooleanOperationsUtils.ExecuteBooleanOperation(
host_solid,
transformed_solid,
BooleanOperationsType.Intersect
)
if intersection.Volume > 0:
intersecting.append(linked.ToDSType(True))
break
except:
pass
else:
continue
break
results.append(intersecting)
OUT = results