Get Element from GeometryInstance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
We are trying to extract a list of geometries from a list of random elements and we have some difficulties, specially with railings and stairs.
For now we wrote a recursive function, which is iterating over each geometryObject in a given geometryElement and for each geometryObject over each sub geometryObject, etc, etc.. in pseudo code :
void geometryExtractor(geometryElement)
foreach geometryObject in geometryElement
if geometryObject is Solid
extractFaces(geometryObject as Solid)
else if geometryObject is GeometryInstance
geometryExtractor((geometryObject as GeometryInstance).getInstanceGeometry())
main(elementList)
foreach element in elementList
geometryElement = element.getGeometry()
geometryExtractor(geometryElement)
We are able with this technique to extract 90% of elements, but the last 10% is not correctly working..
A example of the problem we have with this technique :
for a given stairs, when the stairs element pass into our function, we extract the geometry of the landings, supports, railings etc. and when the main loop iterates over the familyInstance of a support or railings associated with the stairs, we extract another time their geometries.
The final extraction contains multiple copies of supports and landings geometries...
Is there a way to get a link between a geometryInstance and a Element ? We think it will be a good strategy to detect which element is a part of another one. We didn't find any solution to reach something like a parent-childs link between elements.
We know that for stairs we can use .GetAssociatedRailings(), GetStairsRuns(), etc but it requires to cast our Element as Stairs and we are looking for a generic method working for all elements.
Thanks for your help !