This topic provides you with instructions concerning the instantiation of User Features from VB Macros. Two different protocols are available to instantiate User Features.
To instantiate a User Feature from a VB macro:
Develop your macro in an editor and save it with the CATScript extension. (Read carefully the instructions below to know how to structure your script.)
From the Tools>Macro>Macros... command, access the Macros dialog box in CATIA. Click Macro libraries....
In the Macro libraries dialog box, select the Directories option from the Library type scrolling list.
In the Open a directory of macros dialog box, select the directory that contains the VB script you have created. Click OK when done. Click Close in the Macro libraries dialog box: The macro contained in this directory is displayed in the Macros dialog box.
Click Run. Your macro is run and your User Feature is instantiated.
Note that:
| IWO (In Work Object) | UDF Solid | UDF Surfacic | PC Surfacic Feature (from GS) | PC Surfacic Feature (from 0GS) | PC Solid feature (From Body | PC Surfacic Set (from GS) |
| Surfacic Set (GS) | Inside Solid Set | Inside Surfacic Set | Inside Surfacic Set | - | - | Inside Surfacic Set |
| Solid Set (Body) | Inside Solid Set | Inside Solid Set | - | Inside Solid Set | Inside Solid Set | - |
| Solid Feature | After IWO Feature | After IWO Feature | - | After IWO Feature | Inside Solid Set, After the last Feature (not after the IWO) | - |
| Surfacic feature in Solid Set | After IWO Feature | After IWO Feature | - | After IWO Feature | Inside Solid Set, After the last Feature (not after the IWO) | End of the Spec tree |
| Surfacic feature in Surfacic Set (OGS) | Inside Solid Set | Inside Surfacic Set | - | After IWO Feature |
- |
End of the Spec tree |
|
|
The first protocol is dedicated to User Feature instantiation only. It
is defined by a single method: AddInstance (For more information about this
method, see the Automation documentation).
Note that:
|
||||||
|
|
The instantiation process can be broken down into
the following steps:
|
To get an example, see Instantiating a User Feature From a VB Macro.
|
|
The second protocol is dedicated to User Features and
Power
Copies instantiation. It is defined by several methods that must be
called in order. Note that it is recommended to use this protocol to perform several instantiations of the same reference in a loop. |
||||||||||||
|
|
From the Instance Factory
(A), the instantiation process can be
broken down into 3 major steps, the second step itself being broken down
into 5 different steps.
|