Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Editing drawing annotations

Dmytro_Zaitsev
Dmytro_Zaitsev Member Posts: 9 ✭

Hello,

I’m working with the Drawing API and trying to manage General Tables (Onshape::Table::GeneralTable) programmatically.

I’m able to create a table successfully using onshapeCreateAnnotations, and I receive a valid logicalId (e.g. h:100000F5) from the modification status.

However, I’m running into issues when trying to update or delete the table.

1. Editing table content

I tried updating the table using onshapeEditAnnotations:

  • Referencing the table via logicalId
  • Sending updated cells (changing content)
  • Also tried changing rows / columns

Example

{
  "description": "Update table",
  "jsonRequests": [
    {
      "formatVersion": "2021-01-01",
      "messageName": "onshapeEditAnnotations",
      "annotations": [
        {
"logicalId": "h:100000F5", "table": { "logicalId": "h:100000F5", "cells": [ { "column": 0, "content": "NEW 123", "row": 0 } ], "columns": 1, "rows": 1,
"position": { "coordinate": [ 4.0, 4.0, 0.0 ], "type": "Onshape::Reference::Point" } }, "type": "Onshape::Table::GeneralTable" } ] } ] }

Result:

  • modify → 200 OK
  • status → DONE, status: OK
  • but no visible changes in the drawing

Interestingly:

  • Updating position does work
  • Updating cells, rows, columns → no visible effect

2. Deleting the table

I also tried deleting the table using:

{
  "description": "Delete table",
  "jsonRequests": [
    {
      "formatVersion": "2021-01-01",
      "messageName": "onshapeEditAnnotations",
      "annotations": [
        {
          "logicalId": "h:100000F5",
          "table": {
            "logicalId": "h:100000F5"
            
          },
          "type": "Onshape::Table::GeneralTable"
        }
      ]
    }
  ]
}

Same behavior:

  • request succeeds
  • status = DONE
  • table is not deleted

Questions

  1. Is it currently supported to edit table cell content (cells[].content) for Onshape::Table::GeneralTable via API?
  2. Are rows / columns editable after creation?
  3. What is the correct way to delete a table annotation?
  4. Is the expected pattern to delete + recreate tables instead of editing them?
  5. Are there additional required fields (e.g. formatting / bounding box / full cell set) when editing tables?