Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
Validation | Boolean |
Write | TRUE if the product or part is continuous and FALSE otherwise. |
Magnitude | String | Write | Gives the magnitude of the product or part, if it is continuous. |
Quantity | Real | Write | Gives the quantity (in MKS) of the product or part, if it is continuous. |
Sample
The following sample determines if a product is continuous and, if so, gets its magnitude and quantity.
Let ProductToTest(ProductOccurrence) /* the occurrence of product */
Let ProductReference(VPMReference) /* the related reference of the product occurrence */
Let ProductDesc(String)
Let Magnitude(String)
Let Value(Real)
Let ValueString(String)
Validation = false
set ProductToTest = ThisObject
if ( NULL <> ProductToTest)
{
ProductReference = ProductToTest.Reference
ProductDesc = ProductReference->GetAttributeString("V_description")
if (ProductDesc.Extract(0,10) <> "Continuous")
{
Validation = false
}
else
{
Validation = true
Magnitude = ProductDesc.Extract(10,6)
Parameters.SetAttributeString("Magnitude" , Magnitude)
ValueString = ProductDesc.Extract(16,2)
Value = ValueString.ToReal()
Parameters.SetAttributeReal("Quantity" , Value)