Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.


Register Today
COE 2009 Annual PLM Conference & TechniFair

COE DISCUSSION FORUM
Subject: GetAttributeString / SetAttributeString

You are not authorized to post a reply.   
Author Messages
Tom08

11 Nov 2008 07:59 PM

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. 

CLIFFJOHNSON


12 Nov 2008 11:31 AM

These functions are used to check for, create, and access user parameters attached to objects.

The documentation is speaking of the defined attributes of particular object types such as those you find using the dictionary tools.

For Each PX: Pad

PX->SetAttributeString("PAD_FUNCTION","TOOLING_TAB" )






Tom08

12 Nov 2008 12:28 PM

So if I'm understanding correctly, the SetAttributeString and GetAttributeString have the ability to read and write (or create) parameter values for objects that you may not know the exact path for (or want to affect multiple parameters with varying paths).  Correct?

You are not authorized to post a reply.
Forums > COE Forums > CATIA V5 Programming > GetAttributeString / SetAttributeString



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)