Skip to main content

system.kanoa.attribute.addAttributeAssetLink

This function is part of the kanoaOPS module

Description

Adds a new attribute asset link.

Syntax

addAttributeAssetLink(attrAssetInfo, userId)
  • Parameters
      dictionary attrAssetInfo - {'attributeId': 3, 'assetId': 5, 'sourceTagPath': 'some tag path', 'scaleFactor': 1.0, 'ignoreZeroValues': True, 'enabled': True}
      int userId - User ID
  • Returns
      int attributeAssetLinkId - Newly created attribute asset link ID
      string msg - Message indicating the result
  • Code Examples

    # Example usage
    attrAssetInfo = {
    'attributeId': 3,
    'assetId': 5,
    'sourceTagPath': 'some tag path',
    'scaleFactor': 1.0,
    'ignoreZeroValues': True,
    'enabled': True
    }
    userId = 123
    attributeAssetLinkId, msg = system.kanoa.attribute.addAttributeAssetLink(attrAssetInfo, userId)
    print(attributeAssetLinkId, msg) # Print the attribute asset link ID and message