' This API collects all the geometry solids and groups them according to whether they are real ' solids, sheet solids or general solids. ' ' A real solid is a normal solid volume enclosed by a collection of ' bounding surfaces, possibly including interior voids. ' ' A sheet solid is any single surface or any added/stitched multiple surfaces where the combined ' sheet solid has only two topological faces. For example, multiple surfaces combined to represent a ' sheet metal part will usually be a sheet solid. ' ' A general solid includes non-manifold bodies such as surfaces which are stitched to include ' general intersections such as Tee or cross junctions. A general solid (even if just a collection ' of intersected surfaces) neither has a "top" and "bottom" face OR a clear inside and outside. ' The general solid is useful for typical midsurface welded plate assemblies or specialist geometry ' such as surfaces embedded within solids to mesh reinforcing bars inside solid concrete. ' Many CAD systems cannot create or import general solids, because these do not conform to their ' modelling philosophy. ' ' This API can be used to help QA geometry which has imported poorly to check if solid parts are solids, ' or to otherwise separate a complex assembly of parts for further processing. ' ' Sub Main Dim App As femap.model Set App = feFemap() ' Always in every API to connect API with Femap Dim Check_Solid As femap.Solid Set Check_Solid = App.feSolid ' An individual solid which is being checked for what style of solid it is. Dim SolidID As Long ' The ID of the solid Dim SolidSet As femap.Set Set SolidSet = App.feSet ' The set of true solids. Dim SheetSolidSet As femap.Set Set SheetSolidSet = App.feSet ' The set of sheet solids. Dim GeneralSolidSet As femap.Set Set GeneralSolidSet = App.feSet ' The set of general solids. Dim Solid_Count As Long Solid_Count =0 ' Records the total number of solids Dim Difference As Long ' Used to make sure all the sub-categories of solids sum up to the total number of solids. Dim Sub_Total As Long ' Used to determine the total of all the solids in the 3 subcategories. Dim GroupID As Long Dim GroupEntity As Group Set GroupEntity = App.feGroup ' Declare a Group entity rc = App.feGetInt("Specify the starting Group ID for 3 groups",1,1000,GroupID) If rc <> FE_OK Then Exit Sub End If While Check_Solid.Next() SolidID = Check_Solid.ID rc = Check_Solid.Get(SolidID) Solid_Count = Solid_Count + 1 If Check_Solid.IsSolid() = FE_OK Then rc = SolidSet.Add(SolidID) End If If Check_Solid.IsSheet() = FE_OK Then rc = SheetSolidSet.Add(SolidID) End If If Check_Solid.IsGeneral() = FE_OK Then rc = GeneralSolidSet.Add(SolidID) End If Wend Msg = "This model has" + Str$(SolidSet.Count()) + " true solids, which have been saved into Group" + Str$(GroupID) + "." rc = App.feAppMessage(FCM_NORMAL, Msg) Msg = "This model has" + Str$(SheetSolidSet.Count()) + " sheet solids, which have been saved into Group" + Str$(GroupID+1) + "." rc = App.feAppMessage(FCM_NORMAL, Msg) Msg = "This model has" + Str$(GeneralSolidSet.Count()) + " general solids, which have been saved into Group" + Str$(GroupID+2) + "." rc = App.feAppMessage(FCM_NORMAL, Msg) ' GroupID at this point is based on the user input. GroupEntity.Get(GroupID) GroupEntity.RangeDeleteAll(-1) GroupEntity.title = "Real Solids." GroupEntity.SetAdd(FT_SOLID,SolidSet.ID()) GroupEntity.Put(GroupID) ' Save the group which includes the real solids GroupID = GroupID +1 GroupEntity.Get(GroupID) GroupEntity.RangeDeleteAll(-1) GroupEntity.title = "Sheet Solids." GroupEntity.SetAdd(FT_SOLID,SheetSolidSet.ID()) GroupEntity.Put(GroupID) ' Save the next group which includes the sheet solids GroupID = GroupID + 1 GroupEntity.Get(GroupID) GroupEntity.RangeDeleteAll(-1) GroupEntity.title = "General Solids." GroupEntity.SetAdd(FT_SOLID,GeneralSolidSet.ID()) GroupEntity.Put(GroupID) ' Save the next group which includes the general solids. Sub_Total = SolidSet.Count() + SheetSolidSet.Count() + GeneralSolidSet.Count() Difference = Sub_Total - Solid_Count If Difference <> 0 Then Msg = "This model has" + Str$(Solid_Count) + " total solids, but the total of solid subcategories is" + Str$(Sub_Total) rc = App.feAppMessage(FCM_NORMAL, Msg) End If End Sub