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