Femap — Api Tutorial

' 2. Create a new group Set groupSet = App.feGroupSet Set myGroup = groupSet.Add() myGroup.name = "My Beam" myGroup.Put (1) ' Save the group to database (ID=1 for new entity) newGroupID = myGroup.ID ' Store the new group's ID

Sub MoveLargeElementsToGroup() ' 1. Declare and get FEMAP objects Dim App As femap.model Set App = GetObject(, "femap.model") ' Connect to running FEMAP Dim groupSet As femap.GroupSet Dim elemSet As femap.ElementSet Dim myGroup As femap.Group Dim elem As femap.Element femap api tutorial

' 6. Update the view App.feViewRegenerate (1) MsgBox "Done! Moved elements > 100 to group: " & myGroup.name End Sub Update the view App

' 3. Get all elements Set elemSet = App.feElementSet elemSet.GetAll () Loop through elements For Each elem In elemSet If elem

' 4. Loop through elements For Each elem In elemSet If elem.ID > 100 Then ' 5. Add element to the new group elem.InGroup (newGroupID) ' True = add to group End If Next elem

Create a group named "My Beam" and move all elements with ID > 100 into that group.