×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to define multiple nodal loads from a table.
4

How to define multiple nodal loads from a table.

How to define multiple nodal loads from a table.

(OP)
Hello Forum,

I'm trying to define a bunch of loads on multiple noads that I have listed on a table.

I have a colum of nodes with their respective loads (x,y,z) and the only way I've found to key in these loads so far, it's to plug them in one by one by selecting the node and then defining the load on that node. This is very tedious when you have a long list.

I'm thinking there must be a quick way to do this.

Anyone?

Thanks,

Whyowhy

RE: How to define multiple nodal loads from a table.

one way (i'm sure there are other ways to skin this cat) would be to export the analysis model, the .bdf file with a few nodal loads in it. then look at how nastran writes a load card ... there'll be a bunch of repetitive stuff, a node number and three load components. in a text table in word/excel you should be able to combine your data with the repetitive stuff nastran wants, and so complete the loads table, than import this analysis model back into FeMap.

RE: How to define multiple nodal loads from a table.

4
Here's an API that will read loads from a file - the file needs to look like -

377 82.08355985 13.72485908 75.83870402
378 53.89764958 0.097363145 40.6387977
379 77.37969629 93.22238958 8.300937927
380 2.080625171 85.20523507 47.14056163
381 50.88134943 95.45259552 79.19043752
420 60.65532723 53.86678963 41.88833467
..........

Where the first column has node IDs, and the X, Y, and Z loads are in the next three. This will put the nodal forces into the active Load Set, so make sure you have the one you want the loads to go into created and active. The loads would also go into an existing Load Set.

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

Dim readFile As femap.Read
Set readFile = App.feRead

Dim feNode As femap.Node
Set feNode = App.feNode

Dim feLoad As femap.LoadMesh
Set feLoad = App.feLoadMesh

feLoad.type = FLT_NFORCE

Dim fePoint As femap.Point
Set fePoint = App.fePoint
Dim s As String
rc = App.feFileGetName( "Select File with Loads", "Text Files", "*.txt", True, s )
If rc = FE_OK Then
If App.Info_ActiveID( FT_LOAD_DIR ) > 0 Then
feLoad.setID = App.Info_ActiveID( FT_LOAD_DIR )
feLoad.dof(0) = 1
feLoad.dof(1) = 1
feLoad.dof(2) = 1
rc = readFile.Open( s, 80 )
If rc = FE_OK Then
While Not readFile.AtEOF
rc = readFile.Read
feLoad.meshID = readFile.IntField( 1, 0 )
feLoad.load(0) = readFile.RealField( 2, 0.0 )
feLoad.load(1) = readFile.RealField( 3, 0.0 )
feLoad.load(2) = readFile.RealField( 4, 0.0 )
If feNode.Exist( feLoad.meshID ) Then
rc = feLoad.Put( feLoad.NextEmptyID )
End If
Wend
Else
MsgBox( "Unable to open text file",vbOkOnly)
End If
End If
End If

End Sub

RE: How to define multiple nodal loads from a table.

cool ! learnt something new today ... better go home now !!

RE: How to define multiple nodal loads from a table.

(OP)
This worked like a charm.

Here is what I did:

1. I copy/pasted the code in a notepad file that I saved as a .BAS
2. I clicked "cutom tools" in femap, "add tools" then selected my .BAS file. This created a MACRO in my cutom tools menu.
3. From that menu I selected my macro which prompts me to select my file containing my loads, hit enter and tadaaaa! All the loads are created under my active load set.

Thank you mrfemap,

Whyowhy

RE: How to define multiple nodal loads from a table.

Hi mrfemap,

I was wondering if there is any way to create Load Definitions. Creating Load on Mesh takes quite long when you have a lot of elements.
For example I need to put a pressure on a selected set of elements, check the model (sumforces) and iteratively adjust the pressure. Using the method you presented (which by the way works fine) takes a lot of time (it has to parse all the elements), as comparing to manually creating a Load Definition>Elemental>Pressure. And also the management of the model would be easier.

Have a nice day!
Regards
Boghya

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources