Subtract adaptive components from others

Hi guys!

Is it possible to subtract adaptive components from others?
First adaptive family is a normal solid, the second one is a void solid.
Thank you in advance! :slight_smile:

Hi :slight_smile:

What do you get if you query the geometry of one of the void solids ? If it is a Solid, you can use the Solid.Difference node.
If not, i think the best way would be to convert the void element into a solid somehow

Unfortunately Solid.Difference doesnt work :frowning:

I tried to change the void element into a solid inside the family but it also doesnt work that way.

The node takes two solids as inputs, you are passing to it Revit Elements.

ok, its different understanding. So is there no way to do that in dynamo?

Element.Geometry should do the trick.

The result of Solid.Difference will only appear on Dynamo though, I don’t know how to put it back into Revit.

Unfortunately its not working.
Even Revit crashed after that :smiley:
But in general it should be possible that Dynamo subtract one family from another right?

For example i need to cut one adaptive component with the adaptive one with a void.
Family 2 has to cut out the area only from Family 1 (1) but not from Family 1 (2). (See below)

1

Hi, it’s me back again !

Could you try this chunk of code in a Python Script node ? I’m still a beginner regarding the RevitAPI, so I’m trying things.

Please feed only one element in the first input (element to be cutted) and only one element in the second input (cutting geometry)

import clr

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from System.Collections.Generic import *

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

doc = DocumentManager.Instance.CurrentDBDocument
elementToCut = UnwrapElement(IN[0])
cuttingElement = UnwrapElement(IN[1])
Autodesk.Revit.DB.SolidSolidCutUtils.AddCutBetweenSolids(doc, doc.GetElement(elementToCut.Id), doc.GetElement(cuttingElement.Id))

OUT ="Sucess"
1 Like

like that?

3

Could you only feed one element by list please ? :frowning: (Otherwise, yes, like that)

I did, but also doesnt work. (same message as above)

@RedRai

Try playing with this

adap_tunnel_elem.rfa (452 KB)

This is very weird that you got the same message… Because that message’s cause was the fact that your were feeding lists. Are you sure you were only feeding one instance only in each input ?

If you want to do this for lists rather then elements, you try this :

import clr

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from System.Collections.Generic import *

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

doc = DocumentManager.Instance.CurrentDBDocument
elementsToCut = IN[0]
cuttingElements = IN[1]

for i in range(len(elementsToCut)) : 
	elementToCut = UnwrapElement(elementsToCut[i])
	cuttingElement = UnwrapElement(cuttingElements[i])
	Autodesk.Revit.DB.SolidSolidCutUtils.AddCutBetweenSolids(doc, doc.GetElement(elementToCut.Id), doc.GetElement(cuttingElement.Id))

OUT ="Success"

See, my script works fine for me :slight_smile:

2018-11-23%2014_24_01-Autodesk%20Revit%202018%20-%20%5BVue%203D_%20%7B3D%7D%20-%20Projet1%5D

1 Like

I think i know why it doesnt work. Somehow the node with the adaptive components is creating not only one but 17 elements. Dont know why.

thank you @m.rijsmus :slight_smile:
But its a bit more complicated situation with my tunnel. Start of the tunnel block needs to be orthogonal but the end is being cut where the second block is again orthogonal. (hard to explain :smiley: )

Have you tried running the second script in your initial graph ?

:frowning:

You mean it is cut by the normal of every piece of the line?

Of my “sketch” from above : The first block needs to be cut on the yellow line because the second block (of same family) is starting there

And I dont have another Idea how else I could cut the family.