# Reducing number of triangles in a Revit model using Dynamo

**URL:** <https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621>\
**Category:** Revit\
**Tags:** revit, geometry, dynamo\
**Created:** [April 19, 2022, 3:38pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621 "2022-04-19T15:38:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 19, 2022, 3:38pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/1 "2022-04-19T15:38:24Z")

</div>

Hello all !

I am a new user of Dynamo and would like to know how I can reduce the number of triangles of selected elements in a Revit model using the Dynamo script.

There was a similar problem here : [[Reduce Mesh](https://forum.dynamobim.com/t/reduce-mesh/39755)], but in this case I would like to bring the selected elements and then extract meshes from those Revit elements in Dynamo instead of importing .obj file. Is this possible ? If so what steps do you suggest I take ?

Please let me know if you require any clarifications 🙂

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [April 19, 2022, 4:47pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/2 "2022-04-19T16:47:42Z")

</div>

Like this?

![20220419-reduceMesh](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/f/8fb0033d2cc68a37e5d5c777faefd670a54a96a4.gif)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [April 19, 2022, 5:23pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/3 "2022-04-19T17:23:10Z")

</div>

Meshmixer solved this problem for me  
I love the Shaping tool in meshmixer, made me feel like a sculpter 🙂  
I needed that when i was modeling rocks and outcrops (in Revit)  
I used the STL file-format.

---

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 19, 2022, 5:39pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/4 "2022-04-19T17:39:21Z")

</div>

Many thanks John !!! I will give this a try 🙂

---

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 19, 2022, 6:20pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/5 "2022-04-19T18:20:29Z")

</div>

Hello John,

I get the following error message,

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/d/7d23c9db5997d5e77e0c139f2e3e53cd261ee8ce.png).

I guess I have a lot of complex furniture geometries with curved surfaces and more is required in the script?

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [April 19, 2022, 7:18pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/6 "2022-04-19T19:18:04Z")

</div>

What does element.geometry do?

---

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 19, 2022, 10:01pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/7 "2022-04-19T22:01:15Z")

</div>

Unfortunately I get the same error message

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/9/b9d9d0fb2238753e3b8ee62e5e869ce7fa3ed09b.png)

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [April 20, 2022, 12:30am UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/8 "2022-04-20T00:30:19Z")

</div>

I come across that error frequently when working with large objects and meshes in Dynamo, and it tends to be a bit of a dead end for me. From what I can gauge it’s related to naked edges, possibly falling within a tolerance range that Revit or Dynamo have applied to them in order to close that edge and its related faces.

Commenting on this thread so I can follow the outcome or reasoning behind it if it’s determined.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 20, 2022, 12:05pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/9 "2022-04-20T12:05:52Z")

</div>

It’s pretty much this - the geometry contained in the Revit import is broken on the Dynamo end, either as a result of how Revit imported it, stored it, or sent it back to Dynamo. Revit has reduced tolerances from what is needed for mfg (by design and a good thing) which means that it has implemented a LOT of ‘ignore that issue and fake it this way’ code dealing with geometry stuff over the years. You can see these as dbg\_info statements in Revit journals around geometry stuff.

There are ways around this, but they will all entail using the exporter to get good geometry out of the file prior to bringing it into Dynamo and using that.

@faisal.ramady what is your end goal after bringing the reduced complexity mesh into Dynamo?

---

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 20, 2022, 12:54pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/10 "2022-04-20T12:54:07Z")

</div>

Hi Jacob,

Thank you for confirming Gavin’s explanation. Just to give you the bigger picture we are trying to get the a BIM federation uploaded to a cloud based platform where we can view the model in the browser. There are memory constraints in the browser (up to 3GB) and the furniture in the building takes up \>90% of the total memory. We would like to reduce the complexity of the furniture using dynamo and bring the simplified furniture’s back into the Revit federation so we can upload into the platform. I am open to any suggestions at this point 🙂

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [April 20, 2022, 1:50pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/11 "2022-04-20T13:50:12Z")

