Skip to main content

system.kanoa.tooling.saveCompatibilityRule(ruleInfo, userId)

Adds a fit rule, or changes one (with toolingCompatibilityId). Give one child and one parent. A machine must use tooling, and be in the tool's site when the tool belongs to one; a parent tool must hold inserts. The same child and parent can't have two rules. Tools already mounted aren't checked again; the rule applies from the next mount.


Parameters​

ruleInfo Dictionary

- toolingCompatibilityIdIntegerTo change one; None adds one
- childToolingAssetIdIntegerThe tool the rule is for, or
- childAssetTypeIdIntegerevery tool of this tooling type
- parentAssetIdIntegerA machine the tool fits, or
- parentToolingAssetIdIntegera tool whose pockets it fits, or
- parentAssetTypeIdIntegeran asset type it fits (machines or tools of that type)
- enabledBooleanDefault True

userId Integer: The user making the change


Returns​

(toolingCompatibilityId, message): the rule's id and None, or None and why it was refused


Example​

ruleInfo = {'childToolingAssetId': 1, 'parentAssetId': 2}
userId = 5
toolingCompatibilityId, message = system.kanoa.tooling.saveCompatibilityRule(ruleInfo, userId)