RuleManager Class¶
-
class
NXOpen.
RuleManager
¶ Bases:
object
Provides methods for manipulating the Knowledge Fusion rules in a part.
To obtain an instance of this class, refer to
NXOpen.BasePart
New in version NX3.0.0.
Properties¶
Property | Description |
---|---|
CreateMode | Returns the create mode flag. |
DebugFlag | Returns or sets the debug update flag. |
Methods¶
Method | Description |
---|---|
AdoptObjects | Adopt the specified ug objects. |
Copy | Copy a dynamic child or attribute rule. |
CreateChildRule | Create a child rule and the root for this rule manager’s part. |
CreateDynamicRule | Create or modify a dynamic rule. |
DeleteChildRule | Delete a child rule from this rule manager. |
DeleteDynamicRule | Delete an existing dynamic rule. |
DoKfUpdate | Performs an KF update. |
Evaluate | Evaluate a rule and return its value. |
EvaluateAnyAsString | Evaluate a rule and return its value as a string. |
EvaluateAsString | Evaluate a rule and return its value as a string. |
GetAdoptableTypes | The list of object types which can be adopted. |
GetAncestorClasses | Get the ancestor classes for a given class. |
GetClass | Get the class of a dynamic rule. |
GetClassDfaFile | Get the name of the dfa file that contains the specified class. |
GetClasses | Get class names that match the specified filter. |
GetClassesOfChildList | Get the classes for the members of a child list rule. |
GetDebugInstances | Get the debug update instances. |
GetDefaultFormula | Returns the default formula for a rule within a class . |
GetDependencies | Get the rules that the specified dynamic rule depends on. |
GetDependents | Get the rules that depend on the specified dynamic rule. |
GetDynamicRuleText | Returns the rule text for a dynamic rule . |
GetDynamicRules | Get the names of all dynamic rules defined on a child rule (or Root:). |
GetErrorEnd | Get the parse error end location. |
GetErrorStart | Get the parse error start location. |
GetFunctionArgumentsInformation | Get information about the arguments for a function. |
GetFunctionFile | Get the file that contains the definitions for a function. |
GetFunctionInformation | Get information about a function. |
GetFunctions | Get functions that match the specified filter. |
GetLastError | Get messages for the most recent error. |
GetNameChain | Returns the name chain |
GetObjectOfInstance | Get object of instance |
GetObjectText | Get the text to use when referencing the specified ug object in a rule. |
GetParameterFormula | Get the formula for a parameter that has been specified on a dynamic child rule. |
GetParameterType | Get the type of a parameter in a dynamic child rule. |
GetReferenceText | Get the text to use when referencing the specified ug object in a rule. |
GetRuleType | Get the type of a rule within a class. |
GetRuleTypes | Get strings that describe the rule types. |
GetRulesForObjects | Adoption text for the specified ug objects. |
GetRulesOfClass | Get the names of all the rules defined in a class. |
GetSpecifiedParameters | Get the parameters that have been specified on a dynamic child rule. |
Initialize | Initialize the RuleManager. |
IsCanonical | Returns whether a rule within a class is canonical. |
IsChildList | Returns whether a rule within a class is a child list rule. |
IsChildRule | Returns whether a rule in a class is a child rule. |
IsComputed | Returns whether a dynamic rule’s value has been computed yet. |
IsExpressionRule | Determine whether a root level dynamic rule is mapped to an NX expression. |
IsHidden | Returns whether a rule within a class is hidden. |
IsLocal | Returns whether a rule within a class is local to that class. |
IsMethod | Returns whether a rule within a class is a method. |
IsModifiable | Returns whether a rule within a class is modifiable. |
IsParameter | Returns whether a rule within a class is a parameter of that class. |
IsRuleInClass | Returns whether the rule is defined in the specified class. |
IsUncached | Returns whether a rule within a class is uncached. |
IsUserClass | Determine whether a class is a user class. |
IsUserFunction | Determine whether a function is one defined by the user. |
ReadDfaFile | Read a dfa file and return its contents as a string. |
RebuildTrees | Rebuilds the KF Navigator tree and any Part Inspector trees that are being shown. |
RegenerateAll | Regenerate all rules. |
Reload | Reload all classes and functions. |
ReloadClassesAndFunctions | Reload specified classes and functions. |
ReloadSingleClass | Reload a single class. |
RemoveAllRules | Remove all rules in the part. |
RemoveRuleOnly | Remove a dynamic child or attribute rule, but leave the geometry. |
Rename | Rename a dynamic child or attribute rule. |
SyntaxCheck | Run the syntax check on a dfa file. |
WriteDfaFile | Write a string out to a dfa file. |
Enumerations¶
RuleManagerFilter Enumeration | The filter option for asking for classes. |
RuleManagerInitializationStatusType Enumeration | Indicates the status from initializing RuleManager. |
RuleManagerLicenseType Enumeration | Indicates the license type to be used. |
RuleManagerRuleType Enumeration | Indicates the data type of a rule. |
Structs¶
RuleManagerAdoptableTypes_Struct Struct | Used to return adoptable object types. |
RuleManagerDebugInstance_Struct Struct | Used to return debug update information for instances. |
RuleManagerDebugRule_Struct Struct | Used to return debug update information for rules. |
RuleManagerFunctionArgumentsInformation_Struct Struct | Used to return information about the arguments for a function. |
RuleManagerFunctionInformation_Struct Struct | Used to return information about a function. |
RuleManagerParameterRule_Struct Struct | Used to specify parameter values for child rule creation or modification. |
Property Detail¶
CreateMode¶
-
RuleManager.
CreateMode
¶ Returns the create mode flag.
-------------------------------------
Getter Method
Signature
CreateMode
Returns: Return type: bool New in version NX5.0.0.
License requirements: None.
DebugFlag¶
-
RuleManager.
DebugFlag
¶ Returns or sets the debug update flag.
-------------------------------------
Getter Method
Signature
DebugFlag
Returns: Return type: bool New in version NX5.0.0.
License requirements: None.
-------------------------------------
Setter Method
Signature
DebugFlag
Parameters: debugFlag (bool) – New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
Method Detail¶
AdoptObjects¶
-
RuleManager.
AdoptObjects
¶ Adopt the specified ug objects.
Signature
AdoptObjects(ugObjects)
Parameters: ugObjects (list of NXOpen.NXObject
) – objects to adoptReturns: TRUE if update needs to be called Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
Copy¶
-
RuleManager.
Copy
¶ Copy a dynamic child or attribute rule.
Signature
Copy(oldNameChain, oldLeafName, newNameChain, newLeafName)
Parameters: - oldNameChain (str) – Name chain for rule to copy
- oldLeafName (str) – Leaf name of rule to copy
- newNameChain (str) – Name chain for copied rule
- newLeafName (str) – Leaf name for copied rule
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
CreateChildRule¶
-
RuleManager.
CreateChildRule
¶ Create a child rule and the root for this rule manager’s part.
Signature
CreateChildRule(ruleName, className, parameters)
Parameters: - ruleName (str) – Name of child rule to create
- className (str) – Class to instantiate as this child
- parameters (list of
NXOpen.RuleManagerParameterRule_Struct
) – Input parameters for this class
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
CreateDynamicRule¶
-
RuleManager.
CreateDynamicRule
¶ Overloaded method CreateDynamicRule
CreateDynamicRule(referenceChain, ruleName, ruleType, ruleText)
CreateDynamicRule(referenceChain, ruleName, behaviors, ruleUnits, ruleText, leadingComment)
CreateDynamicRule(referenceChain, ruleName, behaviors, ruleText, leadingComment)
-------------------------------------
Create or modify a dynamic rule.
Signature
CreateDynamicRule(referenceChain, ruleName, ruleType, ruleText)
Parameters: - referenceChain (str) – Reference chain for instance in which to create the dynamic rule
- ruleName (str) – Name of rule to create
- ruleType (
NXOpen.RuleManagerRuleType
) – Data type for the new rule - ruleText (str) – Value for the new rule as a string
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Create or modify a dynamic rule.
Signature
CreateDynamicRule(referenceChain, ruleName, behaviors, ruleUnits, ruleText, leadingComment)
Parameters: - referenceChain (str) – Reference chain for instance in which to create the dynamic rule
- ruleName (str) – Name of rule to create
- behaviors (str) – Behaviors for the new rule, for example, “Number Modifiable”
- ruleUnits (str) – Unit for the new rule, for example, “mm”
- ruleText (str) – Value for the new rule as a string
- leadingComment (str) – Leading comment of the form “#+ #-” for rule. This can be NULL
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Create or modify a dynamic rule.
Signature
CreateDynamicRule(referenceChain, ruleName, behaviors, ruleText, leadingComment)
Parameters: - referenceChain (str) – Reference chain for instance in which to create the dynamic rule
- ruleName (str) – Name of rule to create
- behaviors (str) – Behaviors for the new rule, for example, “Number Modifiable”
- ruleText (str) – Value for the new rule as a string
- leadingComment (str) – Leading comment of the form “#+ #-” for rule. This can be NULL
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
DeleteChildRule¶
-
RuleManager.
DeleteChildRule
¶ Delete a child rule from this rule manager.
Signature
DeleteChildRule(ruleName)
Parameters: ruleName (str) – Name of child to delete New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
DeleteDynamicRule¶
-
RuleManager.
DeleteDynamicRule
¶ Delete an existing dynamic rule.
Signature
DeleteDynamicRule(referenceChain, ruleName)
Parameters: - referenceChain (str) – Reference chain for instance from which to delete the dynamic rule
- ruleName (str) – Name of rule to delete
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
DoKfUpdate¶
-
RuleManager.
DoKfUpdate
¶ Performs an KF update.
This ensures that all KF objects will be properly updated when created through dynamic rules.
Note: This method does the same thing as,
Update.DoUpdate()
except that it does some addition updating to make sure CAE objects are complete.Signature
DoKfUpdate(undoMark)
Parameters: undoMark (int) – If any update error occurs, the system will roll back to this undo mark. Returns: The number of errors in the update module’s error list. If errors occurred during update they will be added to that error list. To obtain a list of these errors, use
Update.ErrorList()
:rtype: intNew in version NX4.0.0.
License requirements: None.
Evaluate¶
-
RuleManager.
Evaluate
¶ Evaluate a rule and return its value.
Signature
Evaluate(referenceChain)
Parameters: referenceChain (str) – Reference chain for the rule to evaluate Returns: Value of the rule which may have one of many types depending on the rule type Return type: Variant New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
EvaluateAnyAsString¶
-
RuleManager.
EvaluateAnyAsString
¶ Evaluate a rule and return its value as a string.
Signature
EvaluateAnyAsString(referenceChain)
Parameters: referenceChain (str) – Reference chain for the rule to evaluate Returns: Value of the rule formatted as a string Return type: str New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
EvaluateAsString¶
-
RuleManager.
EvaluateAsString
¶ Evaluate a rule and return its value as a string.
Signature
EvaluateAsString(referenceChain)
Parameters: referenceChain (str) – Reference chain for the rule to evaluate Returns: Value of the rule formatted as a string Return type: str New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
GetAdoptableTypes¶
-
RuleManager.
GetAdoptableTypes
¶ The list of object types which can be adopted.
Signature
GetAdoptableTypes()
Returns: Object type data Return type: list of NXOpen.RuleManagerAdoptableTypes_Struct
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetAncestorClasses¶
-
RuleManager.
GetAncestorClasses
¶ Get the ancestor classes for a given class.
Signature
GetAncestorClasses(className)
Parameters: className (str) – class name for which to get component classes Returns: names of ancestor classes Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetClass¶
-
RuleManager.
GetClass
¶ Get the class of a dynamic rule.
Signature
GetClass(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Class of rule Return type: str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetClassDfaFile¶
-
RuleManager.
GetClassDfaFile
¶ Get the name of the dfa file that contains the specified class.
Signature
GetClassDfaFile(className)
Parameters: className (str) – Class name Returns: File name that contains the class Return type: str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetClasses¶
-
RuleManager.
GetClasses
¶ Get class names that match the specified filter.
Signature
GetClasses(filter)
Parameters: filter ( NXOpen.RuleManagerFilter
) – filter for classesReturns: class names Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetClassesOfChildList¶
-
RuleManager.
GetClassesOfChildList
¶ Get the classes for the members of a child list rule.
Signature
GetClassesOfChildList(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Classes for members of child list Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetDebugInstances¶
-
RuleManager.
GetDebugInstances
¶ Get the debug update instances.
Signature
GetDebugInstances()
Returns: a tuple Return type: A tuple consisting of (instances, rules). instances is a list of NXOpen.RuleManagerDebugInstance_Struct
. Array of instances rules is a list ofNXOpen.RuleManagerDebugRule_Struct
. Array of rulesNew in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
GetDefaultFormula¶
-
RuleManager.
GetDefaultFormula
¶ Returns the default formula for a rule within a class .
Signature
GetDefaultFormula(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: The default formula for the rule
Return type: str
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
GetDependencies¶
-
RuleManager.
GetDependencies
¶ Get the rules that the specified dynamic rule depends on.
Signature
GetDependencies(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Reference chains for rules depending on the specified rule Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetDependents¶
-
RuleManager.
GetDependents
¶ Get the rules that depend on the specified dynamic rule.
Signature
GetDependents(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Reference chains for dependent rules Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetDynamicRuleText¶
-
RuleManager.
GetDynamicRuleText
¶ Returns the rule text for a dynamic rule .
Signature
GetDynamicRuleText(referenceChain)
Parameters: referenceChain (str) – name chain for a dynamic rule Returns: The text of the rule Return type: str New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
GetDynamicRules¶
-
RuleManager.
GetDynamicRules
¶ Get the names of all dynamic rules defined on a child rule (or Root:).
Signature
GetDynamicRules(childRuleName)
Parameters: childRuleName (str) – reference chain of child rule Returns: Array of dynamic rule names in the child Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetErrorEnd¶
-
RuleManager.
GetErrorEnd
¶ Get the parse error end location.
Signature
GetErrorEnd()
Returns: ending character pointer Return type: int New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
GetErrorStart¶
-
RuleManager.
GetErrorStart
¶ Get the parse error start location.
Signature
GetErrorStart()
Returns: starting character pointer Return type: int New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
GetFunctionArgumentsInformation¶
-
RuleManager.
GetFunctionArgumentsInformation
¶ Get information about the arguments for a function.
Signature
GetFunctionArgumentsInformation(functionName, instanceOrClassName, isInstance, briefOnly)
Parameters: - functionName (str) – Function name
- instanceOrClassName (str) – Instance or class name (used only for a method)
- isInstance (bool) – TRUE if instance name passed, FALSE otherwise
- briefOnly (bool) – TRUE if returning brief information only
Returns: Information about the function arguments
Return type: list of
NXOpen.RuleManagerFunctionArgumentsInformation_Struct
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetFunctionFile¶
-
RuleManager.
GetFunctionFile
¶ Get the file that contains the definitions for a function.
Signature
GetFunctionFile(functionName)
Parameters: functionName (str) – Function name Returns: File where the function is defined Return type: str New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
GetFunctionInformation¶
-
RuleManager.
GetFunctionInformation
¶ Get information about a function.
Signature
GetFunctionInformation(functionName, instanceOrClassName, isInstance, briefOnly)
Parameters: - functionName (str) – Function name
- instanceOrClassName (str) – Instance or class name (used only for a method otherwise null or Nothing
- isInstance (bool) – TRUE if instance name passed, FALSE otherwise
- briefOnly (bool) – TRUE if returning brief information only
Returns: Information about the function
Return type: New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetFunctions¶
-
RuleManager.
GetFunctions
¶ Get functions that match the specified filter.
Signature
GetFunctions(filter, doSort)
Parameters: - filter (
NXOpen.RuleManagerFilter
) – filter for functions - doSort (bool) – TRUE to get the functions sorted alphabetically
Returns: function names
Return type: list of str
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
- filter (
GetLastError¶
-
RuleManager.
GetLastError
¶ Get messages for the most recent error.
Signature
GetLastError()
Returns: lines for error messages Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetNameChain¶
-
RuleManager.
GetNameChain
¶ Returns the name chain
Signature
GetNameChain(ugObject)
Parameters: ugObject ( NXOpen.NXObject
) – object to find name chainReturns: full name chain of the object Return type: str New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
GetObjectOfInstance¶
-
RuleManager.
GetObjectOfInstance
¶ Get object of instance
Signature
GetObjectOfInstance(nameChain)
Parameters: nameChain (str) – Name chain of instance Returns: object of instance Return type: NXOpen.NXObject
New in version NX9.0.0.
License requirements: gateway (“UG GATEWAY”)
GetObjectText¶
-
RuleManager.
GetObjectText
¶ Get the text to use when referencing the specified ug object in a rule.
Signature
GetObjectText(ugObject)
Parameters: ugObject ( NXOpen.NXObject
) – object to find object text forReturns: Object text, either reference_chain or hostpointer text Return type: str New in version NX8.5.0.
License requirements: gateway (“UG GATEWAY”)
GetParameterFormula¶
-
RuleManager.
GetParameterFormula
¶ Get the formula for a parameter that has been specified on a dynamic child rule.
Signature
GetParameterFormula(referenceChain, parameterName)
Parameters: - referenceChain (str) – Reference chain for rule
- parameterName (str) – Parameter name
Returns: Formula for the specified parameter
Return type: str
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetParameterType¶
-
RuleManager.
GetParameterType
¶ Get the type of a parameter in a dynamic child rule.
Signature
GetParameterType(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Data type required for this rule Return type: NXOpen.RuleManagerRuleType
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetReferenceText¶
-
RuleManager.
GetReferenceText
¶ Get the text to use when referencing the specified ug object in a rule.
Note that the rule text may reference the container object rather than the given object. For example, the rule text may reference the owning CSYS feature rather than the given datum plane or datum axis. If the rule text of the given object is desired then call
RuleManager.GetObjectText()
.Signature
GetReferenceText(ugObject)
Parameters: ugObject ( NXOpen.NXObject
) – object to find reference text forReturns: Reference text, either reference_chain or hostpointer text Return type: str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetRuleType¶
-
RuleManager.
GetRuleType
¶ Overloaded method GetRuleType
GetRuleType(className, ruleName)
GetRuleType(referenceChain)
-------------------------------------
Get the type of a rule within a class.
Signature
GetRuleType(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: Data type required for this rule
Return type: New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Get the data type of a dynamic rule.
Signature
GetRuleType(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Data type of the rule Return type: NXOpen.RuleManagerRuleType
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
GetRuleTypes¶
-
RuleManager.
GetRuleTypes
¶ Get strings that describe the rule types.
Signature
GetRuleTypes()
Returns: strings for rule types Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetRulesForObjects¶
-
RuleManager.
GetRulesForObjects
¶ Adoption text for the specified ug objects.
Signature
GetRulesForObjects(ugObjects)
Parameters: ugObjects (list of NXOpen.NXObject
) – objects to adoptReturns: Output text for the objects Return type: str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
GetRulesOfClass¶
-
RuleManager.
GetRulesOfClass
¶ Get the names of all the rules defined in a class.
Signature
GetRulesOfClass(className)
Parameters: className (str) – Class name Returns: Array of names of rules in the class Return type: list of str New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
GetSpecifiedParameters¶
-
RuleManager.
GetSpecifiedParameters
¶ Get the parameters that have been specified on a dynamic child rule.
Signature
GetSpecifiedParameters(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: Array of names of parameters specified Return type: list of str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
Initialize¶
-
RuleManager.
Initialize
¶ Initialize the RuleManager.
Signature
Initialize(licenseToTake)
Parameters: licenseToTake ( NXOpen.RuleManagerLicenseType
) – Which license to takeReturns: a tuple Return type: A tuple consisting of (status, intentStatus). status is a NXOpen.RuleManagerInitializationStatusType
. Status from initializing RuleManager intentStatus is a int. Status from initializing subsystemNew in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
IsCanonical¶
-
RuleManager.
IsCanonical
¶ Returns whether a rule within a class is canonical.
Signature
IsCanonical(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is canonical
Return type: bool
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
IsChildList¶
-
RuleManager.
IsChildList
¶ Overloaded method IsChildList
IsChildList(className, ruleName)
IsChildList(referenceChain)
-------------------------------------
Returns whether a rule within a class is a child list rule.
Signature
IsChildList(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is a child list rule
Return type: bool
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Returns whether a dynamic rule is a child list.
Signature
IsChildList(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: True if the rule is a child list Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
IsChildRule¶
-
RuleManager.
IsChildRule
¶ Overloaded method IsChildRule
IsChildRule(className, ruleName)
IsChildRule(referenceChain)
-------------------------------------
Returns whether a rule in a class is a child rule.
Signature
IsChildRule(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is a child rule
Return type: bool
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Returns whether a dynamic rule is a child rule.
Signature
IsChildRule(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: True if the rule is a child rule Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
IsComputed¶
-
RuleManager.
IsComputed
¶ Returns whether a dynamic rule’s value has been computed yet.
Signature
IsComputed(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: True if the rule’s value has been computed Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
IsExpressionRule¶
-
RuleManager.
IsExpressionRule
¶ Determine whether a root level dynamic rule is mapped to an NX expression.
Signature
IsExpressionRule(ruleName)
Parameters: ruleName (str) – Dynamic rule name Returns: True if the rule is an NX expression Return type: bool New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
IsLocal¶
-
RuleManager.
IsLocal
¶ Returns whether a rule within a class is local to that class.
Signature
IsLocal(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is local to the class
Return type: bool
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
IsMethod¶
-
RuleManager.
IsMethod
¶ Overloaded method IsMethod
IsMethod(className, ruleName)
IsMethod(referenceChain)
-------------------------------------
Returns whether a rule within a class is a method.
Signature
IsMethod(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is a method
Return type: bool
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Returns whether a dynamic rule is a method.
Signature
IsMethod(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: True if the rule is a method Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
IsModifiable¶
-
RuleManager.
IsModifiable
¶ Overloaded method IsModifiable
IsModifiable(className, ruleName)
IsModifiable(referenceChain)
-------------------------------------
Returns whether a rule within a class is modifiable.
Signature
IsModifiable(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is modifiable
Return type: bool
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Returns whether a dynamic rule is modifiable.
Signature
IsModifiable(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: True if the rule is modifiable Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
IsParameter¶
-
RuleManager.
IsParameter
¶ Returns whether a rule within a class is a parameter of that class.
Signature
IsParameter(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is a parameter of the class
Return type: bool
New in version NX3.0.0.
License requirements: gateway (“UG GATEWAY”)
IsRuleInClass¶
-
RuleManager.
IsRuleInClass
¶ Returns whether the rule is defined in the specified class.
Signature
IsRuleInClass(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is defined in the class
Return type: bool
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
IsUncached¶
-
RuleManager.
IsUncached
¶ Overloaded method IsUncached
IsUncached(className, ruleName)
IsUncached(referenceChain)
-------------------------------------
Returns whether a rule within a class is uncached.
Signature
IsUncached(className, ruleName)
Parameters: - className (str) – Class name
- ruleName (str) – Rule name within the class
Returns: True if the rule is uncached
Return type: bool
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
Returns whether a dynamic rule is uncached.
Signature
IsUncached(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule Returns: True if the rule is uncached Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
-------------------------------------
IsUserClass¶
-
RuleManager.
IsUserClass
¶ Determine whether a class is a user class.
Signature
IsUserClass(className)
Parameters: className (str) – Class name Returns: True if the class is a user class Return type: bool New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
IsUserFunction¶
-
RuleManager.
IsUserFunction
¶ Determine whether a function is one defined by the user.
Signature
IsUserFunction(functionName)
Parameters: functionName (str) – Function name Returns: True if the class is a user function Return type: bool New in version NX5.0.0.
License requirements: gateway (“UG GATEWAY”)
ReadDfaFile¶
-
RuleManager.
ReadDfaFile
¶ Read a dfa file and return its contents as a string.
Signature
ReadDfaFile(fileName)
Parameters: fileName (str) – File name to read Returns: Contents of the file formatted as a string Return type: str New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
RebuildTrees¶
-
RuleManager.
RebuildTrees
¶ Rebuilds the KF Navigator tree and any Part Inspector trees that are being shown.
Signature
RebuildTrees()
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
RegenerateAll¶
-
RuleManager.
RegenerateAll
¶ Regenerate all rules.
Signature
RegenerateAll()
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
Reload¶
-
RuleManager.
Reload
¶ Reload all classes and functions.
Signature
Reload(refreshUserClassDir)
Parameters: refreshUserClassDir (bool) – flag for whether to refresh search dirs after load New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
ReloadClassesAndFunctions¶
-
RuleManager.
ReloadClassesAndFunctions
¶ Reload specified classes and functions.
Signature
ReloadClassesAndFunctions(classes, functions)
Parameters: - classes (list of str) – names of classes to reload
- functions (list of str) – names of functions to reload
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
ReloadSingleClass¶
-
RuleManager.
ReloadSingleClass
¶ Reload a single class.
Signature
ReloadSingleClass(className)
Parameters: className (str) – class name to reload New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
RemoveAllRules¶
-
RuleManager.
RemoveAllRules
¶ Remove all rules in the part.
Signature
RemoveAllRules()
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
RemoveRuleOnly¶
-
RuleManager.
RemoveRuleOnly
¶ Remove a dynamic child or attribute rule, but leave the geometry.
Signature
RemoveRuleOnly(referenceChain)
Parameters: referenceChain (str) – Reference chain for rule to remove New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
Rename¶
-
RuleManager.
Rename
¶ Rename a dynamic child or attribute rule.
Signature
Rename(referenceChain, newName)
Parameters: - referenceChain (str) – Reference chain for rule to rename
- newName (str) – New leaf name
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
SyntaxCheck¶
-
RuleManager.
SyntaxCheck
¶ Run the syntax check on a dfa file.
Signature
SyntaxCheck(fileName)
Parameters: fileName (str) – dfa file to check New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)
WriteDfaFile¶
-
RuleManager.
WriteDfaFile
¶ Write a string out to a dfa file.
Signature
WriteDfaFile(fileName, fileString, replace)
Parameters: - fileName (str) – File name to write
- fileString (str) – String to write to file
- replace (bool) – if TRUE, replace the file if it exists
New in version NX4.0.0.
License requirements: gateway (“UG GATEWAY”)