</div>

It seems related to this thread:

> [@Revitapi geometry got empty list](https://forum.dynamobim.com/t/revitapi-geometry-got-empty-list/74334/8):
>
> while that may be true. In this specific example, Revit is successfully outputting the geometry for use in a Revit API context, (Autodesk.Revit.DB.Solid). Where this workflow is actually falling apart is in the Dynamo side with the ToProtoType converters, (Solid converters are [here](https://github.com/DynamoDS/DynamoRevit/blob/d8265df98b2d623d0953cfc0d984a2930cbd92fd/src/Libraries/RevitNodes/GeometryConversion/RevitToProtoSolid.cs)). @GavinCrump - I realize it is the “cool” thing to do to bash Revit and say, “RHiNo iS bETteR”, which I can agree with in a lot of instances. But in this case, and I mean this respectfully, you’re assumption re: R…

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [April 20, 2022, 2:15pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/12 "2022-04-20T14:15:19Z")

</div>

You can also look at [Dynamo Core 2.13 - Release (Parts 1, 2 and 3) - #28](https://forum.dynamobim.com/t/dynamo-core-2-13-release-parts-1-2-and-3/71497/28), specifically the replies by @Karam_Baki and check out his package **Synthesize Toolkit** to see if this resolves your issue.

In particular, look for the `K-Family Insert` and `Dynamo Geometry To Revit Compatibility` nodes.

---

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 20, 2022, 2:31pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/13 "2022-04-20T14:31:54Z")

</div>

Thanks John,

I believe the code works when you only have geometries with planar surfaces, I have furniture (with those wheel chairs) that have curved surfaces. I ran the python script for fun and I get the following error message fyi .

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/d/4d28ffc0b84a57261b0a433c2bbea1d9a48d12de.png)

---

<div class="post-metadata">

**Author:** ![faisal.ramady](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@faisal.ramady](https://forum.dynamobim.com/u/faisal.ramady)\
**Post date:** [April 20, 2022, 2:33pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/14 "2022-04-20T14:33:13Z")

</div>

Thanks Solamour, I will take a look 🙂

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 20, 2022, 5:28pm UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/15 "2022-04-20T17:28:55Z")

</div>

I think the process would have to be something like:

1. Get all the over-modeled furniture families in the document, and save them out to a new rfa (save as library is best for this) so you have a backup and to give you something you can more readily process in chunks.
2. For each furniture family in the document, open the family document, get the mesh geometry from the 3D view, and export to an intermediate file format (ie: .sat, .obj) which Dynamo can import.
3. Import the intermediate file and process it to simplify the number of faces.

- There is no “easy button” for this, so if you don’t want to spend awhile focusing on the ins and outs of mesh editing, consider processing them with something like meshmixer.

1. Delete the mesh geometry elements, and import the edited mesh as a new direct shape.

- If you went the external processing method, you can restart at #2, and import from the edited eternal mesh instead.

1. Save the family as a new .rfa, and load it into the file.

A better solution would be to use a more robust cloud platform, or to disable the furniture display entirely and use a simplified version generated externally from Revit for your geometry display (ie: export a 3D view of just the furniture to FormIt, edit there and import that into your cloud platform).

---

<div class="post-metadata">

**Author:** ![Karam\_Baki](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/karam_baki/32/113558_2.png) [@Karam\_Baki](https://forum.dynamobim.com/u/Karam_Baki)\
**Post date:** [April 21, 2022, 10:53am UTC](https://forum.dynamobim.com/t/reducing-number-of-triangles-in-a-revit-model-using-dynamo/75621/16 "2022-04-21T10:53:08Z")

</div>

I solved this in the past.

You can use 2 nodes from Synthesize to do the job.

Element.Geometry Fixer  
(It processes element one by one)  
-Each element has equivalent matching list, useful for selective and specific requirements that needs the original element id.

or  
Element.Geometry Fast  
(It processes batch elements as one)  
-Extremely fast, but doesn’t keep the list matching the original elements.
