图纸解析摘要
统计一份已解析图纸的实体类型分布、图层数、块数、文本单元格数量与坐标包围盒。用于在提取 BOM 之前先判断图纸规模与解析质量:例如文本单元格过少说明可能是纯图形图纸,BOM 提取大概率无结果。输入是由解析适配器产出的快照对象。
gongdana.cad.drawing_summary
解析适配器产出的图纸快照(含 cells/entities/layers/blocks/stats)
结果
填写左侧参数后点击「计算」
参数说明
共 1 个参数,其中 1 个必填。表格由工具的 JSON Schema 自动生成。
| 参数 | 类型 | 必填 | 约束 | 说明 |
|---|---|---|---|---|
| snapshot | 对象 | 必填 | — | 解析适配器产出的图纸快照(含 cells/entities/layers/blocks/stats) |
返回字段
entityCount整数(必有)textCellCount整数(必有)layerCount整数(必有)blockCount整数(必有)entityTypes数组(必有)bbox对象(必有)verdict字符串(必有)
API 调用方式
示例使用默认值与首个枚举值,可直接运行
REST
curl -X POST {ORIGIN}/api/call \
-H "Content-Type: application/json" \
-d '{"tool":"gongdana.cad.drawing_summary","input":{"snapshot":{"fileName":"demo.dxf","fileType":"dxf","fileSize":2048,"cells":[{"x":190,"y":500,"text":"名称","type":"TEXT"},{"x":190,"y":550,"text":"断路器","type":"TEXT"}],"entities":[{"type":"TEXT","layer":"0"},{"type":"TEXT","layer":"0"},{"type":"LINE","layer":"0"}],"layers":["0","BOM"],"blocks":["*Model_Space"],"stats":{"entityCount":3,"textCount":2,"blockCount":1,"layerCount":2,"byType":{"TEXT":2,"LINE":1}},"licenseNote":"DXF 解析使用 MLightCAD MIT 许可解析器。"}}}'MCP(JSON-RPC)
端点 {ORIGIN}/mcp;需先完成 initialize 握手。
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "gongdana.cad.drawing_summary",
"arguments": {
"snapshot": {
"fileName": "demo.dxf",
"fileType": "dxf",
"fileSize": 2048,
"cells": [
{
"x": 190,
"y": 500,
"text": "名称",
"type": "TEXT"
},
{
"x": 190,
"y": 550,
"text": "断路器",
"type": "TEXT"
}
],
"entities": [
{
"type": "TEXT",
"layer": "0"
},
{
"type": "TEXT",
"layer": "0"
},
{
"type": "LINE",
"layer": "0"
}
],
"layers": [
"0",
"BOM"
],
"blocks": [
"*Model_Space"
],
"stats": {
"entityCount": 3,
"textCount": 2,
"blockCount": 1,
"layerCount": 2,
"byType": {
"TEXT": 2,
"LINE": 1
}
},
"licenseNote": "DXF 解析使用 MLightCAD MIT 许可解析器。"
}
}
}
}常见问题
图纸解析摘要是做什么的?
统计一份已解析图纸的实体类型分布、图层数、块数、文本单元格数量与坐标包围盒。用于在提取 BOM 之前先判断图纸规模与解析质量:例如文本单元格过少说明可能是纯图形图纸,BOM 提取大概率无结果。输入是由解析适配器产出的快照对象。 它属于「CAD 图纸与 BOM」分类,工具标识为 gongdana.cad.drawing_summary。
图纸解析摘要需要哪些参数?
必填参数 1 个:snapshot(对象)。
图纸解析摘要返回什么结果?
返回 JSON 对象,主要字段:entityCount(整数(必有));textCellCount(整数(必有));layerCount(整数(必有));blockCount(整数(必有));entityTypes(数组(必有));bbox(对象(必有)) 等。
如何通过 API 调用图纸解析摘要?
REST 方式:POST /api/call,请求体为 {"tool":"gongdana.cad.drawing_summary","input":{...}}。MCP 方式:连接站点根路径下的 /mcp 后调用 tools/call,name 传 "gongdana.cad.drawing_summary"。也可用批量(POST /api/batch)与链式(POST /api/chain)编排多个工具。
图纸解析摘要的结果可以复现吗?
可以。该工具是纯函数,同样的输入永远得到同样的输出,不依赖时间、随机数或外部状态,因此结果可被交叉核对。
相关工具 · CAD 图纸与 BOM
查看全部 8 个 →MTEXT 格式码清理gongdana.cad.mtext_normalizeBOM 表格定位gongdana.cad.bom_table_detectBOM 一键提取gongdana.cad.bom_extractBOM 完整性校验gongdana.cad.bom_validateBOM 导出(CSV / JSON / XLSX)gongdana.cad.bom_export电气元件分类gongdana.cad.component_classifyHTML 实体编解码gongdana.encoding.html_entity文本哈希gongdana.crypto.hash答案块生成gongdana.geo.answer_block