Feature.Access()Feature.AccessFederatedExtension()Feature.AccessFederatedExtension() SignatureFeature.AccessFederatedExtension(typeName : String) : UndefinedType Arguments
ReturnTypeUndefinedType ExampleFeature.ActivateInactivateFeature()Feature.AddExtension()Method used to add a Know-how Apps Components type or customer extensions to all mechanical features and products. SignatureFeature.AddExtension(type: String) : UndefinedType Arguments
ReturnTypeUndefinedType ExampleP : Part set t = p -> AddExtension("MyType") if (t == NULL) { Message ("Cannot Add 'MyType'") } else { Message ("Type 'MyType' Added") } Feature.AttributeType()Feature.ActivateInactivateFeature()Feature.ActivateInactivateFeature() SignatureFeature.CheckProjDistAndNormVectDiff(OffsetFeature : Feature, ThickFeature : Feature, projectionDistance : Real, differenceAngle : Real) : Real Arguments
ReturnTypeReal ExampleFeature.Delete()Method used to delete an object when possible (for example, a point in a part). After the deletion, the variable that referenced the feature becomes Unset (NULL). The deletion may fail. In this case an error message is raised. The deletion may be not allowed in some cases (in business rules for example).
SignatureFeature.Delete() Feature.Find()Method used to find an object that is a child or a parent, that is of a given type, and that fulfills a condition. It stops when it finds the first object. Arguments
ReturnTypeUndefinedType Feature.GSDGetSurfaceOrientation()Feature.GetAttributeBoolean()Method used to return the value of a Boolean type parameter added to a given object by using the Engineering Rules Capture product. parameterName is the name of the Boolean type parameter. It must be put between quotation marks ("). This method enables you to read:
Note:
Unless you know perfectly that your feature has an attribute xxx, use before the
HasAttribute method.
Arguments
ReturnTypeBoolean ExampleMessage ("The value of the Boolean.1 attribute of # is #", PartBodyPad.1.Name(), PartBodyPad.1->GetAttributeBoolean("Boolean.1")) Feature.GetAttributeDate()Feature.GetAttributeInteger()Method used to return the value of an integer type parameter added to a given object using Engineering Rules Capture. parameterName is the name of the string type parameter. It must be put between quotation marks ("). This method enables you to read:
Arguments
ReturnTypeInteger ExampleInteger.3=PartBodyHole.1 ->GetAttributeInteger("Integer.2") Feature.GetAttributeObject()Method used to read the attribute attributeName of the object and returns an object. Note:
This method enables you also to manage dynamic parameters on objects that can
aggregate a technological representation.
SignatureFeature.GetAttributeObject(String) : UndefinedType Arguments
ReturnTypeUndefinedType Feature.GetAttributeReal()Method used to return the value of a real or Length (in m) type parameter added to a given object by using the Engineering Rules Capture product. parameterName is the name of the string type parameter. It must be put between quotation marks ("). This method enables you to read:
Arguments
ReturnTypeReal Feature.GetAttributeString()Method used to return the value of a string type parameter added to a given object by using the Engineering Rules Capture product. parameterName is the name of the string type parameter. This method enables you to read:
Arguments
ReturnTypeString ExampleString.2 =PartBodyPad.1 ->GetAttributeString("String.1") Note:
To view an example, import the
R2014 EKL Enhancements.3dxml
file located in win_b64\startup\Knowledgeware\EKL
Samples\Sample1 in the installation folder. Feature.GetAttributeValuePointer()Method used to point values only. It inherits from Pointer. SignatureFeature.GetAttributeValuePointer(AttributeName: String) : ValuePointer Arguments
ReturnTypeValuePointer Examplelet x (ValuePointer) x= H -> GetAttributeValuePointer("Diameter") Feature.GetInputElements()Feature.GetListOfImplementingReferences()Gets the implementing references with specification links. SignatureFeature.GetListOfImplementingReferences(List of Implementing reference : List, List of HowToUsage attributes : List, List of specification links : List) Arguments
Examplelet MyRequirement(Feature) let Listofspecificationlinks(List) let ListofImplementingRef(List) set MyRequirement = MyReq // [From Argument List, Provided by User Selection] MyRequirement->GetListOfImplementingReferencesForGlobalSpecification(ListofImplementingRef,Listofspecificationlinks) "; Feature.GetListOfImplementingReferencesForGlobalSpecification()Gets the implementing references with global specification links. SignatureFeature.GetListOfImplementingReferencesForGlobalSpecification(List of Implementing reference : List, List of specification links : List) Arguments
Examplelet MyRequirement(Feature) let Listofspecificationlinks(List) let ListofImplementingRef(List) set MyRequirement = MyReq // [From Argument List, Provided by User Selection] MyRequirement->GetListOfImplementingReferencesForGlobalSpecification(ListofImplementingRef,Listofspecificationlinks) "; Feature.HasAttribute()Method used to determine whether the attribute specified in the argument belongs to the object to which the method is applied, and if the attribute value is not NULL. Arguments
ReturnTypeBoolean ExampleBoolean.2 = PartBodyHole.1->HasAttribute("Real.1") Feature.IsADatumFeat()Feature.IsASortOf()Feature.IsOwnedBy()Method used to determine whether the feature specified in the argument is the parent of the object to which the method is applied. featureName must be put between quotation marks ("). Arguments
ReturnTypeBoolean ExampleBoolean.1=PartBodyHole.1->IsOwnedBy(PartBody) Feature.IsSupporting()Feature.IsUpToDate()Lets you access the update status of an object. Returns TRUE if the objects are updated, FALSE if not. This method should work on the following list of features:
SignatureFeature.IsUpToDate() : Boolean ReturnTypeBoolean ExampleLet prdToCheck(VPMReference) prdToCheck = [...] if (not(prdToCheck->IsUpToDate())) { Report(“Warning”,”Product was not up to date”,”Product # was not up to date”) prdToCheck->Update() } Feature.ListAttributeNames()
Method used to return a list of strings corresponding to the name of the
available attributes for a given object. The generated list depends not only on the
Object Type but also on the object itself. That is to say, this method may return
attributes that have been added dynamically to the object, through the Parameter
Explorer command or through the When adding integer or string attributes to faces, this method returns the attributes names and the face default values: the Color, Name, UserInfoComment and the integers Layer, Transparency. Be careful, Arguments
ReturnTypeList Example 1let x(List) let s="" let sfinal = "" x = Product -> ListAttributeNames ("String",false) for s in x { sfinal = sfinal + Product -> GetAttributeString (s) } Example 2let attributes (List) let pad(GeometricFeature) let faces (List) let face (CATFace) set pad=PartBody\Pad.1 faces = pad->GetSubElements(2) set face = faces[1] /* Create 2 attributes on a pad face */ face->SetAttributeInteger("IntegerAttr",5) /* Creates an integer attribute of value 5 */ face->SetAttributeString("StringAttr","Value1") /* Creates an integer attribute of value Value1 */ /* Modify attribute values */ face->SetAttributeInteger("IntegerAttr",9) face->SetAttributeString("StringAttr","NewValue") /* Read and display attribute values */ Message("IntegerAttr " , face->GetAttributeInteger("IntegerAttr")) Message("AttrString " , face->GetAttributeString("StringAttr")) /* List the attributes */ attributes=face->ListAttributeNames("String",false) attributes=face->ListAttributeNames("Integer",false) Feature.ListAttributesValuePointers()Feature.ListAttributesValuePointers() Be careful, Arguments
ReturnTypeList ExampleFeature.Query()Method used to search for the features located below the feature to which it applies and that verifies the specified expression The objects found are added to the list. All the children are scanned, the direct ones and recursively in the tree. ReturnTypeList ExampleList.1=PartBody.Query("Hole","x.Diameter>50mm") In the example above, the result of the search will return the holes of PartBody whose diameters are greater than 50mm. Where:
Note:
Remember that:
Feature.RemoveAttribute()Feature.RemoveExtension()Method used to remove a Know-how Apps Components type or a customer extension from all mechanical features and products. Arguments
ReturnTypeInteger Examplep : Part let NBRemoved(Integer) NBRemoved = p -> RemoveExtension("MyType") if NBRemoved > 0 { Message ("Type removed") } Feature.SetAttributeBoolean()Method used to assign the value specified in the second argument to the parameter whose name is specified in the first argument. parameterName is the name of the Boolean type parameter whose value is to be modified. It must be put between quotation marks ("). Booleanvalue is either TRUE or FALSE. It is created only if it can be created using the Parameters Explorer. Arguments
Exampleif PartBodyPad.1Boolean.1 <> true PartBodyPad.1->SetAttributeBoolean("Boolean.1", true) Feature.SetAttributeDate()Feature.SetAttributeDimension()Feature.SetAttributeInteger()Method used to assign the value specified in the second argument to the parameter whose name is specified in the first argument. parameterName is the name of the integer type parameter whose value is to be modified. Put parameterName between quotation marks ("). Arguments
Exampleif PartBodyHole.1Integer.1 <> 3 PartBodyHole.1 ->SetAttributeInteger("Integer.1", 3) Feature.SetAttributeObject()Method used to write the attribute attributeName of the object with what is referenced by the pointer. It will allow passing literal to an object that needs to reference it (and that does not only need the value). It is also used to valuate list parameters and attributes. Note:
This method enables you to manage dynamic parameters on objects that can aggregate
a technological representation. When using this method, if there is no technological
representation to be found below the object, a new one is created. If there is more
than one technological representation, the first one is selected.
Feature.SetAttributeReal()Feature.SetAttributeString()Method used to assign the value specified in the second argument to the parameter whose name is specified in the first argument. parameterName is the name of the string type parameter whose value is to be modified. parameterName and stringvalue must be put between quotation marks ("). Arguments
Exampleif PartBodyPad.1->GetAttributeString("String.1") <> "String1" PartBodyPad.1 ->SetAttributeString("String.1","This is a test") /*Another syntax for the same rule is:*/ if PartBodyPad.1String.1 <> "String1" PartBodyPad.1->SetAttributeString("String.1","This is a test") Note:
To view an example, import the
XMLInEKLSample.3dxml file
located in intel_a\startup\Knowledgeware\EKL Samples\Sample3 in
the installation folder. Feature.Update()Method used to update a feature when necessary. It is available on relations sets, parameters sets, parameters, rule bases, constraints satisfactions, optimizations, and Knowledge pattern features. It is unavailable on the objects such as geometric features. SignatureFeature.Update() ExampleExpression1 (P: #In PartFeature) { /* Finding a value */ let L (List) L = P -> Query(Rulebase,) L -> Apply (RuleBase,x -> Update()) } List.AddItem()
Method used to add an item to the list. If the index is equal to 0, the new
item is added at the end of the list. If the index is equal to 1, the new item is
inserted into the list at the location indicated by the index, meaning that the item
is replaced with the new one and is therefore removed from the list.
It is recommended to use the
SignatureList.AddItem(Object: ObjectType, Index: Integer) Arguments
Examplelet list (List) list -> AddItem(PartBody\Hole.2 ,1) list -> AddItem(PartBodyHole.3 ,2) Message("#",list.Size()) List.AdvancedSort()List.Append()Method used to add an item at the end of the list. SignatureList.Append(Object: ObjectType) Arguments
List.Apply()Method used to apply a given expression to the objects of a list that are of a given type.In this expression, the element of the list is represented by a variable named x. Example//Finds all rule bases and executes them //P being Part Feature /* Finding a value */ let L (List) L = P -> Query("Rulebase","") L -> Apply ("RuleBase","x -> Update()") List.Compute()Function used to compute the result of an operation performed all the elements of the list. It is available for Actions, Reactions and in Quality Rules Reuse. There are two usages for this method:
Arguments
Example 1List.1 ->Compute("+","","",Length.1) The example above sums all the values of the list: Where:
Example 2List.1 -> Compute("+","Hole","x.Diameter+x.Depth",Length.1) The example above sums all the addition of the diameter and the depth of all holes in the list. Where:
Length.1 is the output parameter. List.Extract()Method used to extract the items of a given type. Arguments
ReturnTypeList ExampleLet L1(List) Let L2(List) ... L2=L1 -> Extract("Hole","LENGTH","y=x.Diameter+x.Depth") In this example, we produce a list in output that is the extraction of the sum of the diameter and the depth of the holes in the list. List.Filter()Method used to filter a list of objects by extracting the objects that fulfill a Boolean expression. Arguments
ReturnTypeList ExampleI = (List -> Filter("Hole","x.Diameter > 3mm")).Size() I = (List -> Filter("Hole","")).Size() List.GetItem()Method used to retrieve a value/item from the list. (Index from 1).
SignatureList.GetItem(Index: Integer) : UndefinedType Arguments
ReturnTypeUndefinedType List.IndexOf()Method used to return the first index of a list item. The item is searched for from the start index. SignatureList.IndexOf(Element: ObjectType, StartIndex: Integer) : Integer Arguments
ReturnTypeInteger List.Init()
Method used to determine the content of alist. It lets you fill in the list
with SignatureList.Init(nbValues : Integer, value : ObjectType) Arguments
Examplelet L1, L2 (List) L2.Init(3, 0) // now L2 contains 0, 0, 0 L1.Init(2, L2) // now L1 contains two lists, each containing 0, 0, 0 L1[1][1] = 1 // now L1 contains 1 list with 1, 0, 0 and the other one 0, 0, 0 List.InsertItem()Method used to insert an item into the list. SignatureList.InsertItem(Object: ObjectType, Index: Integer) Arguments
List.Intersect()Method used to get the intersection of two lists of objects. Optional criteria can be used to get only objects that are in both lists and that respect the condition. Arguments
ReturnTypeList ExampleLet L1, L2, L3 (List) L3 = L1.Intersect(L2, “HOle”, “x.Diameter == 15mm”) Note:
L3 = L1.Intersect(L2) generates a result list containing {X1,
X3, X6, X13, X15}. If the result is not refined using a criterion, the result is
a simple intersection (with common elements) of the two lists. List.Junction()Method used to find elements of a list that verifies a criterion between elements of this list and elements of another list. SignatureList1.Junction(List2 : List, TypeList1 : String, TypeList2 : String, Expression : String) : List Arguments
ReturnTypeList ExampleLet L1, L2n L3 (List) L3 = L1.Junction(L2, “Hole”, “Hole”, “x.Diameter == y.Depth AND y.Diameter > 10mm”)
In the above example, the result returned is a list of the Holes (Xi) of L1 whose diameter is equal to the Depth of a Hole (Ei) of L2 and only if the hole diameter is greater than 10mm. List.RemoveAll()List.RemoveDuplicates()Method used to modify the content of the list by extracting the duplicated elements. When the list references objects (features and parameters), it removes the duplicated reference to the objects. When the list references volatile values, it removes the equivalent values. Note:
This method does not have the same behavior on lists of
parameters and on lists of values. On Lists of parameters, it removes the parameter
that are present twice in the list. On lists of values, it removes the values that
have the same value.
SignatureList.RemoveDuplicates() List.RemoveItem()
Method used to remove an item from the
list SignatureList.RemoveItem(Index: Integer) Arguments
Note:
To view an example, import the
Sample_extra.3dxml file
located in win_b64\startup\Knowledgeware\PKT Samples\Sapmle1 in
the installation folder. List.ReorderItem()List.SetItem()Method used to replace an item in the list. SignatureList.SetItem(Object: ObjectType, Index: Integer) Arguments
List.Size()List.Sort()Method used to sort lists. It operates the sort based on a criteria that corresponds to an extraction (see previous method). Arguments
Note:
Remember:
ReturnTypeList ExampleNewList = HoleList -> Sort(">","LENGTH","LENGTH","y=x.Diameter")This example sorts a list of holes based on their diameter. List.Split()Method used to split a list in more than one list depending on criteria. Arguments
ReturnTypeList ExampleLet L1, L3 (List) //we declare L3 as a list, but it is good to remember that L3 will be a list of lists. L3 = L1.Split(“Hole”, “Length”, “y = x.Diameter”)
Note:
For understanding purposes, find below the expected result showing the
contents of each list. ListA, ListB, ListC, ListD and ListE do not need to be
typed in the script.
L1 = {Hole1, Hole2, Hole3, Hole4, Hole5, Hole6} L3 = {ListA, ListB, ListC, ListD, ListE} ListA = {10, 12, 8, 6} ListB = {Hole1, Hole5} ListC = {Hole2, Hole4} ListD = {Hole3} ListE = {Hole6}The first list of L3 (ListA) contains the values of the diameters. Its size is equal to the number of splits (the number of lists that contains elements with the same attribute value). ListA is sorted according to the split results (ListB, ListC, ListD and ListE). Other lists contain objects with the same diameter value. List.Subtract()Method used to remove objects from a list depending on another list. Arguments
ReturnTypeList ExampleLet L1, L2, L3 (List) L3 = L1.Subtract(L2, “Hole”, “x.Diameter == 15mm”) Note:
The result of
L3=L1.Subtract(L2) is the same as the "-"
operator. Literal.Inf()Operator -Operator used to remove objects from a list according to another one. Signature– (List1: List, List2: List): (List3: List) Arguments
Example
let L1, L2, L3 (List) L3 = L1-L2 ReturnTypeList Literal.IsDriving()Literal.Sup()Map.Add()The Add method is used to insert a key-value pair in the map. SignatureMap.Add(iKey : ObjectType, iValue : ObjectType) : Boolean Arguments
ReturnTypeBoolean Example// Creates a Map let mapObj (Map) mapObj = CreateMap(“String”, “String”) // Defines Key let iKey (String) iKey = "Dimension" // Defines Value let iValue (string) iValue = “Length” // Defines output Boolean let isPairAdded (Boolean) // Using Add Method isPairAdded = mapObj -> Add(iKey, iValue) Map.Get()The Get method retrieves the value corresponding to the respective key present in the map. SignatureMap.Get(iKey : ObjectType) : UndefinedType Arguments
ReturnTypeUndefinedType Get// Creates a Map let mapObj (Map) mapObj = CreateMap(“String”, “String”) // Defines Key let iKey (String) iKey = "Dimension" // Defines Value let iValue (String) iValue = “Length” // Defines output Boolean let isPairAdded (Boolean) // Defines output Value let oValue (String) // Using Add Method isPairAdded = mapObj -> Add(iKey, iValue) // Using Get Method oValue = mapObj -> Get(iKey) Map.Remove()The Remove method is used to delete the entry of the key-value pair present in the map. SignatureMap.Remove(iKey : ObjectType) : Boolean Arguments
ReturnTypeBoolean Remove// Creates a Map let mapObj (Map) mapObj = CreateMap(“String”, “String”) // Defines Key let iKey (String) iKey = "Dimension" // Defines Value let iValue (String) iValue = “Length” // Defines output Boolean let isPairAdded (Boolean) // Defines output Value let oValue (String) //Defines the output if entry got removed or not let isRemoved (Boolean) // Using Add Method isPairAdded = mapObj -> Add(iKey, iValue) // Using Get Method oValue = mapObj -> Get(iKey) // Using Remove Method isRemoved = mapObj ->Remove(iKey) Map.Replace()The Replace method updates the value of input key present in the map. SignatureMap.Replace(iKey : ObjectType, iUpdateValue : ObjectType) : Boolean Arguments
ReturnTypeBoolean Example// Creates a Map let mapObj (Map) mapObj = CreateMap(“String”, “String”) // Defines Key let iKey (String) iKey = "Dimension" // Defines Value let iValue (String) iValue = “Length” // Defines output Boolean let isPairAdded (Boolean) // Defines output Value let oValue (String) // Defines Value to be replaced by let iUpdateValue (String) iUpdateValue = “Breadth” // Defines output if replaced or not let isReplaced (Boolean) // Using Add Method isPairAdded = mapObj -> Add(iKey, iValue) // Using Get Method oValue = mapObj -> Get(iKey) // Using Replace Method isReplaced = mapObj ->Replace(iKey, iUpdateValue) Map.ToLists()The ToLists method is used to segregate the keys and values of the map to different lists. Arguments
ToLists// Creates a Map let mapObj (Map) mapObj = CreateMap(“String”, “String”) // Defines Key let iKey (String) iKey = "Dimension" // Defines Value let iValue (String) iValue = “Length” // Defines output Boolean let isPairAdded (Boolean) // Defines list to store keys of the map let oKeyList (List) // Defines list to store values of the map let oValueList (List) // Using Add Method isPairAdded = mapObj -> Add(iKey, iValue) // Using ToLists Method mapObj -> ToLists (oKeyList, oValueList) Pointer.SetValue()Method used to modify the the object referenced by the pointer. A pointer is a variable referencing an object. T SignaturePointer.SetValue(Value: ObjectType) Arguments
Examplex = Hole -> GetAttributeValuePointer ("Diameter") x -> SetValue(3mm) /* values the hole diameter */ Pointer.ValuatePointer()SignaturePointer.ValuatePointer(iStartObject : ObjectType, iBind : String, type : String) Arguments
ExampleString.Extract()String.Length()String.MatchPattern()String.NormalizedLength()String.MatchPattern()Checks if the given string matches the pattern and returns TRUE if it does, and FALSE if it does not. Arguments
ReturnTypeBoolean Examplelet referenceString = "testString12345678" let patternToMatch = "test...ing[1-8]{8}" Notify(referenceString+" matches "+ patternToMatch +" = #",referenceString.MatchPattern(patternToMatch)) patternToMatch = "test...ing[1-8]{7}" Notify(referenceString+" matches "+ patternToMatch +" = #",referenceString.MatchPattern(patternToMatch)) patternToMatch = "test...ing[1-5]{8}" Notify(referenceString+" matches "+ patternToMatch +" = #",referenceString.MatchPattern(patternToMatch)) patternToMatch = ".*1[2-8]*" Notify(referenceString+" matches "+ patternToMatch +" = #",referenceString.MatchPattern(patternToMatch)) The result of the above example is the following: testString12345678 matches ...ing[1-8]{8} = true testString12345678 matches ...ing[1-8]{7} = false testString12345678 matches ...ing[1-5]{8} = false testString12345678 matches .*1[2-8]* = true Note:
In the example above:
String.Search()String.SearchPattern()Searches for an occurrence of the pattern in the string and returns it. Arguments
ReturnTypeString Examplelet referenceString = "test1test2test3test4" let patternToSearch = "....1" Notify("Searching "+ patternToSearch +" in "+referenceString+" found #",referenceString.SearchPattern(patternToSearch)) patternToSearch = "(test[2-9]){2}" Notify("Searching "+ patternToSearch +" in "+referenceString+" found #",referenceString.SearchPattern(patternToSearch)) The result of the above example is the following: Searching .... 1 in test1test2test3test4 found test1 Searching (test[2-9]){2} in test1test2test3test4 found test2test3 Note:
In the example above:
String.ToDimension()String.ToReal() |