get_selection

The selection of viewport (default the primary slot): { nodeIds, elements?, level? }. nodeIds sorted; elements one TargetRef per node, handle and domain, ids sorted, absent when empty; level the slot's selection level ('object', 'face', 'edge', 'point').

Query

Usage

TypeScript
surface.query('get_selection', { viewport? })

Parameters

  • viewportstring

    the viewport slot (default the primary one)

    Optional

Returns

object with nodeIds, elements, level, in the ok: true envelope.

JSON
{
  "type": "object",
  "properties": {
    "nodeIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "elements": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "elements": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "string",
                "enum": [
                  "point",
                  "edge",
                  "face",
                  "curve",
                  "topology-edge"
                ]
              },
              "ids": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": -2147483648,
                  "maximum": 2147483647
                }
              },
              "from": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": -2147483648,
                  "maximum": 2147483647
                }
              },
              "handleId": {
                "type": "string"
              }
            },
            "required": [
              "domain",
              "ids",
              "handleId"
            ]
          }
        },
        "required": [
          "nodeId",
          "elements"
        ]
      }
    },
    "level": {
      "type": "string",
      "enum": [
        "object",
        "face",
        "edge",
        "point"
      ]
    }
  },
  "required": [
    "nodeIds",
    "level"
  ]
}

See also