Switch join order node


#1

Is there any SwitchJoinOrder NODE available?

hotgear package is very good with join & unjoin geometry.


#2

Hi @imran_raj1985

You might have to dig into Revit API. There is a method in Revit API called “SwitchJoinOrder”. You can try writing Python and let us know if you find any errors. http://www.revitapidocs.com/2017.1/854c88ca-9bed-7997-3326-dcc53c6335c0.htm


#3

Here is an example that works with floors and columns:

Floor.SwitchJoinOrderCutWithColumn.dyn (2.7 KB)

import clr

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

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

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

#Get selected floors or ask user to pick:
selectedIds = uidoc.Selection.GetElementIds()
if selectedIds:
	ids = selectedIds
else:
	refArray = uidoc.Selection.PickObjects(Selection.ObjectType.Element,"Pick floor(s)")
	ids = [ref.ElementId for ref in refArray]
	
for id in ids:
	floor = doc.GetElement(id)
	
	bb = floor.get_BoundingBox(doc.ActiveView)
	outline = Outline(bb.Min, bb.Max)
	filter = BoundingBoxIntersectsFilter(outline)
	columns = FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_StructuralColumns).WherePasses(filter)
	
	count = 0
		
	#Do some action in a Transaction
	TransactionManager.Instance.EnsureInTransaction(doc)
	for column in columns:
		areJoined = JoinGeometryUtils.AreElementsJoined(doc,floor,column)
		if areJoined:
			columnIsCut = JoinGeometryUtils.IsCuttingElementInJoin(doc,floor,column)
			if columnIsCut:
				JoinGeometryUtils.SwitchJoinOrder(doc,floor,column)
				count = count + 1
	TransactionManager.Instance.TransactionTaskDone()

OUT = str(count) + ' join orders are changed.'

How to hide the border line between column and beam?
How to join and dissalow join different elements
#4

many thanks @Einar_Raknes its working like a charm :+1:
i am using revit 2016 dynamo 1.2.
its works gr8.

thanks again.


#5

What a great job! Thank you very much!

Is there something similar for beams?


#6

floors and beams?


#7

Exactly.


#8

@teixeiranh
It might be as simple as replacing OST_StructuralColumns with OST_StructuralFraming
in this line:
columns = FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_StructuralColumns).WherePasses(filter)


#9

Thank you very much for the precise information. God bless you!


#10

Hi,
@Einar_Raknes. How should the script be wirtten, if i dont want to choose the floors, but automatic want to change the cutting order. Or, to step up the game, i want a special cutting order for florrs, collumns AND walls? I tried it with the suggestions for this topic: Auto join Elements but i am deadlocked and dont know where to go on.

Regards,
Ammo


#11

Unfortunately I don’t have any spare time left to help you with this. Hope you can figure it out!