Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"cut" in dynamo doesnt work.

4 REPLIES 4
Reply
Message 1 of 5
valeria5H6K2
198 Views, 4 Replies

"cut" in dynamo doesnt work.

Is my dynamo wrong?

For example, why cube(898902) is not cutting a wall (898739).  

 

 

valeria5H6K2_0-1700653112185.png

 

Tags (3)
Labels (3)
4 REPLIES 4
Message 2 of 5
ralphdenhaan
in reply to: valeria5H6K2

Hi,

 

Can you send the Revit model sample you are using? 

Select Accept as Solution and Likes are always welcome. 


Ralph den Haan, (Lazy) BIM Specialist


LinkedIn | LazyBIM Blog


 

Message 3 of 5
ralphdenhaan
in reply to: valeria5H6K2

Can you try this out? Create a custom Python script node with 2x input and place this script (in CPyton3):

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from System.Collections.Generic import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
items1 = UnwrapElement(IN[0])
items2 = UnwrapElement(IN[1])

def CutGeometry(doc, item1, item2):
    try:
        SolidSolidCutUtils.AddCutBetweenSolids(doc, item1, item2)
        return True
    except:
        try:
            InstanceVoidCutUtils.AddInstanceVoidCut(doc, item1, item2)
            return True
        except:
            return False

TransactionManager.Instance.EnsureInTransaction(doc)
if isinstance(IN[0], list):
    if isinstance(IN[1], list):
        OUT = [CutGeometry(doc, x, y) for x, y in zip(items1, items2)]
    else:
        OUT = [CutGeometry(doc, x, items2) for x in items1]
else:
    if isinstance(IN[1], list):
        OUT = [CutGeometry(doc, items1, x) for x in items2]
    else:
        OUT = CutGeometry(doc, items1, items2)
TransactionManager.Instance.TransactionTaskDone()



ralphdenhaan_0-1700655734426.png

 

Select Accept as Solution and Likes are always welcome. 


Ralph den Haan, (Lazy) BIM Specialist


LinkedIn | LazyBIM Blog


 

Message 4 of 5
valeria5H6K2
in reply to: valeria5H6K2

@ralphdenhaan 

yeah, sure 

Message 5 of 5
ralphdenhaan
in reply to: valeria5H6K2

It works for me: (check out the script above and make sure its running CPython3).

 

ralphdenhaan_0-1700659729086.png

 

Select Accept as Solution and Likes are always welcome. 


Ralph den Haan, (Lazy) BIM Specialist


LinkedIn | LazyBIM Blog


 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Technology Administrators