Bu CATIA API fonksiyonu ne işe yarar?
Fonksiyon: CAAScdBKTBehaviors.CATScript
Cevap:
***********************************************************************
   Purpose:      This macro:
                 1 - Opens an extended Part document
				  2 - Retrieves the BehaviorExtensionsRoot,
					  which gives access to the behaviors defined in the corresponding CATfct file
				  3 - Successively retrieves behaviors under the main behavior, and get some of the input
					  and output attributes defined on those behaviors
				  4 - created parameters under the Part document
				  5 - Assigns the value of those parameters to behavior's attribute: "MyExternal" attribute is linked to parameter P2

 ***********************************************************************
**********************************************************
 -----------------------------------------------------------
 Open the Part document
**********************************************************
Before opening the extended part, don't forget to copy Doc_path\CAAScdBKTUseCases\samples\CAAScdBKTautomation.CATfct into installed_path/intel_a/resources/graphic
 Set the CATIA popup file alerts to False
 It prevents to stop the macro at each alert during its execution
We open an extended Part
We get the BehaviorExtension, which will provide access to every behavior instantiated
We get the behavior called Test Sequence, which is a main behavior (Sequential Combination)
We retrieve the behavior called "Display Information" under the sequence
and the behavior called VBScript
The method GetItem allows to retrieve a behavior of a sequence with its name
It is possible to access to any behavior of a sequence
the "Parent" method retrieves the owner of the behavior its called on
It is possible to retrieve the type,and the list of behaviors
From the main behavior, we can get the list of every behaviors defined under it.
ExtensionBehavior Parent is retrieved: it is the name of the extended object : here, Part1
As ParentBehavior is a sequence, we can access to any behavior of it using the "Item" method on "Behaviors"
This is another way than GetItem to access to a behavior
We display the name of the Information behavior to control it is the same as retrieved before by GetItem method.
The TestInput method ensures that the searched input attribute exists, before effectively retrieving it with GetInput
We create a parameter P2 of type LENGTH under the Part. Its value is set to 100
Now we retrieve the output attribute called "MyExternal" of the "VBScript" behavior
We test that this outupt attribute exists with TestOutput method
The PutOutput methods assigns a value to an output attribute of a running Behavior
The Behavior2 has to be in executing mode, that's why we call the Start method on the VBScript behavior.