A temperature load is a surface load type, and is therefore applied like all other surface loads. To do this, it is necessary first to get the interface to the model, then to the loads, and then to the special load case:
Sub surface_temp_load_test()
' get interface from the opened model and lock the licence/programDim iModel As RFEM5.IModel3Set iModel = GetObject(, "RFEM5.Model")iModel.GetApplication.LockLicense
On Error GoTo e
Dim iModelData As RFEM5.IModelData2Set iModelData = iModel.GetModelData
Dim iLoa As RFEM5.iLoadsSet iLoa = iModel.GetLoads
Dim iLc As RFEM5.ILoadCaseSet iLc = iLoa.GetLoadCase(1, AtNo)
Dim surfLoad As RFEM5.SurfaceLoad
surfLoad.no = 1surfLoad.Type = TemperatureTypesurfLoad.Distribution = UniformTypesurfLoad.SurfaceList = "1"surfLoad.Magnitude1 = 10surfLoad.Magnitude4 = 40
iLc.PrepareModificationiLc.SetSurfaceLoad surfLoadiLc.FinishModification
e: If Err.Number <> 0 Then MsgBox Err.description, , Err.Source
Set iModelData = NothingiModel.GetApplication.UnlockLicenseSet iModel = Nothing
End Sub
For a constant temperature load, the parameters Magnitude1 and Magnitude4 are used, where Tc is Magnitude1 and dT is Magnitude4. If a variable load is applied, Magnitude2 and Magnitude3 are used for the other corner points for Tc, and Magnitude5 and Magnitude6 for dT.