' This API asks for a threshold length and highlights all the curves the solds less than the specified length. Sub Main Dim App As femap.model Set App = feFemap() ' Always in every API to connect API with Femap Dim SolidSet As femap.Set Set SolidSet = App.feSet ' The set of selected solids. Dim Curves_on_Solids_Set As femap.Set Set Curves_on_Solids_Set = App.feSet ' The set of curves belonging to the solids. Dim Small_Curves_Set As femap.Set Set Small_Curves_Set = App.feSet ' The set of small Curves. Dim Curve_Item As femap.Curve Set Curve_Item = App.feCurve Dim SolidID As Long ' The ID of the solid Dim Curve_ID As Long ' The ID of an individual curve on the selected solids Dim Solid_Count As Long Solid_Count =0 ' Records the total number of solids Dim Length_Threshold As Double 'This is the length below which curves are put in the Small_Curves_Set Dim Lower_Length_Threshold As Double ' This is the length above which curves are highlighted, if shorter than Length_THreshold. Dim Curve_Length As Double rc = SolidSet.Select(FT_SOLID, True, "Select Solids whose Small Curves are to be found.") If rc <> FE_OK Then Exit Sub End If rc = App.feGetReal("Specify the max curve length for selection",1e-9,1e9,Length_Threshold) ' Get the threshold for the max curve length. If rc <> FE_OK Then Exit Sub End If rc = App.feGetReal("Specify the min curve length for selection",0.0,1e9,Lower_Length_Threshold) ' Get the threshold for the min curve length. If rc <> FE_OK Then Exit Sub End If rc = Curves_on_Solids_Set.AddSetRule(SolidSet.ID,FGD_CURVE_ONSOLID) If rc <> FE_OK Then Exit Sub End If While Curves_on_Solids_Set.Next() Curve_ID = Curves_on_Solids_Set.NextID() Curve_Item.Get(Curves_on_Solids_Set.CurrentID) Curve_Length = Curve_Item.Length() If Curve_Length < Length_Threshold Then If Curve_Length > Lower_Length_Threshold Then rc = Small_Curves_Set.Add(Curves_on_Solids_Set.CurrentID) End If End If Wend rc = App.feViewShow(FT_CURVE,Small_Curves_Set.ID) ' Highlight the Small curves on the screen. Msg = Str$(Small_Curves_Set.Count) +" Curves highlighted in total." rc = App.feAppMessage(FCM_NORMAL, Str$(Msg)) ' Confirm by message the total number of highlighted small surfaces. If Small_Curves_Set.Count <1 Then Exit Sub End If rc = Small_Curves_Set.Select(FT_CURVE,False, "PRESS OK to ensure this list can be retrived using Previous." ) ' This line simply shows the Entity Selection dialog loaded with the highlighted surfaces ' Pressing OK does nothing except to ensure the same curves could be retrieved using Previous on the Entity Selection dialog. End Sub