Cancel
Showing results for 
Search instead for 
Did you mean: 

API: create a loadmesh

Creator
Creator

Dear All,

Am tying to create a load on a a node, but it does not work, can someone help me out with this. Below is my prog.

 

Sub create_loads()


Dim app As Object
Set app = GetObject(, "femap.model")

Dim nod1 As Object
Set nod1 = app.feSet
Dim lm As Object
Set lm = app.feLoadMesh
Dim lval(0 To 4) As Variant

Dim csys As Object
Set csys = app.feCSys


Dim ls As Object
Set ls = app.feLoadSet

tmp = app.feFileOpen(False, "D:\link-model.modfem")
tmp = nod1.Select(FT_NODE, True, "")
lval(0) = 0
lval(1) = 10
lval(2) = 0

 

ls.Get (20)


lm.setID = ls.ID

 

 

tmp = app.feFileOpen(False, "D:\model.modfem")
tmp = nod1.Select(FT_NODE, True, "")


tmp = lm.Add(nod1.ID, nForce, 1, 0, lval, 0)


End Sub

4 REPLIES

Re: API: create a loadmesh

Valued Contributor
Valued Contributor

Hi Sarnath,

 

I have this api to create a load at node 1000000:

 

The HTML Clipboard

'Setting up a load set
Dim load_set As femap.LoadSet
Set load_set = App.feLoadSet

ldset_id =load_set.NextEmptyID
load_set.title = "Load Set"
load_set.Put(ldset_id)
App.Info_ActiveID(FT_LOAD_DIR) = ldset_id

'Setting a load definition
Dim load_def As femap.LoadDefinition
Set load_def = App.feLoadDefinition

load_defid =load_def.NextEmptyID
load_def.setID = load_set.ID
load_def.title="Nodal Load"
load_def.loadType = FLT_NFORCE
load_def.dataType=FT_NODE
rc = load_def.Put(load_defid)


Dim load_node_set As femap.Set
Set load_node_set = App.feSet
rc = load_node_set.Add(nodeID)

'Setting axial, transverse and side load on the Node 1000000
Dim load_nodes As femap.LoadMesh
Set load_nodes = App.feLoadMesh

load_nodes.setID = load_set.ID
load_nodes.LoadDefinitionID = load_def.ID

load_nodes.meshID = nodeID
load_nodes.type = FLT_NFORCE
load_nodes.CSys = 0
load_nodes.XOn = True
load_nodes.YOn = True
load_nodes.ZOn = True
load_nodes.x =1000
load_nodes.y =2000
load_nodes.z =5000
rc = load_nodes.Put(load_nodes.NextEmptyID)

 

 

Re: API: create a loadmesh

Creator
Creator

Dear Saptarshi,

Thanks for your reply.

But if i use your method prog, it creates the load, but same does not display in the model info. why?

Generally, if i create without defining the "Load definition", it comes inside other loads. 

but if i use load definition, a load definition is created but non editible and even if i delete it, load remains unchanged in the GUI. 

 

In general the load is visible in GUI but not in Model Info. WHY?

I look forward for your answers.

Thank you.

 

Also you r creating a nodal set, dint get the purpose, never used later.

 

Re: API: create a loadmesh

Legend
Legend

Hi Sarnath,

 

try the following command to update GUI:

 

App.feAppUpdatePanes( True )

Best regards

 

Peter Kaderasz

Re: API: create a loadmesh

Creator
Creator

Hi, 

Well, i tried what u said. It dint work still.

Hope u got my point.

The load has been created but it does not display in the model tree : Model Info->Model->Loads->Load Definitions or inside "other loads"

A "Nodal load" is created in the Load definitions but the applied load is not associated with the said load definitions.

I am able to create loads same is displayed in GUI but same does not display in model info.