Mistakes of getting joined elements

Hi, I used Element.GetJoinedElements and ʳʰʸᵗʰᵐ|Elements.JoinedElements to get the elements joined with the target element. I did a testing that I unjoined a beam using the Unjoin Geometry option in Revit and according to the message from Revit as shown in the picture below, the beam should be unjoined from everything. So the result of the joined elements in Dynamo of this beam should be empty, right? But It still has four joined elements. Only the slab has been excluded. What’s the problem? Thanks!




dynamo.dyn (6.9 KB)

help…

Hi @Howie
Unjoining them will not help you need to Disallow Start and End also:

1 Like

Thanks @Kulkul ! Would you mind sharing the python scripts in the picture? I tried the scrips in How to set "Disallow Join" for Structural Framing using Python? - #3 by Einar_Raknes but it always showed that name 'UnwrapElement' is not defined

Could you drop here your code.

Scripts inside the python script node: (from How to set "Disallow Join" for Structural Framing using Python? - #3 by Einar_Raknes)

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Unwrapping Dynamoelement to Revit element.
beams = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for beam in beams:
	StructuralFramingUtils.DisallowJoinAtEnd(beam,0)
	StructuralFramingUtils.DisallowJoinAtEnd(beam,1)
TransactionManager.Instance.TransactionTaskDone()

OUT = 0

dynamo.dyn (10.2 KB)

@Howie Are you using Revit 2021 with Dynamo Core 2.6.1 and DynamoRevit 2.6.1?

image

@Kulkul I am using Revit 2021 with Dynamo Core 2.10.0 and DynamoRevit 2.6.1. I replaced the Core to be able to use external libraries / CPython before.
image

@Howie Change Python engine to Ironpython and run.

1 Like

Thank you so much for your help! @Kulkul