Wall.FindInserts() doesnt working

Wall.FindInserts() doesnt working

Anonymous
Not applicable
758 Views
2 Replies
Message 1 of 3

Wall.FindInserts() doesnt working

Anonymous
Not applicable

Hi! Im trying to get wall openings. but FindInserts method can't find the opening in wall. There is my code: 

var openings=wall.FindInserts(true,false,false,false);
0 Likes
Accepted solutions (1)
759 Views
2 Replies
Replies (2)
Message 2 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous ,

1)Start the transaction

2)Delete the wall.

3)Collect the deleted elementIDS

4)roll back the transaction

5)from the deleted elementsIDS get the element "OPENING"

 Transaction firstTransaction = new Transaction(doc);
 firstTransaction.Start("FIRST");

//GET ELEMENTID OF WALL
ElementId Wall_ID;
IList<ElementId> wallIDS = new List<ElementId>();
wallIDS.Add(Wall_ID);

IList<ElementId> deletedEIDS = doc.Delete(wallIDS) as IList<ElementId>;
firstTransaction.RollBack();
 IList<Element> openingElements = new List<Element>();
                foreach(ElementId openingID in deletedEIDS)
                {
                    Element elements_in_wall= doc.GetElement(openingID);
                    if(elements_in_wall.Name.Contains("Opening"))
                    {
                        
                        openingElements.Add(elements_in_wall);
                    }
                }

 now this list IList<Element> openingElements will contain all the opening elements.

 

Also you can try using the below link

https://thebuildingcoder.typepad.com/blog/2015/12/retrieving-wall-openings-and-sorting-points.html


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks, I'll try it.

0 Likes