Auto Wall Top Offset from Beam

Hi, I am working on a Dynamo script to adjust wall geometry. Hence,

ARCH_R24.rvt (5.9 MB)

04.1 -Beams With Walls.dyn (73.5 KB)

STR_R24.rvt (9.6 MB)

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.

Please help me to resolve this issue

try something like this. try same as for link elements.

link.dyn (19.5 KB)

Hi Vijay

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.

link.dyn (21.5 KB)

What do the warnings say?

Especially the for the first node.

I guees you need current document before Document.GetLinkInstances…maybe

@john_pierson any idea how this works for linked Elements,

its work perfect for current document Elements.

but this should help you,

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


link.dyn (28.3 KB)

2 Likes

sourceInstance = revitLinkInstance i believe.

Tried, did not worked as expected!

Hm, I will have to take a look

1 Like