About Knowledgeware Scripts for View Update Rules

The view update rule uses the standard Knowledgeware rule editor.

The rule can have input and output arguments.

This page discusses:

See Also
Creating a View Update Rule Template
View Update Rule Samples

About Editing the Knowledgeware Scripts

The arguments are as explained below:

Argument Type Required Description
Input (of type Feature) Input Mandatory Gives the object being processed during the update. For a view update rule, this is ALWAYS of type Feature (the Knowledge type Feature, not to be confused with a Mechanical Feature). An object of type Feature can be anything, from a product occurrence to a VPMInstance or a wireframe element.
Result (of Type Boolean) Output Mandatory Defines if the component/feature in the input is actually being processed by the view update rule, so that it matches the conditions specified in the script.
ActionList (of Type List) Output Optional Contains the list of actions to perform.
InputOccurrence (of Type ProductOccurrence) Input Optional Contains the owning occurrence of the Representation Instance in case the input is an object inside the Representation Reference (so a Mechanical Feature or an application Feature). This argument is not created by default. You need to manually create it if needed.
InputView (of Type DrwView) Input - During the view update, this input parameter is filled automatically in the current view, which is being updated.

The view update rule script template must have these arguments. It cannot refer to any knowledge parameter or relation (formulas, rules, or actions) other than the above list of arguments. This is applicable only to the rules having templates.

A view update rule with no template can have the knowledge parameters or relations.

If a view update rule is created using a knowledgeware script and this script is written to run a rule on the feature level, then the product linked to the view must be loaded in the edit mode. Else the rule might not run on the feature while updating the view and the result can be incorrect. While updating the view, the product linked to the view is not loaded by default.

Tips:
  • While updating a view, to load all the 3D representations linked to the view so that the view update rule on feature is successful, right-click the view and select Properties. In the Generation tab, select the Pattern check box.
  • In Me > Preferences > Standards > generativeviewstyles, select Yes for the Pattern option. For more information, see Generate Parameters.

Feature Hierarchy Processed by the View Update Rule Knowledgeware Scripts

Drafting Template Design processes a hierarchy of features through the view update rules. If a rule returns a Result=TRUE for a given feature, none of child features (can be product occurrences of a product, can be representations of a product occurrence, can be bodies or geometrical sets of a representation) are processed by the view update rule or any next view update rule.

The features are processed repetitively in the following order:

  1. Product occurrence (starting from root product pointed by the view down), including Part occurrence
  2. Representation occurrence
  3. Bodies or geometrical sets of a representation (including SFD plates and profiles, and AGT features)

Repetitively means, that if no Result=TRUE was received for a Product, it then process the child occurrences of the Product, and restarts the above mentioned order for each child product occurrence found.

Note: Any feature inside a body or geometrical set is not processed individually.