Example
/*
@ShortDescription: This rule checks if all created methods and attributes work well.
@Parameters: None
*/
/* Input data : DrwView */
let MyAnnotation(ASDAnnotation)
let IndexListASDAnnotation(Integer)
let IndexListParameterNames(Integer)
let ListASDAnnotation(List)
let ListParameterNames(List)
let MyAnnotationType(String)
let ParameterType(String)
let ParameterName(String)
let AnnotationTemplate(String)
let ParametReal(Real)
let ParameterInteger(Integer)
let ParameterString(String)
let ParameterAngle(ANGLE)
let ParameterLength(Length)
let ParameterBoolean(Boolean)
let MyASDView(ASDView)
let MyTuple(KWETuple)
let SubTuple(KWETuple)
MyDrwView->GetASDView(MyASDView)
//Retrieve ASD annotations created in ASD view
if (MyASDView <> NULL)
{
//ListASDAnnotation = MyASDView.Query("ASDAnnotation","")
MyASDView->GetASDAnnotation(ListASDAnnotation)
Notify(" ************** ", MyDrwView.Name," ___ ListASDAnnotation size = ", ListASDAnnotation.Size())
if (ListASDAnnotation.Size() > 0)
{
for IndexListASDAnnotation=1 while IndexListASDAnnotation <= ListASDAnnotation.Size()
{
MyAnnotation = ListASDAnnotation.GetItem(IndexListASDAnnotation)
//Retrieve type of my annotation using the attribute .AnnotationType
MyAnnotationType = MyAnnotation.AnnotationType
Notify(" ****** MyAnnotationType ", IndexListASDAnnotation," = ", MyAnnotationType)
//From annotation, retrieve list of parameter names
ListParameterNames.RemoveAll()
MyAnnotation->ListParameterNames(ListParameterNames)
Notify(" List Parameter names size = ", ListParameterNames.Size())
AnnotationTemplate = MyAnnotation.TemplateName
Notify("Annotation Template name = ", AnnotationTemplate)
//Checks if MyAnnotation contains a specific parameter type, Ex: If there is CRSID parameter in MyAnnotation
if (MyAnnotation.HasParameter("CRSID") == True)
{
ParameterString = MyAnnotation.GetParameterString("CRSID")
Notify("Parameter Value CRSID== ", ParameterString)
}
IndexListParameterNames = 0
for ParameterName inside ListParameterNames
{
IndexListParameterNames = IndexListParameterNames + 1
//Retrieve type of annotation
ParameterType = MyAnnotation.ParameterType(ParameterName)
//Retrieve parameter value using the right method GetParameter
if (ParameterType == "Real")
{
//Ex: retrieve parameter real using GetParameterReal method
ParametReal = MyAnnotation.GetParameterReal(ParameterName)
Notify("Parameter Name ", IndexListParameterNames," = ", ParameterName, " # Parameter Type = ", ParameterType, " # Parameter Value == ", ParametReal)
}
if (ParameterType == "Integer")
{
ParameterInteger = MyAnnotation.GetParameterInteger(ParameterName)
Notify("Parameter Name ", IndexListParameterNames," = ", ParameterName, " # Parameter Type = ", ParameterType, " # Parameter Value == ", ParameterInteger)
}
if (ParameterType == "String")
{
ParameterString = MyAnnotation.GetParameterString(ParameterName)
Notify("Parameter Name ", IndexListParameterNames," = ", ParameterName, " # Parameter Type = ", ParameterType, " # Parameter Value == ", ParameterString)
}
if (ParameterType == "ANGLE")
{
ParameterAngle = MyAnnotation.GetParameterAngle(ParameterName)
Notify("Parameter Name ", IndexListParameterNames," = ", ParameterName, " # Parameter Type = ", ParameterType, " # Parameter Value == ", ParameterAngle)
}
if (ParameterType == "LENGTH")
{
ParameterLength = MyAnnotation.GetParameterLength(ParameterName)
Notify("Parameter Name ", IndexListParameterNames," = ", ParameterName, " # Parameter Type = ", ParameterType, " # Parameter Value == ", ParameterLength)
}
if (ParameterType == "Boolean")
{
ParameterBoolean = MyAnnotation.GetParameterBoolean(ParameterName)
Notify("Parameter Name ", IndexListParameterNames," = ", ParameterName, " # Parameter Type = ", ParameterType, " # Parameter Value == ", ParameterBoolean)
}
}
}
}
}