NXOpen.UF.Kf.CreateRule

Kf.CreateRule()

Refer to UF_KF_create_rule for documentation.

Signature: CreateRule(nameChain, ruleName, ruleType, ruleText, leadingComment)

Parameters:
  • nameChain (str) – Reference chain of instance, with trailing colon, where rule will be created or modified
  • ruleName (str) – Name of rule
  • ruleType (str) – Type of rule. Type names may be obtained by calling UF_KF_ask_rule_types. This can also contain behavior flags, so “Number Parameter” is a valid rule_type, as is “Child”. If create “Child” then must be “Root:” or NULL. Child rules can only be created on the “Root:”
  • ruleText (str) – Text for rule. For an instance rule, this must must be enclosed in curly braces. For an attribute rule, just the formula
  • leadingComment (str) – Leading comment for rule. OPTIONAL-can be null. If non-null, make sure that the string is preceded by the pound sign ‘#’ and followed by a new-line character ‘n’ Example: “#Leading Commentn”

License requirements: None