KeesKits2
Mechanical
- Apr 16, 2010
- 2
Hi there,
Via Excel it should be possible to write VBA code to generate loadcases automatically. However, it is difficult to find out with the FEMAP help file how to do this. I tried some code but unfortunately I did something wrong. It generates the load definition cases but doesn't include the actual loads. Can somebody see what I do wrong?
The code looks like this:
Dim App As Object
Set App = GetObject(, "femap.model")
Dim ls As Object
Set ls = App.feLoadSet
Dim fs As Object
Set fs = App.feLoadMesh
Dim ld As Object
Set ld = App.feLoadDefinition
Dim ID As Integer
Dim rc As Integer
Dim Name As String
Dim File As String
Worksheets("Input").Activate
Range("F3").Select
ID = 1
Name = ActiveCell.Offset(ID, -5)
rc = ls.Get(ID)
ls.Title = Name & ID
ls.setID = 1
ls.Active = ID
ls.NLOn = 1
ls.NLIncrements = 10
ls.NLMaxIterPerStep = 25
ls.NLStiffnessMethod = 1
ls.NLStiffnessIter = 5
rc = ls.Put(ID)
rc = ld.Get(ID)
ld.Title = "Pin Loading" & ID
'ld.DataType=7
ld.loadTYPE = FLT_NFORCE
ld.setID = ID
rc = ld.Put(ID)
rc = fs.Get(1)
fs.setID = ID
fs.LoadDefinitionID = ID
fs.meshID = 1274
fs.CSys = 0
fs.Type = 1
fs.dof(0) = 1
fs.dof(1) = 1
fs.Load(0) = 200
fs.Load(1) = 10
rc = fs.Put(1)
rc = fs.Get(2)
fs.setID = ID
fs.LoadDefinitionID = ID
fs.meshID = 2635
fs.CSys = 0
fs.Type = 1
fs.dof(0) = 1
fs.dof(1) = 1
fs.Load(0) = 200
fs.Load(1) = 20
rc = fs.Put(2)
End Sub
Something goes wrong in the "loadmesh" property. Anyone who likes to puzzle?
Grtz,
Kees
Via Excel it should be possible to write VBA code to generate loadcases automatically. However, it is difficult to find out with the FEMAP help file how to do this. I tried some code but unfortunately I did something wrong. It generates the load definition cases but doesn't include the actual loads. Can somebody see what I do wrong?
The code looks like this:
Dim App As Object
Set App = GetObject(, "femap.model")
Dim ls As Object
Set ls = App.feLoadSet
Dim fs As Object
Set fs = App.feLoadMesh
Dim ld As Object
Set ld = App.feLoadDefinition
Dim ID As Integer
Dim rc As Integer
Dim Name As String
Dim File As String
Worksheets("Input").Activate
Range("F3").Select
ID = 1
Name = ActiveCell.Offset(ID, -5)
rc = ls.Get(ID)
ls.Title = Name & ID
ls.setID = 1
ls.Active = ID
ls.NLOn = 1
ls.NLIncrements = 10
ls.NLMaxIterPerStep = 25
ls.NLStiffnessMethod = 1
ls.NLStiffnessIter = 5
rc = ls.Put(ID)
rc = ld.Get(ID)
ld.Title = "Pin Loading" & ID
'ld.DataType=7
ld.loadTYPE = FLT_NFORCE
ld.setID = ID
rc = ld.Put(ID)
rc = fs.Get(1)
fs.setID = ID
fs.LoadDefinitionID = ID
fs.meshID = 1274
fs.CSys = 0
fs.Type = 1
fs.dof(0) = 1
fs.dof(1) = 1
fs.Load(0) = 200
fs.Load(1) = 10
rc = fs.Put(1)
rc = fs.Get(2)
fs.setID = ID
fs.LoadDefinitionID = ID
fs.meshID = 2635
fs.CSys = 0
fs.Type = 1
fs.dof(0) = 1
fs.dof(1) = 1
fs.Load(0) = 200
fs.Load(1) = 20
rc = fs.Put(2)
End Sub
Something goes wrong in the "loadmesh" property. Anyone who likes to puzzle?
Grtz,
Kees