' This API highlights all surface elements which do not belong to any surface. Sub Main Dim App As femap.model Set App = feFemap() ' Always in every API to connect API with Femap Dim SurfaceSet As femap.Set Set SurfaceSet = App.feSet rc = SurfaceSet.AddAll(FT_SURFACE) ' Add all the surfaces into the set called SurfaceSet. If rc <>-1 Then Exit Sub End If ' If there are no surfaces, then exit the API. Dim Surf_Range As femap.Set Set Surf_Range = App.feSet rc = Surf_Range.AddRange(10,22,1) ' Define a set used to hold all the IDs of all Types of surface elements. Dim Surface_ElSet As femap.Set Set Surface_ElSet = App.feSet ' Define a set of elements which will hold all of the surface elements. rc = Surface_ElSet.AddSetRule(Surf_Range.ID, FGD_ELEM_BYTYPE) ' Add all the types of surface elements into Surface_Elset. rc=Surface_ElSet.RemoveSetRule(SurfaceSet.ID, FGD_ELEM_ATSURFACE ) ' Remove from the set all the elements which are associated with all the surfaces in the model. Dim El_Count As Long El_Count = Surface_ElSet.Count() ' This is the qty of unassociated elements from the set. rc = App.feViewShow( FT_ELEM, Surface_ElSet.ID ) ' Highlight all the elements in the set - these are the surface elements which are not associated with any surface. Msg = "The number of unassociated surface elements is" +Str$( El_Count ) rc = App.feAppMessage(FCM_NORMAL, Msg) ' Show in the message window how many surface elements are unassociated. rc = Surface_ElSet.Select(FT_ELEM,False, "PRESS OK to allow retrieval using PREVIOUS." ) ' THIS BRINGS UP THE ENTITY SELECTION DIALOG WITH THE LIST OF UNASSOCIATED ELEMENTS SHOWN. ' THIS IS SIMPLY SO THAT IN A SUBSEQUENT COMMAND THE ELEMENTS CAN BE IMMEDIATELY SELECTED USING THE ' PREVIOUS BUTTON IN THE SELECTION DIALOG - FOR EXAMPLE, DELETE | MODEL | MESH -> PREVIOUS End Sub