Methods
- Last UpdatedJun 23, 2017
- 2 minute read
This section describes the methods available for the wwMaterial class.
AddDefChar()
This method adds a new default characteristic to the material. A corresponding actual characteristic is also created. The return code is a Short integer value that can be used for error handling.
For more information on the error codes returned, see "Error Return Values".
Syntax
ReturnCode = MaterialVar.AddDefChar (CharName, Val, ValType)
Parameters
CharName
Data Type: String
Name of characteristic
Val
Data Type: String
Default value of characteristic
ValType
Data Type: Integer
Default characteristic type enumeration. For ValType enumeration constants, see "Enumerated Constants".
AddUnit()
This method assigns the material to a new unit. A unit can contain only a single material. You can use the QueryAvailableUnits method on the wwMaterialDB object to obtain a collection of available units. The return code is a Short integer value that can be used for error handling.
For more information on the error codes returned, see "Error Return Values".
Syntax
ReturnCode = MaterialVar.AddUnit (Unit, ConflictType)
Parameters
Unit
Data Type: String
Name of unit
ConflictType
Data Type: Integer
This field is required but is not used.
0 = Resolve by date
1 = Resolve by operator
Change()
This method changes the simple properties associated with the material. The return code is a Short integer value that can be used for error handling.
For more information on the error codes returned, see "Error Return Values".
Syntax
ReturnCode = MaterialVar.Change (Name, Desc, Type, UofM, HiDev, LoDev)
Parameters
Name
Data Type: String
Name of new material
Desc
Data Type: String
Description of new material
Type
Data Type: Integer
Enumeration of new material. For Type enumeration constants, see "Enumerated Constants".
UofM
Data Type: String
Unit of measure of new material
HiDev
Data Type: Double
High deviation of new material
LoDev
Data Type: Double
Low deviation of new material
Delete()
This method deletes the material. The return code is a Short integer value that can be used for error handling.
For more information on the error codes returned, see "Error Return Values".
Syntax
ReturnCode = MaterialVar.Delete ()
QueryDefaultChars()
This method updates the DefaultChars collection with the latest set of default characteristics for the material.
Syntax
MaterialVar.QueryDefaultChars ()
QueryMaterialUnits()
This method updates the MaterialUnits collection with the latest set of assigned units for the material.
Syntax
MaterialVar.QueryMaterialUnits ()