Hi!
I tried Your script - works perfect! I checked it on 10 elements and it seems everything is right.
Now, I would like to add SwitchJoinOrder option to the dynamo script.
I thought it could be easy so I get Join.Geometry Node from Hot Gear Package:
JoinGeometry.dyf (6.8 KB)
I changed the line 27 of the second python script in this node according to this topic:
but without effect despite there is no warnings at stript.
After this step I’m going to check everything on a real model with more elements to join (and switch).
Thank You very much once again,
Piotr
#Edit:
I did it with this scipt:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
elements = UnwrapElement(IN[0])
count = 0
result = []
while (count < len(elements)):
try:
Autodesk.Revit.DB.JoinGeometryUtils.SwitchJoinOrder(doc, elements[count][0], elements[count][1])
count = count + 1
result.append("Seccess")
except:
count = count +1
TransactionManager.Instance.TransactionTaskDone()
OUT = result