Margin of Safety API with FEMAP


Hi guys!


I am new in API developmet. I am trying to create a API that give me the MS for plate elements.

My probles is that the API make the analysis with the allowable of the first material that it get.

Could anybody gime a hand?



The HTML Clipboard

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

    Dim OutVec As femap.Output
    Set OutVec = App.feOutput

    Dim OutVec1 As femap.Output
    Set OutVec1 = App.feOutput

    Dim OutVec2 As femap.Output
    Set OutVec2 = App.feOutput

    Dim OutSet As femap.OutputSet
    Set OutSet = App.feOutputSet

    Dim Oset As femap.Set
    Set Oset = App.feSet

    Dim e As femap.Elem
    Set e = App.feElem

    Dim p As femap.Prop
    Set p = App.feProp

    Dim eset As femap.Set
    Set eset = App.feSet

    Dim m As femap.Matl
    Set m = App.feMatl

    Dim  EOutputSetID As Long

    rc = Oset.SelectID (FT_OUT_CASE, "Select Output Set", EOutputSetID)

    If rc = 2 Then
        GoTo Bailout
    End If

    OutSetID = OutSet.NextEmptyID

    OutSet.title = "Factor of Safety - From Output Set "+Str$(EOutputSetID)+"."

    OutSet.Put (OutSetID)

    eset.AddRule ( 17, FGD_ELEM_BYTYPE )
    eset.AddRule ( 18, FGD_ELEM_BYTYPE )

    OutVec2.InitScalarAtElem (OutSetID, 9000001,"Factor of Safety - Tension", FOT_STRESS, False)

    App.Info_ActiveID (FT_OUT_DIR) = OutSetID

    OutSet.Get (EOutputSetID)
    OutVec.setID = EOutputSetID

    OutVec.Get (6039)

    eid = eset.First

    While eid > 0

        e.Get ( eid )

        outval = OutVec.Value (eid)

        PID = e.propID

        MatId = p.matlID

        m.Get (MatId)

        mtype = m.type

        Tension = m.mval (52)

        e.Put ( eid )

        OutVec1.Value (eid) = FoSC

        FoST = (Tension/outval)-1

        OutVec2.setID = OutSetID

        OutVec2.ID = 9000001

        OutVec2.Value (eid) = FoST

        eid = eset.Next


    OutSet.ID = OutSetID

    OutVec2.Put (9000001)


    App.feViewRegenerate ( 0 )

End Sub


Re: Margin of Safety API with FEMAP

Siemens Phenom Siemens Phenom
Siemens Phenom

Try adding p.Get(PID) right under "PID = e.propID"

Re: Margin of Safety API with FEMAP


Thanks! now it is working!