SetTemp

SetTemp

Syntax

SapObject.SapModel.PropMaterial.SetTemp

VB6 Procedure

Function SetTemp(ByVal Name As String, ByVal NumberItems as long, ByRef Temp() As Double) As Long

Parameters

Name

The name of an existing material property.

NumberItems

The number of different temperatures at which properties are specified for the material.

Temp

This is an array that includes the different temperatures at which properties are specified for the material.

Remarks

This function assigns the temperatures at which properties are specified for a material. This data is required only for materials whose properties are temperature dependent.

The function returns zero if the temperatures are successfully set; otherwise it returns a nonzero value.

VBA Example

Sub SetMatPropTemps()

'dimension variables

Dim SapObject as cOAPI

Dim SapModel As cSapModel

Dim ret As Long

Dim MyTemp() As Double

'create Sap2000 object

Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")

'start Sap2000 application

SapObject.ApplicationStart

'create SapModel object

Set SapModel = SapObject.SapModel

'initialize model

ret = SapModel.InitializeNewModel

'create model from template

ret = SapModel.File.New2DFrame(PortalFrame, 2, 144, 2, 288)

'initialize new material property

ret = SapModel.PropMaterial.SetMaterial("Steel", MATERIAL_STEEL)

'specify temps at which properties will be provided

ReDim MyTemp(2)

MyTemp(0) = 0

MyTemp(1) = 50

MyTemp(2) = 100

ret = SapModel.PropMaterial.SetTemp("Steel", 3, MyTemp)

'close Sap2000

SapObject.ApplicationExit False

Set SapModel = Nothing

Set SapObject = Nothing

End Sub

Release Notes

Initial release in version 11.02.

See Also

GetTemp