Find inserts retrieve hosted elements from another host

Find inserts retrieve hosted elements from another host

miguel_gutierreztTKQKX
Observer Observer
225 Views
2 Replies
Message 1 of 3

Find inserts retrieve hosted elements from another host

miguel_gutierreztTKQKX
Observer
Observer

Hi community,

 

I've this room 

miguel_gutie_0-1679525173259.png

And it can be seen that the window is hosted to the left wall:

miguel_gutie_1-1679525201341.png

Now I'm trying to get paint areas of the wall that bound a room which includes to substract area of the openning.

What happens is that the FindInsert method for the right wall is retrieving the left window opening somehow

 

This is the final geometry I get when I loop through this wall before throwing the exception:

miguel_gutie_2-1679525276011.png

                                                        IList<ElementId> wallInserts = wall.FindInserts(false, false, false, false);

                                                        DirectShape ds5 = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_GenericModel));
                                                        ds5.SetShape(new List<GeometryObject> { overallOpeningSolid as GeometryObject });

                                                        DirectShape ds6 = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_GenericModel));
                                                        ds6.SetShape(new List<GeometryObject> { wallFaceExtrus as GeometryObject });
                                                        tr.Commit();
                                                        return Result.Succeeded;

 

Any insights on this matter?

Thanks in advance

0 Likes
226 Views
2 Replies
Replies (2)
Message 2 of 3

moturi.magati.george
Autodesk
Autodesk

Hi @miguel_gutierreztTKQKX,

 

I would suggest you take a look the blog written by @jeremy_tammik  below.

https://thebuildingcoder.typepad.com/blog/2015/03/calculating-gross-and-net-wall-areas.html 

 

It explains on how to calculate the gross area of the wall and also finding the net wall areas

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
Message 3 of 3

sorry for the late reply, I injuried my shoulder and was taking a rest

 

I solve this by making sure the id's retrieved from the method findInserts have a host element Id equal to the wall I'm into. Nice source by the way. I'm checking it now 

 

Thanks much !