import_blocks_from_excel
Inserts or updates AutoCAD blocks row by row from an Excel .xlsx sheet, with dry-run validation and single-undo batch updates.
Instructions
Insere ou atualiza blocos, linha a linha, a partir de uma planilha .xlsx. Um único Ctrl+Z desfaz tudo.
QUANDO USAR: carregar a tabela de suportes (TAG, TIPO, X, Y, Z, LINHA...) no desenho. FLUXO SEGURO: dry_run=true primeiro (relata inserir/atualizar/erro por linha sem tocar no desenho), depois execute. Inserções não pedem confirmação; se alguma linha ATUALIZA um bloco existente, exige confirm=true. Parâmetros: path/sheet/header_row; mapping ({coluna_excel: alvo}, alvo ∈ x,y,z,rotation(graus),scale, scale_x/y/z,layer,block,handle,ignore ou "attr:TAG"; sem mapping, detecta X/Y/Z/BLOCO/CAMADA/ROTACAO/ ESCALA/HANDLE por nome e trata as demais colunas como atributos de mesmo nome); block_name (bloco padrão das linhas sem coluna de bloco); key_tag (atributo-chave, ex. "TAG": linha cujo valor já existe no desenho ATUALIZA o bloco em vez de inserir duplicado); layer (camada padrão); update_position (também move blocos existentes; padrão false); create_missing_layer. Célula em branco = ignorar (não apaga o atributo). Erros por linha não abortam o lote. Exemplo: import_blocks_from_excel("C:\proj\suportes.xlsx", block_name="SUP-GUIDE", key_tag="TAG", layer="SUPORTES", dry_run=true).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "import_blocks_from_excel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| layer | No | ||
| sheet | No | ||
| confirm | No | ||
| dry_run | No | ||
| key_tag | No | ||
| mapping | No | ||
| block_name | No | ||
| header_row | No | ||
| update_position | No | ||
| create_missing_layer | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||