Revit API convert Mesh to Solid

I am trying to create some FreeFormElements in a famdoc by using

Autodesk.Revit.DB.FreeFormElement.Create(famdoc,i)

This requires me to do some conversion from Dynamo Geometry to Revit Geometry by using

revitgeom = dyngeom.ToRevitType()

However I am getting meshes instead of solids after ToRevitType()

This behaviour is described pretty clear in this topic.

However I could really use some examples on how to implement the proposed solutions.

Could someone help me out on this?

@Thomas_Mahon @Michael_Kirschner2 @john_pierson @Dimitar_Venkov ?

Many thanks in advance!

Use the ToRevitType overload and cross your fingers as the success rate for converting Dynamo solids to Revit API solids is a minefield, and really should be avoided if you can (i.e. just stick with the Revit API):

element.ToRevitType(TessellatedShapeBuilderTarget.Solid, TessellatedShapeBuilderFallback.Abort);

Thanks for your reply.
I crossed my fingers… didnt work

image

This seems to help:

Using MeshToolkit package, first convert dynamo solid to mesh, than rebuild into solid.
Then use your overload, @Thomas_Mahon

image

2 Likes

Lol, I just saved, closed and reopened my dynamo script and revit file, did a rerun and now it doesn’t work anymore.

Edit
After some testing I conclude that sometimes the above helps, and some times it doesn’t. So it is definitely not a solid solution.

What is important to mention is that it seems to be affected also by project units and geometry scaling settings. This applies to both the Mesh rebuild workaround, as well as the revitgeom = dyngeom.ToRevitType().

Edit
I hate Geometry Scaling

1 Like