We provide hints and tips to help you get started with the basic program RFEM.
FAQ 004585 | How can I read out the load distribution of a line load from a combo box in RF‑COM?
Video
First Steps with RFEM
Question
How can I readout the load distribution of a line load from a combo box in RF‑COM?Answer
The load distribution of a line load is defined by the "Distribution" attribute. The "Distribution" attribute is of the "LoadDistributionType" type, and the list entries of the combo box are of the "String" type, so the type conversion is required. The "GetLoadDistributionType" function converts a list entry of the String type into a LoadDistributionType.
End Function
The "SetLineLoad" procedure creates a line load on Line 1. The load distribution is readout from the "LoadDistribution" combo box of the "LineLoad" Excel worksheet.
Sub SetLineLoads()
'--------------------------------------------------------------------------------------------------
Dim model As RFEM5.model
Dim load As RFEM5.ILoadCase
Dim data(0) As RFEM5.LineLoad
'Get interface for model
Set model = GetObject(, "RFEM5.Model")
'Block COM licence and program access
model.GetApplication.LockLicense
On Error GoTo e
'Get interface for loads
Set load = model.GetLoads.GetLoadCase(0, AtIndex)
'Set parameters for lineload
data(0).No = 1
data(0).LineList = "1"
data(0).Type = ForceType
data(0).Distribution = GetLoadDistributionType(Worksheets("LineLoad").DropDowns("LoadDistribution").List(Worksheets("LineLoad").DropDowns("LoadDistribution").ListIndex))
data(0).Direction = LocalZType
data(0).DistanceA = 11
data(0).DistanceB = 22
data(0).RelativeDistances = True
data(0).Magnitude1 = 4000
data(0).Magnitude2 = 5000
data(0).Magnitude3 = 6000
data(0).OverTotalLength = False
data(0).Comment = "line load 1"
'Transfer lineload
load.PrepareModification
load.SetLineLoads data
load.FinishModification
e: If Err.Number <> 0 Then MsgBox Err.Description, , Err.Source
Set load = Nothing
'COM licence is unlocked, program access possible again
model.GetApplication.UnlockLicense
Set model = Nothing
End Sub
Keywords
Dlubal FAQ Excel VBA Load distribution Line load LoadDistributionType Combo box Frequently Asked Question FAQ about Dlubal Question and Answer about Dlubal
Links
Write Comment...
Write Comment...
Contact us
Do you have any questions about our products or need advice on selecting the products needed for your projects?
Contact us via our free e-mail, chat, or forum support or find various suggested solutions and useful tips on our FAQ page.