From the Knowledge Adviser (A-EKL) documentation:
if PartBody\Pad.1.GetAttributeString("String.1" ) <> "String1"
PartBody\Pad.1 .SetAttributeString("String.1","This is a test" )
Another syntax for the same rule is:
if PartBody\Pad.1\String.1 <> "String1"
PartBody\Pad.1.SetAttributeString("String.1","This is a test" )
And then this from another area in the documentation (Optimizing the Evaluation of Knowledge Expert Rule Bases):
It is strongly recommended to use attributes instead of using the GetAttribute method.
So, instead of writing:
P: Part
if P->GetAttributeString("PartNumber" ) == "Part.1"
Message("Probleme" )
Write:
P: Part
if P.PartNumber == "Part.1"
Message("Probleme" )
Why even bother with the GetAttribute and SetAttribute methods if it is simplier and more efficient to not use them? What am I missing here...
P.S. Spaces added to code to prevent smilies from showing up.  |