Asset Group Geometry

We’d like to make use of Asset Groups for some of our inspections but they lack geometry.

I’ve been attempting to create a workflow. Which triggers when the assets of a Asset Group Design are update. Using a relation node to get the attributes_itemsGeometry from the assets. Sadly GeometryCollection(geometryvar) only returns one of the assets geometry instead of a collection of them.



parameters = [{
      "attributeCode": "attributes_itemsGeometry",
      "value": {
        "script": "return GeometryCollection(geometryvar);",
        "discriminator": "WorkflowSyntaxNodeScriptWebModel"
      },
      "discriminator": "WorkflowComputedItemAttributeWebModel"
    }]

variables = [    {
      "name": "geometryvar",
      "value": {
        "outputAction": "67adc8068b2ef8de725ec707",
        "outputMode": "All",
        "itemValue": {
          "discriminator": "WorkflowSyntaxArgumentItemValueAttributeWebModel",
          "attributeCode": "attributes_itemsGeometry"
        },
        "discriminator": "WorkflowSyntaxNodeOutputWebModel"
      }
    },
  ]

Hello Howard

The GeometryCollection() method expects an array of geometry objects as input. You will need to convert your geometryvar variable this way:

"parameters": [
    {
      "attributeCode": "attributes_itemsGeometry",
      "value": {
        "script": "return geometryCollection;",
        "discriminator": "WorkflowSyntaxNodeScriptWebModel"
      },
      "discriminator": "WorkflowComputedItemAttributeWebModel"
    }
  ],
  "variables": [
    {
      "name": "geometryvar",
      "value": {
        "outputAction": "67adc8068b2ef8de725ec707",
        "itemValue": {
          "attributeCode": "attributes_itemsGeometry",
          "discriminator": "WorkflowSyntaxArgumentItemValueAttributeWebModel"
        },
        "outputMode": "All",
        "discriminator": "WorkflowSyntaxNodeOutputWebModel"
      }
    },
    {
      "name": "geometryCollection",
      "value": {
        "script": "return GeometryCollection(Variables.geometryvar.AllValues.Values.Select(x => x.SingleValue).ToArray());",
        "discriminator": "WorkflowSyntaxNodeScriptWebModel"
      }
    }
  ]```
1 Like