Convert element faces to individual DirectShape faces?

Convert element faces to individual DirectShape faces?

Anonymous
Not applicable
2,166 Views
3 Replies
Message 1 of 4

Convert element faces to individual DirectShape faces?

Anonymous
Not applicable

FW.png

 

I need to build an add-in to calculate the formwork needed for structural elements.

I also want to show the faces that are included in the calculation. And also a way to give some control which faces to be included in the sum.

 

I've built a prototype in Dynamo. The Script imports faces in Revit as individual sat files (by built-in "ImportInstance.ByGeometry" node). So the user can see which faces are included in the calculation and has control over the calculation by deleting the unwanted sat.

 

My question:

Is there a way to create and import individual sat files from faces as Dynamo does? (Not my first choice as I don't like imports in Revit)

Or a better option:

Can we create individual DirectShape faces from the faces of Revit elements?

 

Thanks..

0 Likes
2,167 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

Dear m.p.diker,

 

Thank you for your query.

 

Please take a look at my extensive work on importing an OBJ file to create DirectShape elements in the Revit model:

 

http://thebuildingcoder.typepad.com/blog/2015/02/from-hack-to-app-obj-mesh-import-to-directshape.htm...

 

You should be able to do exactly the same with SAT, if you prefer that.

 

You can also take a look at the STL to DirectShape importer:

 

http://thebuildingcoder.typepad.com/blog/2014/12/devdays-github-stl-and-obj-model-import.html#2

 

I hope this helps.

 

Best regards,

 

Jeremy

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 4

Anonymous
Not applicable

Dear Jeremy,

 

I've already read and downloaded everything about DirectShape in your blog and github/sourceforge.

I couldn't come this far without them. And I really appreciate the time and effort you've put into them.

 

DirectShape Faces.jpg

 

So far:

1) Every sample code I could find were using TessellatedShapeBuilder for DirectShape shape.

I could create single face DirectShapes to use as formwork by:

TessellatedShapeBuilderTarget.Mesh,
TessellatedShapeBuilderFallback.Salvage,

 

But It's looking for a TessellatedFace not the multi vertex faces of a Revit Element

(I'm also trying to understand ShapeBuilder and ViewShapeBuilder but I have no clue 🙂

 

2) If I feed "face as GeometryObject" into DirectShape:

Add-in creates DirectShape Elements in Revit but they are not visible.

If I can make them visible all my problems would be solved.

 

3) I can feed "solid as GeometryObject" into DirectShape:

But I have some issues creating a formwork solid from face.

 

I can Extrude Flat surfaces to solids

Solid sld = GeometryCreationUtilities.CreateExtrusionGeometry(face.GetEdgesAsCurveLoops(), normal, 0.01);

 

But I couldn't manage to utilize "NewFormByThickenSingleSurface" to create a solid from nonplaner faces.

 

I guess I need to find a way to create a solid from nonplaner face for this option?

 

Thank you..

Message 4 of 4

jeremytammik
Autodesk
Autodesk

Dear m.p.diker,

 

Thank you for your update and appreciation.

 

I am glad to hear about all your research and that you found the existing material on The Building Coder useful so far.

 

To address your questions:

 

1. Yes. You could retrieve the Revit element geometry, grab its faces, tesselate them to obtain triangles, and populate the TessellatedShapeBuilder with those.

 

2. This is probably due to your visibility settings, i.e. something you set up manually in the user interface. Ask an application engineer or product support expert to help you 🙂

 

3. By this time you have lost me. I am no longer sure what you are really trying to achieve and what the problem you encounter is.

 

I hope this helps.

 

Happy weekend!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder