|
-
Open the
KwrEventValueChange.CATPart file: It contains 3 points and a spline
(called cable in this scenario).
-
From the Start > Knowledgeware menu, access
the Product Engineering Optimizer workbench and click the Optimize
icon ().
The Optimization window opens.
-
Enter the following data in the Optimization window:
Problem tab |
|
|
Optimization type |
Minimization |
Optimized parameter |
distance |
Free parameters |
Geometrical Set.1\Point.3\Z |
Algorithm |
Simulated Annealing-Convergence speed |
Termination criteria |
Maximum number of updates: 100
Consecutive updates without improvements: 20
Maximum time (minutes): 5 |
Constraints tab |
|
|
New constraint |
`Geometrical Set.1\Point.3\Z`
- max (Geometrical Set.1\Point.2\Z
,Geometrical Set.1\Point.1\Z)
<= 0mm |
-
Click OK in the opening dialog box, click
Run optimization.
-
Select an output file and click Save.
-
Click OK when the optimization process
is over.
-
From the Start > Knowledgeware menu, access
the Knowledge Advisor workbench and click the Reaction icon ().
The Reaction dialog box opens.
|
- In the Source type field, select Selection
and select the CableLength parameter in the specification tree
for the Reaction to be applied to the CableLength parameter.
|
|
- From the Available events list, select
ValueChange.
|
|
- In the Action field, select VB action.
|
|
-
Click Edit action..., paste the following
script in the editor, and click OK twice:
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim relations1 As Relations
Set relations1 = part1.Relations
Dim optimizations1 As Optimizations
Set optimizations1 = relations1.Optimizations
Dim anyObject1 As Optimization
Set anyObject1 = optimizations1.Item("Optimization.1")
anyObject1.Run False |
The reaction is added to the specification tree. |
|
-
Double-click twice the CableLength=400mm
parameter and change its value to 600mm: The optimization is launched
(the RealLength and the distance parameters have changed) and the
geometry is changed accordingly.
|