Ich weiß nicht, warum ich den Steifigkeitswert nicht zuweisen kann, wenn ich den Code aus der Etabs API-Dokumentation verwende.Etabs API mit VBA
Sub Main()
'if the above flag is set to True, specify the path to ETABS below
Dim ProgramPath As String
''set it to the desired path of your model
Dim ModelDirectory As String
ModelDirectory = "C:\CSi_ETABS_API_Example"
If Len(Dir(ModelDirectory, vbDirectory)) = 0 Then
MkDir ModelDirectory
End If
Dim ModelName As String
ModelName = "ETABS_API_Example.edb"
Dim ModelPath As String
ModelPath = ModelDirectory & Application.PathSeparator & ModelName
'create API helper object
Dim myHelper As cHelper
Set myHelper = New Helper
''dimension the ETABS Object as cOAPI type
Dim myETABSObject As cOAPI
Set myETABSObject = Nothing
''use ret to check return values of API calls
Dim ret As Long
On Error Resume Next
''get the active ETABS object
Set myETABSObject = GetObject(, "CSI.ETABS.API.ETABSObject")
If myETABSObject Is Nothing Then
If ProgramPath <> "" Then
''create an instance of the ETABS object from the specified path
Set myETABSObject = myHelper.CreateObject(ProgramPath)
Else
''create an instance of the ETABS object from the latest installed ETABS
Set myETABSObject = myHelper.CreateObjectProgID("CSI.ETABS.API.ETABSObject")
End If
''start ETABS application
myETABSObject.ApplicationStart
End If
''get a reference to cSapModel to access all OAPI classes and functions
Dim mySapModel As ETABS2016.cSapModel
Set mySapModel = myETABSObject.SapModel
''initialize model
ret = ret + mySapModel.InitializeNewModel()
''create steel deck template model
ret = ret + mySapModel.File.NewSteelDeck(1, 12, 12, 2, 2, 8, 8)
''Set release
Dim ii() As Boolean
Dim jj() As Boolean
Dim StartValue() As Double
Dim EndValue() As Double
ReDim ii(5)
ReDim jj(5)
ReDim StartValue(5)
ReDim EndValue(5)
ii(5) = True
jj(5) = True
StartValue(5) = 10000#
EndValue(5) = 10000#
ret = mySapModel.FrameObj.SetReleases("5", ii, jj, StartValue, EndValue)
''
''clean up variables
mySapModel = Nothing
myETABSObject = Nothing
End Sub
Der Code die Freigabe einstellen kann, aber es nicht den Wert zuweisen können. Gibt es eine Möglichkeit, es zu beheben. Danke für jede Hilfe.