Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

add multiple elements to multiple groups automatically

Status
Not open for further replies.

stressengineer26

Aerospace
Jan 12, 2015
21
Is there a way to automatically add/remove multiple elements from multiple groups automatically, instead of having to go into each group, using the group > elements command and doing it that way?

your help is much appreciated.

Thanks,
 
Replies continue below

Recommended for you

Hi,
Not that I know of. I wrote this API a while back to do just that, but never found the functionnality that useful so I didnt push further...
AP

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

Dim l1 As Long

Dim grSet As femap.Set, gr As femap.Group
Set grSet = App.feSet
Set gr = App.feGroup

Dim set1 As femap.Set, set2 As femap.Set
Set set1 = App.feSet
Set set2 = App.feSet


If grSet.SelectMultiID(FT_GROUP,1,"Select Groups") = FE_CANCEL Then End
'could detect if multi mode is used and directly select groups on screen...

'could add possibility to chose between elems and nodes... => write an HMI
l1 = App.feAppMessageBox(3,"Press 'Yes' to add elements, 'No' to remove, 'Cancel' to quit")
If l1 = FE_CANCEL Then End

If set1.Select(FT_ELEM,False,"Select elements to remove") = FE_CANCEL Then End

While gr.NextInSet(grSet.ID)
set2.Clear
set2.AddGroup(FT_ELEM,gr.ID)
If l1 = FE_OK Then set2.AddSet(set1.ID) _
Else set2.RemoveSet(set1.ID)

gr.RangeDeleteAll(FGD_ELEM_ID)
gr.SetAdd(FT_ELEM,set2.ID)
gr.Put(gr.ID)
Wend
App.feViewRegenerate(0)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor