You are on page 1of 2

Let child(Feature)

Let parent (Feature)


Let i (Integer)
Let tp (Type)
Let elements(List)
Let specificName(String)

set parent = NULL


Result = FALSE

// Here you should set the specific name, it could also be taken from a KWE
attribute in the Drawing
specificName = "LAYOUT"

// first check we are working on some sub-elements of a PartFeature


if (Input.IsSupporting("BodyFeature") == TRUE or
Input.IsSupporting("GeometricFeature")== TRUE or
Input.IsSupporting("MMOrderedGeometricalSet") == TRUE or
Input.IsSupporting("OpenBodyFeature") == TRUE)
{

// is it a set with the name


if (Input.Name == specificName)
{
// Change the layer and color as desired
ActionList.Append("GraphicProperty(LineColor=215,150,40;Layer=111)")
Result = TRUE

//parent = GetPLMOwner(Input)
//Trace(2,"Found GAPrep in #",parent.Name)

}
else
{
// retrieve the part feature to check what is inside
//set tp = Input.PrimaryType
//Trace(2,"primary type of the input #: #",Input.Name, tp.Name)
if Input.IsASortOf("FunctionalBody") == TRUE
{
parent = NULL
}
else
{
parent = Input.Owner
}
//set tp = parent.PrimaryType
//Trace(2,"primary type of the first parent: #",tp.Name)
i = 0
if (parent <> NULL)
{
for i while parent.IsSupporting("PartFeature") <>TRUE and
parent.IsSupporting("FunctionalBody") <>TRUE and i< 10
{
set parent = parent.Owner
if (parent <> NULL)
{
set tp = parent.PrimaryType
//Trace(2,"primary type of the #eme parent: #",i,
tp.Name)
}
else
{
break
}
}
if i>=10
{
Message ("Problem on feature #",Input.Name)
}
}
// We have the part feature, let's scan it
if (parent <> NULL )
{
if (parent.IsSupporting("PartFeature") or
parent.IsSupporting("FunctionalBody"))
{
set elements = parent.Children
for child inside elements
{
// We know there is another set with the specific
name
if (child.Name == specificName)
{
Result = TRUE
ActionList.Append("NoShow()")

//parent = GetPLMOwner(Input)
//Trace(2,"do not show body: # as GAPrep is
found in #",Input.Name, parent.Name)

break

}
}
}
}
}
}
//Message("Name : # , result: # ",Input.Name, Result)

You might also like