I try to make this
These are 2 generic models with an void in it.
In revit 2 times cut and join and it works.
In Dynamo it does not cut. The family has an void to make the cut. it works by hand. But want to use dynamo.
(something to do in the pythoncode AddCutBetweenSolids??)
With Element(s) cut its cuts the element without a void.
#Copyright (c) mostafa el ayoubi
#Data-Shapes 2016 elayoub.mostafa@gmail.com
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB.SolidSolidCutUtils import AddCutBetweenSolids
doc = DocumentManager.Instance.CurrentDBDocument
if isinstance(IN[0],list):
tobecut = [UnwrapElement(i) for i in IN[0]]
else:
tobecut = [UnwrapElement(IN[0])]
cutting = UnwrapElement(IN[1])
count = []
count2 = []
TransactionManager.Instance.EnsureInTransaction(doc)
for t in tobecut:
try:
count.append(AddCutBetweenSolids(doc,t,cutting))
except:
pass
TransactionManager.Instance.TransactionTaskDone()
OUT = '%d elements coupés' % (len(count))
Looking forward to get some hints.