Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

ConnectionRegion method GetEntitySet is missing in API.

Legend
Legend

Hi,

 

 

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. 

connectionregion.png

 

 

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.

The code:

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:

results.png

 

What I did wrong with SortSet and GetSet method?

Any other method how to get element Ids quickly from SortSet/ConnectionRegion?

 

Yarko

 

 

2 REPLIES 2

Re: ConnectionRegion method GetEntitySet is missing in API.

Genius
Genius
Firstly Concerning your problem in visual studio: are you using the latest Type Library (11.4.2) as GetEntitySet is one of the newer (11.4 I believe) methods. When I reference the library the ConnectionRegionClass.GetEntitySet and ContactClass.GetEntitySet appear in the object browser as shown in the attached image. Regards
Maarten Elings | Engineer

Re: ConnectionRegion method GetEntitySet is missing in API.

Legend
Legend

Maarten, Thank you very much. Indeed I was using Type Library 11.3.2. 

 

Yarko