We are trying to automate reporting of connection regions and contacts. We've faced with the problem of getting region selection.
In the help, I found the method GetEntitySet for ConnectionRegion object. When I'm using writing tool inside Femap I can use it but when I'm doing that in Visual Studio the method is not available.
There is a method to get SortSet which works. In API help example with SortSet shown that elements Ids are extracted one by one, but that will be slow for big selections.
Also, I've tried to use SortSet.GetSet method but it seems that it returns simply numbers from 1 to count of elements instead of Ids.
Sub Main Dim App As femap.model Set App = feFemap() Dim r As femap.ConnectionRegion Set r = App.feConnectionRegion r.Get(1) Dim s As femap.Set Set s = App.feSet'r.GetEntitySet(FT_ELEM, True) Dim sort As femap.SortSet Set sort = r.GetEntities(FT_ELEM, True) sort.GetSet(s.ID, True) Dim count As Long Dim ids As Variant s.GetArray(count, ids) App.feAppMessage(FCM_NORMAL, "Count of elements = " & count) Dim i As Integer For i = 0 To count-1 App.feAppMessage(FCM_NORMAL, "#i Element Id = " & ids(i)) Next End Sub
Results of the tool:
What I did wrong with SortSet and GetSet method?
Any other method how to get element Ids quickly from SortSet/ConnectionRegion?