Provides
the Family Type of a component family.
Arguments
Name |
Input / Output |
Required? |
Type |
Comment |
FamilyType |
In |
No |
ComponentFamilyType |
- Optional argument.
- Standard type is set by default.
|
ComponentFamilyType
//Define family maturity mode as "Standard" or "Design"
let fmlType(ComponentFamilyType)
fmlType = "Design"
//Family Type. ReadWrite
let familyType(ComponentFamilyType)
familyType = myFamily.FamilyType //Standard
Creating a Family with only a Generic Model as Input
//Search for Generic model in database
let results(List)
let currentResult(PLMQueryResult)
let myQuery (PLMQuery)
let GenericModel(VPMReference)
//Create Generic model search query based on V_Name search
myQuery = CreatePLMQuery("VPMReference")
myQuery->AddCriterion("V_Name","PartGenericModel")
results = myQuery->RunQuery()
//We check whether exist a unique generic model.
if (results.Size() <> 1)
exit
currentResult = results[1]
set GenericModel = currentResult->LoadResult()
if(GenericModel == NULL)
exit
//Create Family with default values. Thats is
// Maturity Mode: Automatic
// Family Type : Standard
// Table : Retrieved from Generic Model. Model should have only one table
let myFamily (ComponentFamily)
myFamily = new ("ComponentFamily", "My Family", NULL ,GenericModel)
if(myFamily == NULL)
exit
Creating a Family with all Inputs
//Get the Design Table named "DTGenericModel" inside Genric Model
let fmlDesignTable (DesignTableType)
fmlDesignTable = GenericModel->Find("DesignTableType","x.Name==\"DTGenericModel\"",TRUE)
//Define family maturity mode as "Automatic" or "Manual"
let fmlMaturityMode (ComponentFamilyMaturityMode)
fmlMaturityMode = "Manual"
//Define family maturity mode as "Standard" or "Design"
let fmlType(ComponentFamilyType)
fmlType = "Design"
//Create Another family with other options
let anotherFamily (ComponentFamily)
anotherFamily = new ("ComponentFamily", "Another Family", NULL ,GenericModel, fmlDesignTable, fmlMaturityMode, fmlType )
if(anotherFamily == NULL)
exit
Retrieving Attributes of a Family
//Retrieving attributes of family
//GenericModel ReadOnly
let familyGenericModel(VPMReference)
set familyGenericModel = myFamily.GenericModel
//Table ReadOnly
let familyDesignTable (DesignTableType)
set familyDesignTable = myFamily.Table
//Maturity Mode. ReadWrite
let familyMaturityMode (ComponentFamilyMaturityMode)
familyMaturityMode = myFamily.MaturityMode //Automatic
//Family Type. ReadWrite
let familyType(ComponentFamilyType)
familyType = myFamily.FamilyType //Standard
//IsDirty ReadOnly
//Modify family maturity mode
myFamily.MaturityMode = "Manual"
//Now family is dirty
if myFamily.IsSaveNeeded
{
fmlToSave.Append(myFamily)
Save(fmlToSave)
}
Querying a Family in the Database
//Search for My Family component family in database
let results(List)
let currentResult(PLMQueryResult)
let myQuery (PLMQuery)
//query for search of component family in database
myQuery = CreatePLMQuery("CATComponentsFamilyExplicit")
myQuery->AddCriterion("V_Name","My Family")
results = myQuery->RunQuery()
//We check whether exist a unique component family
if (results.Size() <> 1)
exit
Note:
To perform a query, the three supported types are:
- CATComponentsFamilyExplicit
- ComponentFamily
- CATComponentsFamilyReference GetComponentFamily