Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
Make_or_Buy | String | Write | Gives the Make or Buy nature of the product or part. May be:
MAKE : creates a Manufactured Part (if no children) or a
Manufacturing Assembly (if children), with scope, and continues the
recursion.
MAKE-NOSCOPE : creates a Manufactured Part (if no children)
or a Manufacturing Assembly (if children), without scope, and continues the
recursion.
BUY : creates a Provided Part to implement the Product and
stops the recursion.
BUY : creates a Provided Part to implement the Product and
stops the recursion.
UDEF : creates nothing and continues the recursion (Phantom
mode).
PARENT-UDEF : creates nothing and stops the recursion.
|
iMfgItemContext |
String |
Read |
Working context of the Item to use.
May be:
"Assembly"
"Fabrication"
"Service" .
|
Sample
The following sample determines if a product or part is MAKE, BUY, or UDEF (undefined).
Let ObjectName(String)
Let ObjectID(String)
Let BUYSubStringToFind(String)
Let MAKESubStringToFind(String)
Let MakeOrBuy(String)
Let sCreateScope(String)
Let This_Reference(VPMReference)
Let Liste_Children(List)
/* new parameter to hold Parent product*/
Let iParentInstance(VPMInstance)
set ObjectName = ""
set ObjectID = ""
set BUYSubStringToFind = "BUY"
set MAKESubStringToFind = "MAKE"
set MakeOrBuy = "UDEF"
set sCreateScope="NO"
set This_Reference = ThisObject
if (true== Parameters.HasAttribute("ParentProductOcc"))
{
set iParentInstance = Parameters.GetAttributeObject("ParentProductOcc")
}
/* if the Parent Product is not implemented and its not UDEF, then the Parent Product is NULL */
if(iParentInstance == NULL)
{
if ( NULL == This_Reference)
{
Liste_Children = ThisObject.Children
if (Liste_Children->Size() > 0)
{
This_Reference = Liste_Children->GetItem(1)
}
}
if ( NULL == This_Reference)
{
ObjectName = ThisObject->GetAttributeString("V_Name") /* Used in RACE env */
ObjectID = ThisObject.PLM_ExternalID /* Used in Non-RACE env */
}
else
{
ObjectName = This_Reference->GetAttributeString("V_Name") /* Used in RACE env */
ObjectID = This_Reference.PLM_ExternalID /* Used in Non-RACE env */
}
if ( 0 <= ObjectName->Search(BUYSubStringToFind) OR 0 <= ObjectID->Search(BUYSubStringToFind))
{
set MakeOrBuy = "BUY"
}
else if ( 0 <= ObjectName->Search(MAKESubStringToFind) OR 0 <= ObjectID->Search(MAKESubStringToFind))
{
set MakeOrBuy = "MAKE"
set sCreateScope = "NO"
}
else
{
set MakeOrBuy = "UDEF"
}
}
else
{
/* if the Parent Product is already implemented and its UDEF, then Parent Product is not NULL and the children of its should not be implemented. */
/* So MakeorBuy is mentioned as Parent UDEF and children will not be implemented */
set MakeOrBuy = "PARENT-UDEF"
}
Parameters.SetAttributeString ("Make_or_Buy", MakeOrBuy)
Parameters.SetAttributeString ("CreateScope", sCreateScope)