|
Create the Loop Referencing the User Feature (UDF)
-
Open the
KwrLoop3.CATPart. The following image is displayed.
-
From the Start>Knowledgeware menu, access the
Knowledge Advisor workbench.
-
Click the Loop icon ()
in the Control Features bar. The Loop Edition window is
displayed.
-
In the specification tree, select the inputs of the loop.
|
|
|
|
Note that the name indicated in the Input name
field is the one that will be used in the loop body. |
-
Select the context, that is to say, in this scenario, the
feature that will contain the instantiated holes.
-
Indicate the number of holes that you want to instantiate
into the surface.
|
|
-
In the specification tree, click ListSize=24.
Click OK when done. The number of instantiated holes
is now valuated by a formula based on the list, that is to say on
the number of points contained in the list.
|
-
Enter the following action script into the Editor.
|
-
Use the
import keyword to indicate the path of the file containing
the User Feature (UDF) to be instantiated (KwrLoop1.CATPart).
-
To indicate the path of the file, it is
recommended to use
Insert File
Path available in the contextual menu to import
KwrLoop1.CATPart. (1)
|
|
|
-
Position is a point and also the first input that
needs to be valuated when instantiating the holes. PointsList[$i$]
is the name of the List. [$i$] corresponds to the nth item of the
list. In this case, nth is equal to 24, the number of holes to be
instantiated (3).
|
|
|
|
For more information about the syntax to be used
(;, {}, $i$) in the loop body, see Using
the Scripting Language. |
-
Click OK when done. The holes are instantiated
(see graphic below.)
-
Click the Update icon ()
to update the document.
-
Right-click the loop and use the Properties
command to rename the loop into Loop_Holes. Click OK when
done.
-
In the specification tree, right-click the loop (located
below the Relations node) and select the Loop_Holes
object>Deactivate command.
Save the Loop in a Power Copy
-
Click the root of the specification tree,
and from the Start>Mechanical Design menu, access the
Part Design workbench.
-
From the Insert>Advanced Replication
Tools menu, select PowerCopy Creation.... The Power Copy
Definition window is displayed.
-
In the specification tree, select the items
making up the Power Copy:
|
|
Note that the Power Copy will need the following inputs at
instantiation time:
-
ListSize
-
Line.2
-
Clearance_Surface
-
List_PointsRef
-
ResultBody
|
|
|
-
Click OK when done. The Power
Copy is created and is displayed below the Power Copy node in the
specification tree.
-
Save your file and close it.
Instantiate the Power Copy into an Existing Document
-
Open the
KwrLoop4.CATPart file. The following image is displayed.
-
From the Insert menu, select
Instantiate From Document....
-
In the File Selection window,
select the KwrLoop3.CATPart file that you have saved and click Open.
The Insert Object dialog box is displayed.
-
Valuate the inputs of the Power Copy.
To do so, in the specification tree, click:
|
|
-
Click OK when done. The Loop and
the formula contained in the Power Copy are instantiated.
-
To instantiate the holes, activate the loop.
To do so, right-click Loop.1 in the specification tree and select
Loop.1 object>Activate. The holes are instantiated.
|