cancel
Showing results for 
Search instead for 
Did you mean: 

API index bug with materials

Phenom
Phenom

Hi,

I think there is a small bug with material type indexes in the API.

If you create materials with different types (iso, orthotropic2D, ortho3D...etc...) and try to add them to a set using the corresponding rule, it doesn't seem to work without a "+1" offset, as shown below:

 

    Dim mSet As femap.Set
    Set mSet = App.feSet
    mSet.AddRule(FMT_ISOTROPIC+1,FGD_MATL_BYTYPE)
    mSet.Debug

 

I've checked with other types as well.

AP

1 REPLY

Re: API index bug with materials

Siemens Phenom Siemens Phenom
Siemens Phenom

It isn’t a bug. You are using the material type macro when going to group rules…I know it makes sense, but it wasn’t intended for those.  The Material Type definitions are not the same as the group rules defintions in FEMAP.  Now here's some internal FEMAP talk from George "Those types are offset by 1 because we don’t like putting 0’s into action lists."

 

With .AddRule, you'll have to use the Rule Macros for Material selection

 

FGD_MATL_ID
FGD_MATL_ONPROP
FGD_MATL_ONELEM
FGD_MATL_BYTYPE
FGD_MATL_BYCOLOR
FGD_MATL_BYLAYER

 

Mark.