Showing results for 
Search instead for 
Did you mean: 

API LoadETemp / AddArray




I am trying to create Elemntal temperatrures for a set with 30 000 elements inside. AddArray is the only method availible and making a loop to fill a 30 000 element long array takes too long. Is there any other way to do this? Why cant a SetID be used directly?


Thanks in advance!






Re: API LoadETemp / AddArray

Siemens Phenom Siemens Phenom
Siemens Phenom

Are you using the same temperature load for all 30k elements? if so you can take advantage of the ".GetArray" method on a femap.Set object.


(view in My Videos)




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

    Dim ls As femap.LoadSet
    Dim ld As femap.LoadDefinition
    Dim eT As femap.LoadETemp
    Dim eSet As femap.Set

    Set ls = App.feLoadSet
    Set ld = App.feLoadDefinition
    Set eT = App.feLoadETemp
    Set eSet = App.feSet

    If eSet.Select( FT_ELEM, True, "FACES") <> FE_OK Then End

    ' === Load Set ===
    ls.title = "ETemp Load Set API"
    ls.Put( 5000 ) 'Create a New Load Set ID = 5000

    ' === Load Definition ===
    ld.dataType =  FT_ETHERM_LOAD
    ld.loadType = FLT_ETEMPERATURE
    ld.title = "Etemp Def API"
    ld.setID = ls.ID
    ld.Put( 1 )

    Dim eArray As Variant, vArray As Variant, fArray As Variant
    Dim count As Long

    eSet.GetArray( count, eArray )

    ' === Element Temperature Load ===
    eT.setID = ls.ID
    eT.LoadDefinitionID = 1
    eT.layer = 1
    eT.color = FCL_AVOCADO
    'if all same temperature, define eT.temp here use (  , False,  ,  ,  ,  ) below
    eT.temp = 500.5
    eT.phase = 0.0

    rc = eT.AddArray( count, False, False, eArray, vArray, fArray )

End Sub

Re: API LoadETemp / AddArray

Thank you! I misunderstood GetArray by its discription: "This function adds an array of IDs into a selection set."