Assigns weight per unit volume or mass per unit volume to a material property.
Namespace: ETABS2015Assembly: ETABS2015 (in ETABS2015.dll) Version: 15.0.0.0 (15.0.0.0)
int SetWeightAndMass(
string Name,
int MyOption,
double Value,
double Temp = 0
)
Function SetWeightAndMass ( _
Name As String, _
MyOption As Integer, _
Value As Double, _
Optional Temp As Double = 0 _
) As Integer
int SetWeightAndMass(
String^ Name,
int MyOption,
double Value,
double Temp = 0
)
Parameters
- Name
- Type:
System String
The name of an existing material property.
- MyOption
- Type:
System Int32
This is either 1 or 2, indicating what is specified by the Value item.
Value | Option |
---|
1 | Weight per unit volume is specified |
2 | Mass per unit volume is specified |
- Value
- Type:
System Double
This is either the weight per unit volume or the mass per unit volume,
depending on the value of the MyOption item.
[F/L3] for MyOption = 1 (weight), and [M/L3] for MyOption = 2 (mass)
- Temp (Optional)
- Type:
System Double
Return Value
Returns zero if the data is successfully assigned; otherwise it returns a nonzero value.
Public Sub Example()
Dim SapModel As cSapModel
Dim EtabsObject As cOAPI
Dim ret As Integer = -1
EtabsObject = CreateObject("CSI.ETABS.API.ETABSObject")
ret = EtabsObject.ApplicationStart()
SapModel = EtabsObject.SapModel
ret = SapModel.InitializeNewModel()
ret = SapModel.File.NewSteelDeck(4,12,12,4,4,24,24)
ret = SapModel.PropMaterial.SetMaterial("Steel", ETABS2013.eMatType.Steel)
ret = SapModel.PropMaterial.SetWeightAndMass("Steel", 1, 0.00029)
EtabsObject.ApplicationExit(False)
SapModel = Nothing
EtabsObject = Nothing
End Sub
Public Sub Example()
Dim SapModel As cSapModel
Dim EtabsObject As cOAPI
Dim ret As Integer = -1
'create ETABS object
EtabsObject = CreateObject("CSI.ETABS.API.ETABSObject")
'start ETABS application
ret = EtabsObject.ApplicationStart()
'create SapModel object
SapModel = EtabsObject.SapModel
'initialize model
ret = SapModel.InitializeNewModel()
'create steel deck template model
ret = SapModel.File.NewSteelDeck(4,12,12,4,4,24,24)
'initialize new material property
ret = SapModel.PropMaterial.SetMaterial("Steel", ETABS2013.eMatType.Steel)
'assign material property weight per unit volume
ret = SapModel.PropMaterial.SetWeightAndMass("Steel", 1, 0.00029)
'close ETABS
EtabsObject.ApplicationExit(False)
'clean up variables
SapModel = Nothing
EtabsObject = Nothing
End Sub