Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

FEMAP API and Referenced Groups

In FEMAP API programming, it is possible to list referenced groups using entity object method "ReferencedGroups".

 

But how do you add or remove a referenced grouped from a group entity ?

2 REPLIES
Solution
Solution
Accepted by topic author Fergus
‎03-28-2017 09:33 PM

Re: FEMAP API and Referenced Groups

The "ReferencedGroups" method from the Group object returns a Set object, so you can manipulate that Set..adding or removing. If you do make changes though, you have to remember to save/Put the Group object to save the changes in the database.  Some code like this will work...

The HTML Clipboard

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim g As femap.Group
    Set g = App.feGroup

    Dim s As femap.Set
    Set s = App.feSet

    s.Add( 7 )
    s.Add( 8 )

    g.ReferencedGroups.AddSet(s.ID)
    g.title = "Reference 7+8"
    g.Put(100)
End Sub

Re: FEMAP API and Referenced Groups

Great, thank you for the quick reply. Now I understand.