cPropMaterialAddMaterial Method

Adds a new material property to the model.

Namespace:  ETABS2016
Assembly:  ETABS2016 (in ETABS2016.dll) Version: 16.0.0.0 (16.0.0.0)
Syntax
int AddMaterial(
	ref string Name,
	eMatType MatType,
	string Region,
	string Standard,
	string Grade,
	string UserName = ""
)

Parameters

Name
Type: SystemString
This item is returned by the program. It is the name that the program ultimately assigns for the material property. If no UserName is specified, the program assigns a default name to the material property. If a UserName is specified and that name is not used for another material property, the UserName is assigned to the material property.
MatType
Type: ETABS2016eMatType
This is one of the items in the eMatType enumeration.
Region
Type: SystemString
The region name of the material property that is user-predefined in the file "CSiMaterialLibrary*.xml" located in subfolder "Property Libraries" under the program installation.
Standard
Type: SystemString
The Standard name of the material property with the specified MatType within the specified region.
Grade
Type: SystemString
UserName (Optional)
Type: SystemString

Return Value

Type: Int32
Returns zero if the material property is successfully added, otherwise it returns a nonzero value.
Remarks
This function adds a new material property to the model based on the Code-specified and other pre-defined material properties defined in the installed file "CSiMaterialLibrary*.xml" located in subfolder "Property Libraries" under the program installation folder.
Examples
VB
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)

   'add ASTM A706 rebar material property in United states Region
       ret = SapModel.PropMaterial.AddMaterial(Name, eMatType.Rebar, "United States", "ASTM A706", "Grade 60")

   'close ETABS
       EtabsObject.ApplicationExit(False)

   'clean up variables
       SapModel = Nothing
       EtabsObject = Nothing
   End Sub
See Also