Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

FEMAP API Element length

Status
Not open for further replies.

Larson HT

Structural
Nov 28, 2016
1
Hi,


I am really beginner for APi programming.

I have to include element length inside equation.

Try to make API program that I can calculate beam/bar element buckling by use analytical method from element axial forces.

Equation where I need element length is

Nelem = (pii^2 x E x I) / elem.length^2

All other is clear, but the problem is to found correct method to included element length.

Larson HT

 
Replies continue below

Recommended for you

Hi Larson HT,

I dont know if this will help you, but its what a figure out to measure a element length.



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

'--Create a solid
App.feSolidPrimitive(0,1,True, Array(0,0,0), Array(20, 5, 5), TEST_1)

'--Create a material
[ Dim Material_test As femap.Matl
Set Material_test = App.feMatl
Material_test.Ex = 100
Material_test.Nuxy = 0.3
Material_test.Put(Material_test.NextEmptyID())

'--Create a property
Dim Property_test As femap.Prop
Set Property_test = App.feProp
Property_test.type = FET_L_SOLID
Property_test.matlID = Material_test.ID
Property_test.Put(Property_test.NextEmptyID())

'--Mesh
App.feMeshHexSolid(-1, Property_test.ID, False, False,False,False,False, 0)

'--Get one Element
'Dim Set_Elem As femap.Elem
'Set Set_Elem = App.feElem
'Set_Elem.Get(1)
'Set_Elem.SelectID("Select your ID")

'--Get the first node of the element you want the length
Dim First_Node As femap.Node
Set First_Node = App.feNode
First_Node.SelectID("Select the first node")

'--Get the second node of the element you want the length
Dim Second_Node As femap.Node
Set Second_Node = App.feNode
Second_Node.SelectID("Select the second node")

'--Get the distance/Length between nodes
Dim VecBase As Variant
Dim vecDist As Variant
Dim Dist_bet_Nodes As Double
App.feMeasureDistanceBetweenNodes(First_Node.ID, Second_Node.ID, 0, 0, 1, VecBase, vecDist, Dist_bet_Nodes)


MsgBox "The element Legth is " & Dist_bet_Nodes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor