Re: Api: copy combination loadset

Creator
Creator

Hello, 

 

based on your comments, I have modified the code as follows (and now it seems to be working). Thanks a lot!

 

 

Sub Test2()

' *** Variable declaration ***

'Femap --> VBA
'REAL8 --> Double
'INT2 -->Short
'INT4 -->Long

'var. type : Femap
Dim App As Object
Set App = GetObject(, "femap.model")

Dim LC As Object
Set LC = App.feLoadSet

Dim rc As Variant


Dim dOverallScale As Double
Dim nCombo As Long
Dim dscale() As Double
Dim nSetID() As Long

ReDim dscale(4)
ReDim nSetID(4)

dOverallScale = 1
nCombo = 4

dscale(0) = 1
dscale(1) = 1.2
dscale(2) = 2.2
dscale(3) = 3.2

nSetID(0) = 1
nSetID(1) = 2
nSetID(2) = 3
nSetID(3) = 4

LC.Title = "Test"
LC.ID = 101
LC.IsCombination = True

rc = LC.Put(101)

'PutCombination( dOverallScale, nCombo, dScale, nSetID )

' REAL8 dOverallScale
' Overall Scale Factor for Nastran LOAD Combination.
'
'INT4 nCombo
' Number of entries in the LOAD Combination.
'
'REAL8 dScale[0..count-1]
' The Scale Factor for the load sets in the Combination.
'
'INT4 nSetID[0..count-1]
' The IDs of the load sets in the Nastran LOAD Combination.
MsgBox ("dOverallScale: " & dOverallScale & vbNewLine _
& "nCombo: " & nCombo & vbNewLine _
& dscale(0) & " x LC_" & nSetID(0) & vbNewLine _
& dscale(1) & " x LC_" & nSetID(1) & vbNewLine _
& dscale(2) & " x LC_" & nSetID(2) & vbNewLine _
& dscale(3) & " x LC_" & nSetID(3))


rc = LC.PutCombination(dOverallScale, nCombo, dscale, nSetID)
rc = LC.Put(101)

End Sub