I am a new user of FeMap. I am creating a fairly complex assembly model where I have seperated individual parts into layers and groups.
I was wondering is there a way to list the number of elements/ nodes for each layer/group.
As an adhoc method I am doing the following:
View only one layer at a time -> List -> Model -> Elements -> Select all Elements -> Highlight
This gives the the number of elements in the layer. I was wondering if there is a command for doing this in one step for the entire model.
Thanks in advance.
This API lists the number of elements for layers and groups.
Sub Main Dim App As femap.model Set App = feFemap() Dim lay As femap.layer Set lay = App.feLayer Dim eleSet As femap.Set Set eleSet = App.feSet Dim gr As femap.Group Set gr =App.feGroup 'List layers, number of elements While lay.Next rc=eleSet.Clear 'empty set on each loop rc=eleSet.AddRule(lay.ID,FGD_CURVE_BYLAYER) App.feAppMessage(FCM_NORMAL,"Layer " +Str(lay.ID) + " elements: " +Str(eleSet.Count)) Wend 'List groups, number of elements While gr.Next rc=gr.Get(gr.ID) rc=eleSet.Clear 'empty set on each loop rc=gr.GetList(FGR_ELEM,eleSet.ID) App.feAppMessage(FCM_NORMAL,"Group " +Str(gr.ID) + " elements: " +Str(eleSet.Count)) Wend End Sub
I tried the code you provided. Unfortunately, the layers are listed but the elements are not listed. All layers report 0 elements.
Layer 1 elements: 0
Layer 2 elements: 0
Layer 3 elements: 0
Layer 4 elements: 0
Is there something else that I have to do before running the code. What I understood from the script, the eleset.count is not working correctly as it is returning a value of 0.
In the script provided by Kris one line should be changed:
Because it requests curves in layers and you need elements.