Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse the direction of a line beam element

Status
Not open for further replies.

faremusai

Mechanical
Feb 23, 2016
23
I want to change the direction (NOT the orientation of standard shape cross section y-axis) of a line beam element by interchanging the end node A & B via API.

The ID of end node A and B are known. How to change the element's end node ID and put the element back to the model and update it?
 
Replies continue below

Recommended for you

i think modify/update elements may help.

editing the elements is an obvious solution (so there's some reason you're no doing this ... too many to do ??)

you may be able to do something with API (something like a macro in excel ?).

another day in paradise, or is paradise one day closer ?
 
For future inquiries, please use the regularly monitored FEMAP forum found here:

FEMAP > Help > FEMAP User Community will direct you there as well.

There is not currently an API method to mimic the GUI tool "Modify > Update Elements > "Line Element Reverse Direction". However, if you simply want to Reverse the direction, the below API should do that for you.

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

Dim e As Elem
Dim eSet As Set

Set e = App.feElem
Set eSet = App.feSet

If eSet.Select(FT_ELEM, True, "Reverse Line Element(s)...") <> FE_OK Then End

eSet.Reset()
While eSet.Next()

e.Get(eSet.CurrentID)
zero = e.Node(0)
e.Node(0) = e.Node(1)
e.Node(1) = zero

e.Put(e.ID)

Wend

App.feViewRegenerate(0)

End Sub
 
Thanks. It works as expected.

I always think that .Node() is only used to read the node and cannot be written to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor