Cancel
Showing results for 
Search instead for 
Did you mean: 

femap API-Create spline using exist node or curves

Creator
Creator

捕获1.PNG

hello,every body,Does any API command can implement the function like the above menu command? Splines feSplinePoints maybe,however,specified points in this API command must be no larger than 109.usally, the points I used are exceecding 109.

 

4 REPLIES

Re: femap API-Create spline using exist node or curves

Siemens Phenom Siemens Phenom
Siemens Phenom

That functionality may not be explicitly available through the API, but using some tricks with the Femap macro recorder I've made the API below mimic the GUI:


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

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

    If cSet.Select(FT_CURVE,True,"Select Curves To Approximate Spline") <> FE_OK Then End

    While cSet.Next()
        msg += "<@11701>"
        msg += Format$(Str$(cSet.CurrentID))
        msg += Format$("<A-M>")
    Wend

    Dim prg As String

    prg = "{~1298}"+Format$(msg)+"<OK><Esc><Esc>"
    App.feFileProgramRun(False,True,False,prg)

    While App.feFileProgramRunning
    Wend

    
End Sub

Re: femap API-Create spline using exist node or curves

Creator
Creator
Thank you for your good idea,RCatania,it is a good alternative method!
if the develeper can cancel the limit it will be more perfect!

Re: femap API-Create spline using exist node or curves

Siemens Phenom Siemens Phenom
Siemens Phenom

I am not sure what you mean by "cancel the limit", but I am not sure it is possible to break a running macro and pick up where it left off when dialog boxes are involved since the focus is lost.

 

I modified the script to instead use the "Previous" button in the select dialog which makes the whole thing quicker and appears to be more "under the hood".  I also put some extra confirmations and escapes to cruise over any error messages that would pop up.  Errors still print to the messages window.


Sub Main()

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

    Dim prg As String

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

    If cSet.Select(FT_CURVE,True,"Select Curves To Approximate Spline") <> FE_OK Then End

'    While cSet.Next()
'        msg += "<@11701>"
'        msg += Format$(Str$(cSet.CurrentID))
'        msg += Format$("<A-M>")
'    Wend

    prg = "{~1298}<A-P><OK><Esc><Esc>"

    App.feFileProgramRun(False,True,False,prg)

End Sub

Re: femap API-Create spline using exist node or curves

Creator
Creator

@ RCatania,The limit I mean is the 109 points limit in API feSplinePoints(),if simense developers can cancel the limit in this API function it will be perfect(user can directly use feSplinePoints() when deal with cases more then 109 points). Thank you for your good example program again.