Using Dynamo nodes with the Revit API

Using Dynamo nodes with the Revit API

amir.dU8TAR
Participant Participant
1,220 Views
4 Replies
Message 1 of 5

Using Dynamo nodes with the Revit API

amir.dU8TAR
Participant
Participant

Hi there,
Im coming with a background of the Revit API with C# and python.

 

I am wondering if is there a way to take out some functions from Dynamo and use their implementation with the Revit API.

 

Alternatively, maybe look “under the hood” of Dynamo and see how a specific function is implemented.

 

To be more specific, for some reason in the Revit API the ExecuteBooleanOperation method doesn’t work, but in Dynamo it does (its called Solid.ByUnion).

 

Apparently the issue with ExecuteBooleanOperation in the Revit API is familiar and all the suggested solutions for it requires complicated workarounds which I’m trying to avoid. I’m also trying to avoid writing my add-in using Dynamo as its going to be long and I’m not fluent in it.

 

I tried Running a python script up until the point where I have to use the Solid.ByUnion node, but the node did not accept my array of Solid instances. it seems that the type of Solid in Dynamo is not the same type as Solid in the Revit API. Im not sure about it but it seems like the Dynamo does not uses the same classes as the Revit API.

 

So if possible and someone can point me in the right direction on how to extract a function from Dynamo please.

 

amirdU8TAR_0-1737013717460.png

 

0 Likes
1,221 Views
4 Replies
Replies (4)
Message 2 of 5

Niko_Davydov
Advocate
Advocate

hi @amir.dU8TAR ,

 

i think it should help Exploring the Dynamo API with C# | Autodesk University 

 

best regards,

Nikolai Davydov

0 Likes
Message 3 of 5

sensiblehira
Advocate
Advocate

Dynamo Geometries are different than Revit Geometries. The Solid.ByUnion method of Dynamo takes Dynamo solids as an input not Revit geometries. what you will have to do is in your code maybe load dynamo libraries. Extract geometries of your Revit Elements and convert them into Dynamo geometries do the tasks that you need to do and convert the resulting geometries back to Revit geometries and use them as you want.

0 Likes
Message 4 of 5

amir.dU8TAR
Participant
Participant

@sensiblehira @Niko_Davydov Thank you guys, I will look into this

0 Likes
Message 5 of 5

ctm_mka
Collaborator
Collaborator

alternatively, do it all in dynamo, take the C# portion up till the point you need Solid.ByUnion, write it as a zero-touch node. You will still need to convert to dynamo friendly objects, but that should be easier in Dynamo.

0 Likes