Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

API Request: Create Curves From 1D Elements

I have a bunch of 1D elements (bar elements/plot-only elements) I would like an API then will create curves from elements, or essential create a series of curves from node to node. Does anyone have something similar?

 

thanks

2 REPLIES
Solution
Solution
Accepted by topic author Stressman
‎04-15-2016 04:46 PM

Re: API Request: Create Curves From 1D Elements

Is this what you are looking for?

 

Option Explicit

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

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

    Dim rc As zReturnCode
    rc=fset.Select(FT_ELEM,True,"Select Elements to Create Curves")
    If rc=FE_CANCEL Then Exit Sub

    Dim felem As femap.Elem
    Dim fnode As femap.Node
    Set fnode=App.feNode

    Dim pt1 As Variant
    Dim pt2 As Variant

    fset.Reset
    Do While fset.Next
        Set felem=App.feElem
        felem.Get(fset.CurrentID)
        fnode.Get(felem.Node(0))
        pt1=fnode.xyz
        fnode.Get(felem.Node(1))
        pt2=fnode.xyz
        App.feLinePoints(False,pt1,pt2,False)
        Set felem=Nothing
    Loop

    App.feViewRegenerate(0)

End Sub

Re: API Request: Create Curves From 1D Elements

Oh how I envy you API gurus!

thank you very much! works like a charm!!