Creating and Using a Knowledge Advisor Law

A Knowledge Advisor law is a relation whereby a parameter is defined with respect to another. Both parameters involved in a law are called formal parameters. Formal parameters and laws are specifically designed to be used in the creation of shape design parallel curves. A Generative Shape Design law can be used in a Knowledge Advisor law. The scenario which is developed below illustrates how to create a Knowledge Advisor law, then use a combination of a Generative Shape Design law and a Knowledge Advisor law in the same relation. 

The Evaluate method is to be used to calculate a parameter value when this parameter is defined by a Generative Shape Design law.

Laws only specify a relation between one parameter and another single parameter.

Note that the result you obtain on completion of this task depends on the initial lines. You can replay the scenario with different lines and see how it affects the result.
  1. Access the Generative Shape Design workbench and create a line (or any curve) in the xy plane.

  2. Access the Knowledge Advisor workbench and click the   icon. A dialog box similar to the one below is displayed. This editor is similar to the other relation editors. If need be, replace the default values specified in the dialog box fields.

  3. Click OK. The law editor is displayed. The right-hand part allows you to create the parameters to be used in the law. The left-hand part is the law edition box.

  4. Create two real type parameters FormalReal.1 and FormalReal.2, then enter the law below into the edition window:
    FormalReal.1 = 5*sin(5*PI*1rad*FormalReal.2)+ 10

  5. Click OK to add the law to the document. The Law.1 feature is added to the specification tree right below the Relations node.

  6. Select your document root feature and re-access the Generative Shape Design workbench.

  7. Click the   icon to create a curve parallel to the line created at the very beginning of the scenario. The Parallel Curve Definition dialog box is displayed.

  8. Fill in the Parallel Curve Definition dialog box (see the figure below). If need be, refer to the Generative Shape Design User's Guide for how to create a parallel curve depending on a law. The parallel curve which is created is of sinusoidal shape.

 

Note that only positive laws, i.e. with positive values only, can be used when creating parallel curves (positive is to be understood as "strictly positive").

 

  1. Create another line (Line.2) in the xy plane then click the icon to define a Shape Design Law. Mindabout the restrictions related to the features to be used as inputs when creating a law.

The icon is only visible if the Law option has been selected in View->Toolbars.

  1. Go back to the Knowledge Advisor workbench. Edit the Law.1 Knowledge Advisor law (the one which is right below the Relations node) and replace its definition with: 

    FormalReal.1 = (sin(5*PI*1rad*FormalReal.2)+ 6)*Open_body.1\Law.2 .Evaluate(FormalReal.2)


    In the law above, Law.2 is the Generative Shape Design law (if need be, replace this name with the name of the law you have just created). The result you obtain on screen depends of course on the lines you have created.

    The KwxLaws.CATPart sample illustrates this scenario.

    The Evaluate method should be used to compute the result. The result you obtain when you apply the modified Knowledge Advisor law depends on the Line.2 definition.

Up Next