Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good Morning Everyone, I have an intresting problem. I am working on a plugin for concrete formwork takeoff, I have it working on all Slabs, beams, underslab, and inside of beams, however when I run it on the foundations it only works when the element is an isolated foundation. If two foundations are touching each other it wont find the foundations solids. The single foundation on the left ran though the whole script and generated the faces of the foundation as formwork but the ones that are touching dont get past line 328. When i am checking if the solid is null.
//FORMWORK ONLY FOUNDATIONS
if ((BuiltInCategory)elem.Category.Id.IntegerValue == BuiltInCategory.OST_StructuralFoundation)
{
Options opts = new Options();
GeometryElement geoElem = elem.get_Geometry(opts);
foreach (GeometryObject geoObj in geoElem)
{
GeometryInstance geoInst = geoObj as GeometryInstance;
if (null != geoInst)
{
GeometryElement instGeoElem = geoInst.GetInstanceGeometry();
if (instGeoElem != null)
{
foreach (GeometryObject o in instGeoElem)
{
Solid solid = o as Solid;
foundationSolids.Add(solid);
if (solid != null)
{
//TEST DIRECT SHAPE TO SEE IF ITS PICKING UP SOLIDS
DirectShape ds1 = null;
ds1 = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_GenericModel));
ds1.ApplicationId = "Application id";
ds1.ApplicationDataId = "Geometry object id";
ds1.Name = "FOUNDATION";
ds1.SetShape(new GeometryObject[] { solid });
}
}
}
}
}
Solved! Go to Solution.