' This API selects surfaces and shows the Mesh Points from the surfaces. Sub Main Dim App As femap.model Set App = feFemap() ' Always in every API to connect API with Femap Dim PtSet As femap.Set Set PtSet = App.feSet ' The Set of Mesh Points belonging to the selcted surfaces. Dim SurfSet As femap.Set Set SurfSet = App.feSet ' The Set of graphically selected Surfaces. Dim feSurf As femap.Surface Set feSurf = App.feSurface ' An individual selected surface entity from which Mesh Point info will be found. Dim MPList As Variant ' The array of Mesh Point IDs on a surface. Dim SurfID As Long ' The ID of a selected surface rc = App.feViewRegenerate( 0 ) ' Regenerate the Active View ' rc is simply a return code, which can be used to test the success ' of some operations. In this case, the regenerate method provides ' a return code, but the real action is performed by the method itself rc = SurfSet.Select(FT_SURFACE,True,"Select Surfaces to Highlight Mesh Points") 'Select one or more surfaces If rc = -1 Then ' If one or more surfaces were successfully selected then... SurfID = SurfSet.First() ' Assign the first selected surface id to SurfID. While SurfID > 0 'Loop through the selected surfaces. feSurf.Get(SurfID) ' Load the current surface. ' rc = App.feAppMessage(FCM_NORMAL, "Selected Surface id is" +Str$(feSurf.ID)) ' Confirm by message that Getting the surface loads the selected surface MPnum = feSurf.CountMeshPoint() ' Assign the surface mesh point qty to MPNum. MPList = feSurf.vMeshPoint() ' Populate the MPList variant array with all the surface mesh points PtSet.AddArray(MPNum,MPList) ' Add the mesh point list MPList from the current surface to the set PtSet SurfID = SurfSet.Next() ' Increment the surface ID to the next one selected. 'And loop around to the next selected surface if any Wend rc = App.feViewShow(FT_POINT,PtSet.ID) ' Highlight the Mesh Points on the screen. Msg = Str$(PtSet.Count) +" Points highlighted in total." rc = App.feAppMessage(FCM_NORMAL, Str$(Msg)) ' Confirm by message the total number of highlighted Mesh points ' from the selected surfaces. If PtSet.Count <1 Then Exit Sub End If rc = PtSet.Select(FT_POINT,False, "PRESS OK to ensure this list can be retrived using Previous." ) ' This line simply shows the Entity Selection dialog loaded with the highlighted points. ' Pressing OK does nothing except to ensure the same points could be retrieved using Previous on the Entity Selection dialog. End If ' End of the if statement that tests that surfaces were successfully selected. End Sub