@atlisp/mcp 1.8.19 → 1.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atlisp-mcp.js +2032 -1365
- package/dist/cad-worker.js +6 -5
- package/dist/config.js +34 -0
- package/dist/handlers/cad-handlers.js +15 -0
- package/dist/handlers/draw-handlers.js +41 -0
- package/dist/handlers/lint-handlers.js +64 -0
- package/dist/handlers/resource-defs.js +2 -0
- package/dist/handlers/resource-handlers.js +92 -23
- package/dist/lisp-security.js +66 -29
- package/dist/pipelines/analyze-and-report.json +16 -0
- package/dist/pipelines/batch-export-pdfs.json +11 -0
- package/dist/pipelines/batch-layer-move.json +19 -0
- package/dist/pipelines/export-current-drawing.json +18 -0
- package/dist/pipelines/purge-and-save.json +16 -0
- package/dist/prompts/definitions/analyze-drawing.json +6 -0
- package/dist/prompts/definitions/batch-draw-lines.json +14 -0
- package/dist/prompts/definitions/coding-conventions.json +11 -0
- package/dist/prompts/definitions/color-convert.json +30 -0
- package/dist/prompts/definitions/curve-analysis.json +26 -0
- package/dist/prompts/definitions/excel-report.json +9 -0
- package/dist/prompts/definitions/export-entities.json +17 -0
- package/dist/prompts/definitions/generate-dimension.json +8 -0
- package/dist/prompts/definitions/geometry-calc.json +9 -0
- package/dist/prompts/definitions/json-exchange.json +22 -0
- package/dist/prompts/definitions/manage-blocks.json +28 -0
- package/dist/prompts/definitions/manage-layers.json +35 -0
- package/dist/prompts/definitions/pickset-filter.json +31 -0
- package/dist/prompts/definitions/string-process.json +40 -0
- package/dist/prompts/definitions/test-autolisp.json +33 -0
- package/dist/prompts/definitions/text-process.json +26 -0
- package/dist/prompts/definitions/workflow-3d-model.json +24 -0
- package/dist/prompts/definitions/workflow-batch-operations.json +24 -0
- package/dist/prompts/definitions/workflow-block-manage.json +32 -0
- package/dist/prompts/definitions/workflow-drawing-export.json +23 -0
- package/dist/prompts/definitions/workflow-entity-analysis.json +23 -0
- package/dist/prompts/definitions/workflow-layer-management.json +38 -0
- package/dist/prompts/definitions/workflow-plot-publish.json +28 -0
- package/dist/prompts/definitions/workflow-sheetset.json +29 -0
- package/dist/prompts/definitions/workflow-text-process.json +29 -0
- package/dist/prompts/definitions/workflow-xref-manage.json +28 -0
- package/package.json +4 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "color-convert",
|
|
3
|
+
"description": "颜色转换:ACI/RGB/TrueColor/CSS互转",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (aci2rgb/rgb2css/truecolor2rgb/rgb2truecolor/rgb)", "required": true, "default": "aci2rgb" },
|
|
6
|
+
{ "name": "value", "description": "颜色值", "required": true, "default": "1" }
|
|
7
|
+
],
|
|
8
|
+
"templates": {
|
|
9
|
+
"aci2rgb": {
|
|
10
|
+
"code": "(color:aci2rgb {{value}})",
|
|
11
|
+
"description": "ACI颜色索引 {{value}} 转RGB"
|
|
12
|
+
},
|
|
13
|
+
"rgb2css": {
|
|
14
|
+
"code": "(color:rgb2css (list {{value}}))",
|
|
15
|
+
"description": "RGB ({{value}}) 转CSS颜色 #FFFFFF"
|
|
16
|
+
},
|
|
17
|
+
"truecolor2rgb": {
|
|
18
|
+
"code": "(color:truecolor2rgb {{value}})",
|
|
19
|
+
"description": "TrueColor整数 {{value}} 转RGB列表"
|
|
20
|
+
},
|
|
21
|
+
"rgb2truecolor": {
|
|
22
|
+
"code": "(color:rgb2truecolor (list {{value}}))",
|
|
23
|
+
"description": "RGB ({{value}}) 转TrueColor整数"
|
|
24
|
+
},
|
|
25
|
+
"rgb": {
|
|
26
|
+
"code": "(color:rgb {{value}})",
|
|
27
|
+
"description": "计算RGB合成值:{{value}}"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "curve-analysis",
|
|
3
|
+
"description": "曲线分析:交点、最近点、子段、缓冲区",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (inters/subsegments/closestpoint/join)", "required": true, "default": "inters" },
|
|
6
|
+
{ "name": "distance", "description": "连接容差/偏移距离", "required": false, "default": "100" }
|
|
7
|
+
],
|
|
8
|
+
"templates": {
|
|
9
|
+
"inters": {
|
|
10
|
+
"code": "(progn\n (setq ss (ssget \"_X\" (list (cons 0 \"LWPOLYLINE,LINE,ARC,CIRCLE\"))))\n (if (and ss (>= (sslength ss) 2))\n (progn\n (setq elst (pickset:to-list ss))\n (setq e1 (car elst) e2 (cadr elst))\n (curve:inters e1 e2 0)\n )\n )\n)",
|
|
11
|
+
"description": "选择前两个曲线对象,计算其交点(可指定 LWPOLYLINE, LINE, ARC, CIRCLE)"
|
|
12
|
+
},
|
|
13
|
+
"subsegments": {
|
|
14
|
+
"code": "(progn\n (setq e (car (pickset:to-list (ssget \":S\" (list (cons 0 \"LWPOLYLINE\"))))))\n (if e (curve:subsegments e))\n)",
|
|
15
|
+
"description": "选择一个LWPOLYLINE,返回其子段数"
|
|
16
|
+
},
|
|
17
|
+
"closestpoint": {
|
|
18
|
+
"code": "(progn\n (setq e (car (pickset:to-list (ssget \":S\" (list (cons 0 \"LWPOLYLINE,LINE,ARC,CIRCLE\"))))))\n (if e (curve:pickclosepointto e (getpoint \"\\n选择参考点: \")))\n)",
|
|
19
|
+
"description": "选择一个曲线对象,然后拾取一个点,返回曲线上离该点最近的点"
|
|
20
|
+
},
|
|
21
|
+
"join": {
|
|
22
|
+
"code": "(progn\n (setq ss (ssget (list (cons 0 \"LINE,LWPOLYLINE\"))))\n (if ss (curve:join (pickset:to-list ss) {{distance}}))\n)",
|
|
23
|
+
"description": "选择LINE/LWPOLYLINE线段,用 PEDIT Join 合并,容差距离={{distance}}"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "excel-report",
|
|
3
|
+
"description": "Excel报表:导出CAD实体数据到Excel",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "visible", "description": "是否显示Excel窗口 (true/false)", "required": false, "default": "false" },
|
|
6
|
+
{ "name": "savePath", "description": "保存路径,不填则不保存", "required": false, "default": "" }
|
|
7
|
+
],
|
|
8
|
+
"handlerFile": "excel-report"
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "export-entities",
|
|
3
|
+
"description": "导出图纸实体统计",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "导出格式 (json/list)", "required": false, "default": "json" }
|
|
6
|
+
],
|
|
7
|
+
"templates": {
|
|
8
|
+
"json": {
|
|
9
|
+
"code": "(progn\n (setq ss(ssget \"_X\"))\n (if ss\n (progn\n (setq elst(mapcar(quote(lambda(x)(list(cdr(assoc 0(entget x)))(vlax-get x 'ObjectName))))(pickset:to-list ss)))\n (stat:stat(mapcar(quote car)elst))\n )\n )\n)",
|
|
10
|
+
"description": "导出实体统计 (json 格式):\n\n执行后将输出实体统计信息。"
|
|
11
|
+
},
|
|
12
|
+
"list": {
|
|
13
|
+
"code": "(progn\n (princ \"\\n实体统计:\\n\")\n (princ \"类型 数量\\n\")\n (princ \"---------------------\\n\")\n (setq ss(ssget \"_X\"))\n (if ss\n (progn\n (setq elst(mapcar(quote(lambda(x)(cdr(assoc 0(entget x))))) (pickset:to-list ss)))\n (foreach t '(\"LINE\" \"CIRCLE\" \"ARC\" \"TEXT\" \"MTEXT\" \"POLYLINE\" \"LWPOLYLINE\" \"INSERT\")\n (setq cnt(length(member t elst)))\n (if(> cnt 0)(princ(strcat t \" \"(itoa cnt) \"\\n\")))\n )\n )\n )\n)",
|
|
14
|
+
"description": "导出实体统计 (list 格式):\n\n执行后将输出实体统计信息。"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "geometry-calc",
|
|
3
|
+
"description": "几何计算:凸包、点到线距离、面内测试、变换",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (convexhull/dist-point-line/in-curve-p/transform/centroid)", "required": true, "default": "centroid" },
|
|
6
|
+
{ "name": "points", "description": "点集 \"x1,y1;x2,y2;...\"", "required": false, "default": "0,0;100,0;100,100;0,100" }
|
|
7
|
+
],
|
|
8
|
+
"handlerFile": "geometry-calc"
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "json-exchange",
|
|
3
|
+
"description": "JSON数据交换:从字符串解析JSON alist,从alist生成JSON",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (encode/decode/decode-json)", "required": true, "default": "encode" },
|
|
6
|
+
{ "name": "data", "description": "JSON字符串或Lisp alist文本", "required": true, "default": "((\"name\" . \"客厅\") (\"area\" . 45.5) (\"layer\" . \"A-WALL\"))" }
|
|
7
|
+
],
|
|
8
|
+
"templates": {
|
|
9
|
+
"encode": {
|
|
10
|
+
"code": "(json:encode-from-alist '{{{data}}})",
|
|
11
|
+
"description": "将alist数据编码为JSON字符串"
|
|
12
|
+
},
|
|
13
|
+
"decode": {
|
|
14
|
+
"code": "(json:parse \"{{data}}\")",
|
|
15
|
+
"description": "使用纯Lisp解析器解析JSON字符串"
|
|
16
|
+
},
|
|
17
|
+
"decode-json": {
|
|
18
|
+
"code": "(json:decode-json-from-string \"{{data}}\")",
|
|
19
|
+
"description": "使用服务器API解码JSON字符串(支持GBK编码)"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "manage-blocks",
|
|
3
|
+
"description": "块操作:插入块、列出块、获取/设置属性",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作类型 (list/insert/attributes/dynprops)", "required": true, "default": "list" },
|
|
6
|
+
{ "name": "blockName", "description": "块名", "required": false, "default": "块名" },
|
|
7
|
+
{ "name": "insertPoint", "description": "插入点 \"x,y\"", "required": false, "default": "0,0" },
|
|
8
|
+
{ "name": "scale", "description": "缩放比例", "required": false, "default": "1" }
|
|
9
|
+
],
|
|
10
|
+
"templates": {
|
|
11
|
+
"list": {
|
|
12
|
+
"code": "(block:list)",
|
|
13
|
+
"description": "列出当前图纸中所有块定义"
|
|
14
|
+
},
|
|
15
|
+
"insert": {
|
|
16
|
+
"code": "(block:insert \"{{blockName}}\" \"{{blockName}}\" (list {{insertPoint}}) 0 {{scale}})",
|
|
17
|
+
"description": "插入块 \"{{blockName}}\" 到点 ({{insertPoint}}),比例 {{scale}}"
|
|
18
|
+
},
|
|
19
|
+
"attributes": {
|
|
20
|
+
"code": "(block:get-attributes (car (pickset:to-list (ssget \"_X\" (list (cons 2 \"{{blockName}}\"))))))",
|
|
21
|
+
"description": "获取块 \"{{blockName}}\" 的属性标签-值列表"
|
|
22
|
+
},
|
|
23
|
+
"dynprops": {
|
|
24
|
+
"code": "(block:get-dynamic-properties (car (pickset:to-list (ssget \"_X\" (list (cons 2 \"{{blockName}}\"))))))",
|
|
25
|
+
"description": "获取动态块 \"{{blockName}}\" 的可调属性"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "manage-layers",
|
|
3
|
+
"description": "图层管理:创建、冻结、锁定、删除图层",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作类型 (list/freeze/lock/off/make/delete)", "required": true, "default": "list" },
|
|
6
|
+
{ "name": "layers", "description": "图层名,多个用逗号分隔", "required": false, "default": "" },
|
|
7
|
+
{ "name": "color", "description": "图层颜色 (ACI号或RGB如 \"1,2,3\")", "required": false, "default": "7" }
|
|
8
|
+
],
|
|
9
|
+
"templates": {
|
|
10
|
+
"list": {
|
|
11
|
+
"code": "(layer:list)",
|
|
12
|
+
"description": "列出所有图层"
|
|
13
|
+
},
|
|
14
|
+
"make": {
|
|
15
|
+
"code": "(layer:make \"{{layers[0]}}\" {{color}} \"Continuous\" 0)",
|
|
16
|
+
"description": "创建图层 {{layers[0]}},颜色 {{color}}"
|
|
17
|
+
},
|
|
18
|
+
"freeze": {
|
|
19
|
+
"code": "(mapcar (function (lambda (x) (layer:freeze x 1))) '{{{layers}}})",
|
|
20
|
+
"description": "冻结图层: {{{layers}}}"
|
|
21
|
+
},
|
|
22
|
+
"lock": {
|
|
23
|
+
"code": "(mapcar (function (lambda (x) (layer:lock x 1))) '{{{layers}}})",
|
|
24
|
+
"description": "锁定图层: {{{layers}}}"
|
|
25
|
+
},
|
|
26
|
+
"off": {
|
|
27
|
+
"code": "(mapcar (function (lambda (x) (layer:off x))) '{{{layers}}})",
|
|
28
|
+
"description": "关闭图层: {{{layers}}}"
|
|
29
|
+
},
|
|
30
|
+
"delete": {
|
|
31
|
+
"code": "(mapcar (function (lambda (x) (layer:delete x))) '{{{layers}}})",
|
|
32
|
+
"description": "删除图层: {{{layers}}}"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pickset-filter",
|
|
3
|
+
"description": "选择集操作:过滤、转换、批量操作",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (by-layer/by-type/by-box/erase/zoom)", "required": true, "default": "by-type" },
|
|
6
|
+
{ "name": "dxfType", "description": "DXF类型 \"LINE, CIRCLE, LWPOLYLINE, INSERT, TEXT\"", "required": false, "default": "LINE" },
|
|
7
|
+
{ "name": "layerName", "description": "图层名", "required": false, "default": "0" }
|
|
8
|
+
],
|
|
9
|
+
"templates": {
|
|
10
|
+
"by-type": {
|
|
11
|
+
"code": "(progn\n (setq ss (ssget \"_X\" (list (cons 0 \"{{dxfType}}\"))))\n (if ss (list (sslength ss) (mapcar (function (lambda (x) (cdr (assoc 0 (entget x))))) (pickset:to-list ss))))\n)",
|
|
12
|
+
"description": "统计所有类型为 {{dxfType}} 的实体数量"
|
|
13
|
+
},
|
|
14
|
+
"by-layer": {
|
|
15
|
+
"code": "(progn\n (setq ss (ssget \"_X\" (list (cons 8 \"{{layerName}}\"))))\n (if ss (list (sslength ss) (mapcar (function (lambda (x) (cdr (assoc 0 (entget x))))) (pickset:to-list ss))))\n)",
|
|
16
|
+
"description": "统计图层 {{layerName}} 上的实体数量和类型"
|
|
17
|
+
},
|
|
18
|
+
"by-box": {
|
|
19
|
+
"code": "(progn\n (setq ss (ssget \"_X\"))\n (if ss (pickset:getbox ss 0))\n)",
|
|
20
|
+
"description": "计算全图选择集的边界框"
|
|
21
|
+
},
|
|
22
|
+
"erase": {
|
|
23
|
+
"code": "(progn\n (setq ss (ssget (list (cons 0 \"{{dxfType}}\"))))\n (if ss (progn (pickset:erase ss) (princ (strcat \"已删除 \" (itoa (sslength ss)) \" 个 \" \"{{dxfType}}\" \" 实体\"))))\n)",
|
|
24
|
+
"description": "删除所有 {{dxfType}} 类型的实体"
|
|
25
|
+
},
|
|
26
|
+
"zoom": {
|
|
27
|
+
"code": "(progn\n (setq ss (ssget \"_X\" (list (cons 0 \"{{dxfType}}\"))))\n (if ss (pickset:zoom ss))\n)",
|
|
28
|
+
"description": "缩放到所有 {{dxfType}} 类型的实体"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "string-process",
|
|
3
|
+
"description": "字符串处理:格式化、拆分、替换、正则",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (format/split/subst-all/regexp/trim/number2chinese/to-list)", "required": true, "default": "format" },
|
|
6
|
+
{ "name": "input", "description": "输入字符串", "required": true, "default": "Hello, {0}!" },
|
|
7
|
+
{ "name": "arg1", "description": "参数1(格式参数/分隔符/旧串)", "required": false, "default": "World" },
|
|
8
|
+
{ "name": "arg2", "description": "参数2(新串/正则模式)", "required": false, "default": "" }
|
|
9
|
+
],
|
|
10
|
+
"templates": {
|
|
11
|
+
"format": {
|
|
12
|
+
"code": "(string:format \"{{input}}\" (list \"{{arg1}}\"))",
|
|
13
|
+
"description": "格式化: {{input}} 参数: {{arg1}}"
|
|
14
|
+
},
|
|
15
|
+
"split": {
|
|
16
|
+
"code": "(string:split \"{{input}}\" \"{{arg1}}\")",
|
|
17
|
+
"description": "拆分: \"{{input}}\" 按 \"{{arg1}}\" 分隔"
|
|
18
|
+
},
|
|
19
|
+
"subst-all": {
|
|
20
|
+
"code": "(string:subst-all \"{{arg2}}\" \"{{arg1}}\" \"{{input}}\")",
|
|
21
|
+
"description": "替换: 将 \"{{input}}\" 中的 \"{{arg1}}\" 替换为 \"{{arg2}}\""
|
|
22
|
+
},
|
|
23
|
+
"regexp": {
|
|
24
|
+
"code": "(re:match \"{{arg1}}\" \"{{input}}\")",
|
|
25
|
+
"description": "正则匹配: \"{{input}}\" 模式: {{arg1}}"
|
|
26
|
+
},
|
|
27
|
+
"trim": {
|
|
28
|
+
"code": "(string:trim-space \"{{input}}\")",
|
|
29
|
+
"description": "去除首尾空格: \"{{input}}\""
|
|
30
|
+
},
|
|
31
|
+
"number2chinese": {
|
|
32
|
+
"code": "(string:number2chinese {{input}})",
|
|
33
|
+
"description": "数字 {{input}} 转中文大写"
|
|
34
|
+
},
|
|
35
|
+
"to-list": {
|
|
36
|
+
"code": "(string:to-list \"{{input}}\" \"{{arg1}}\")",
|
|
37
|
+
"description": "按分隔符 \"{{arg1}}\" 拆分 \"{{input}}\" 为列表"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "test-autolisp",
|
|
3
|
+
"description": "AutoLISP 代码测试:单元测试、集成测试、调试、基准测试、验证测试",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "测试类型: unit-test / integration / debug / benchmark / validate", "required": false, "default": "unit-test" },
|
|
6
|
+
{ "name": "code", "description": "要测试的 AutoLISP 代码或文件路径", "required": false, "default": "" },
|
|
7
|
+
{ "name": "functionName", "description": "函数名", "required": false, "default": "" },
|
|
8
|
+
{ "name": "expected", "description": "期望结果(可选,用于断言)", "required": false, "default": "" },
|
|
9
|
+
{ "name": "input", "description": "测试输入参数", "required": false, "default": "" }
|
|
10
|
+
],
|
|
11
|
+
"templates": {
|
|
12
|
+
"unit-test": {
|
|
13
|
+
"code": "(progn\n (load \"{{code}}\")\n (setq result ({{functionName}} {{input}}))\n (princ (strcat \"\\n返回值: \" (vl-princ-to-string result)))\n (princ \"\\n返回值类型: \")\n (princ (type result))\n (princ)\n result\n)",
|
|
14
|
+
"description": "## AutoLISP 单元测试\n\n测试单个函数 `{{functionName}}`。\n\n### 测试流程\n1. `(load \"{{code}}\")` 加载目标代码\n2. `({{functionName}} {{input}})` 执行被测函数\n3. 检查返回值和 `(type result)` 确认类型\n\n### 验证要点\n- 返回值是否符合预期\n- 函数是否有副作用(新增/修改/删除图元)\n- 边界情况:nil 参数、空列表、超大数值、特殊字符\n\n### 示例\n```lisp\n;; 调用方式\n(load \"test.lsp\")\n(setq r (entity:make-circle '(0 0) 50))\n(princ (strcat \"Result: \" (vl-princ-to-string r)))\n(entget r) ;; 查看 DXF 数据\n```"
|
|
15
|
+
},
|
|
16
|
+
"integration": {
|
|
17
|
+
"code": "(progn\n (princ \"\\n========== 集成测试 ==========\")\n (load \"{{code}}\")\n (setq before-ents (sslength (ssget \"_X\")))\n (setq before-layers (layer:list))\n (setq result ({{functionName}} {{input}}))\n (princ (strcat \"\\n结果: \" (vl-princ-to-string result)))\n (setq after-ents (sslength (ssget \"_X\")))\n (princ (strcat \"\\n实体变化: \" (itoa (- after-ents before-ents))))\n (command \"_U\")\n (princ \"\\n✅ 已撤销\")\n (princ)\n result\n)",
|
|
18
|
+
"description": "## AutoLISP 集成测试\n\n测试 `{{functionName}}` 多步骤执行和副作用。\n\n### 测试流程\n1. 记录测试前状态(实体数、图层)\n2. 执行被测函数\n3. 检查返回值 + 状态变更\n4. `(command \"_U\")` 撤销清理\n\n### 注意事项\n- 必须撤销 `_U` 清理副作用,或在测试文档中执行\n- `ssget \"_X\"` 跨空间选择,注意布局上下文\n- 多个 `eval_lisp_with_result` 调用间 CAD 上下文可能丢失,优先使用 `(progn ...)` 合并"
|
|
19
|
+
},
|
|
20
|
+
"debug": {
|
|
21
|
+
"code": "(progn\n (princ \"\\n========== 调试 ==========\")\n (load \"{{code}}\")\n (setq input-var {{input}})\n (princ (strcat \"\\n输入: \" (vl-princ-to-string input-var)))\n (princ (strcat \"\\n类型: \" (type input-var)))\n (if (atoms-family 0 (list \"{{functionName}}\"))\n (progn\n (princ (strcat \"\\n函数已注册: {{functionName}}\"))\n (setq result ({{functionName}} input-var))\n (princ (strcat \"\\n返回值: \" (vl-princ-to-string result))))\n (princ (strcat \"\\n❌ 函数未注册: {{functionName}}\")))\n (princ \"\\n========== 结束 ==========\")\n (princ)\n)",
|
|
22
|
+
"description": "## AutoLISP 调试\n\n诊断 `{{functionName}}` 的问题。\n\n### 调试策略\n1. **拆分为小步**:一个 `eval_lisp_with_result` 只做一件事\n2. **中间值打印**:每个步骤用 `(princ ...)` 输出\n3. **函数注册检查**:`(atoms-family 0 (list \"func-name\"))`\n4. **参数验证**:`(type x)` 检查类型,`(vl-princ-to-string x)` 查看内容\n\n### 常见错误\n| 错误 | 原因 |\n|------|------|\n| `bad argument type` | 参数类型不匹配,用 `(type x)` 检查 |\n| `Automation Error` | COM 对象无效,检查 vla-object |\n| `no function definition` | 函数未加载,检查 load 路径 |\n| 返回 nil | 变量未定义或函数无有效返回值 |\n\n### 调试技巧\n- 用 `(vl-bt)` 查看调用栈(仅调试用,生产环境禁用)\n- 用 `(!)variable` 快速查看变量值(在 CAD 命令行)"
|
|
23
|
+
},
|
|
24
|
+
"benchmark": {
|
|
25
|
+
"code": "(progn\n (princ \"\\n========== 基准测试 ==========\")\n (load \"{{code}}\")\n (repeat 3 ({{functionName}} {{input}}))\n (setq t1 (getvar \"millisecs\")\n n 100)\n (repeat n ({{functionName}} {{input}}))\n (setq elapsed (- (getvar \"millisecs\") t1))\n (princ (strcat \"\\n\" (itoa n) \" 次执行: \" (itoa elapsed) \" ms\"))\n (princ (strcat \"\\n平均: \" (rtos (/ (float elapsed) n) 2 3) \" ms\"))\n (princ)\n)",
|
|
26
|
+
"description": "## AutoLISP 基准测试\n\n`{{functionName}}` 性能指标。\n\n### 测试参数\n- 预热 3 次(消除首次加载影响)\n- 正式 100 次\n- 单位:毫秒\n\n### 结果解读\n| 平均耗时 | 评价 |\n|---------|------|\n| < 1 ms | 极佳 |\n| 1-10 ms | 良好 |\n| 10-100 ms | 可优化 |\n| > 100 ms | 需重构 |\n\n### 优化方向\n- `ssget \"_X\"` 频繁调用 → 缓存选择集\n- `command` 函数调用 → 改用 `vla-*`\n- 循环内重复计算 → 提取到循环外\n- 大批量操作 → `(vla-startundomark doc)` / `(vla-endundomark doc)` 包裹"
|
|
27
|
+
},
|
|
28
|
+
"validate": {
|
|
29
|
+
"code": "(progn\n (princ \"\\n========== 验证测试 ==========\")\n (load \"{{code}}\")\n (setq cases (list {{input}}))\n (setq passed 0 failed 0)\n (foreach c cases\n (setq args (car c) expected1 (cadr c))\n (setq actual (apply (function {{functionName}}) args))\n (if (equal actual expected1 1e-6)\n (progn (setq passed (1+ passed))\n (princ (strcat \"\\n✅ \" (vl-princ-to-string args))))\n (progn (setq failed (1+ failed))\n (princ (strcat \"\\n❌ \" (vl-princ-to-string args) \" → 期望 \" (vl-princ-to-string expected1) \" 实际 \" (vl-princ-to-string actual))))))\n (princ (strcat \"\\n\\n通过: \" (itoa passed) \" 失败: \" (itoa failed)))\n (princ)\n)",
|
|
30
|
+
"description": "## AutoLISP 验证测试\n\n批量测试 `{{functionName}}`。\n\n### 测试用例格式\n每项为 `(<输入参数列表> <期望结果>)`,整体作为列表传入:\n```lisp\n(setq cases '(\n ((0 0 50) <Entity name: 7ffffb0a5a0>)\n ((100 200 25) <Entity name: 7ffffb0a5e0>)\n ((0 0 -1) nil) ;; 无效参数返回 nil\n))\n```\n\n### 断言规则\n- `equal` 比较,数值容差 `1e-6`\n- 实体用 `(equal (entget a) (entget b))` 对比"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "text-process",
|
|
3
|
+
"description": "文本处理:MTEXT解析、Markdown转MTEXT、去格式",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作 (parse-mtext/remove-fmt/from-markdown/mtext2text)", "required": true, "default": "remove-fmt" },
|
|
6
|
+
{ "name": "markdown", "description": "Markdown文本(from-markdown操作时用)", "required": false, "default": "这是 **粗体** 和 *斜体* 文本" }
|
|
7
|
+
],
|
|
8
|
+
"templates": {
|
|
9
|
+
"remove-fmt": {
|
|
10
|
+
"code": "(progn\n (setq e (car (pickset:to-list (ssget \":S\" (list (cons 0 \"MTEXT\"))))))\n (if e (text:remove-fmt (cdr (assoc 1 (entget e)))))\n)",
|
|
11
|
+
"description": "选择一个MTEXT对象,去除所有格式代码,返回纯文本"
|
|
12
|
+
},
|
|
13
|
+
"parse-mtext": {
|
|
14
|
+
"code": "(progn\n (setq e (car (pickset:to-list (ssget \":S\" (list (cons 0 \"MTEXT\"))))))\n (if e (text:parse-mtext (cdr (assoc 1 (entget e)))))\n)",
|
|
15
|
+
"description": "选择一个MTEXT对象,解析为 (格式或文本 . 内容) 列表"
|
|
16
|
+
},
|
|
17
|
+
"from-markdown": {
|
|
18
|
+
"code": "(text:from-markdown \"{{markdown}}\")",
|
|
19
|
+
"description": "将Markdown转换为MTEXT格式代码:\n{{markdown}}"
|
|
20
|
+
},
|
|
21
|
+
"mtext2text": {
|
|
22
|
+
"code": "(progn\n (setq e (car (pickset:to-list (ssget \":S\" (list (cons 0 \"MTEXT\"))))))\n (if e (text:mtext2text e))\n)",
|
|
23
|
+
"description": "选择一个MTEXT对象,分解为多个单行TEXT"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-3d-model",
|
|
3
|
+
"description": "3D 建模流程:创建基本体 → 布尔运算 → 导出 STL。用于 3D 打印或模型展示",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: create/boolean/export", "required": true, "default": "create" },
|
|
6
|
+
{ "name": "shape", "description": "基本体类型: box/sphere/cylinder/cone/torus/wedge", "required": false },
|
|
7
|
+
{ "name": "center", "description": "中心点坐标", "required": false },
|
|
8
|
+
{ "name": "operation", "description": "布尔运算: union/subtract/intersect", "required": false }
|
|
9
|
+
],
|
|
10
|
+
"templates": {
|
|
11
|
+
"create": {
|
|
12
|
+
"code": "",
|
|
13
|
+
"description": "创建基本体:\n- create_box({ center, length, width, height })\n- create_sphere({ center, radius })\n- create_cylinder({ center, radius, height })\n- create_cone({ center, radius, height })\n- create_torus({ center, majorRadius, minorRadius })"
|
|
14
|
+
},
|
|
15
|
+
"boolean": {
|
|
16
|
+
"code": "",
|
|
17
|
+
"description": "1. 用 select_entities 选择要操作的实体\n2. boolean_union({ handles }) — 并集\n3. boolean_subtract({ handles, subtractFromHandles }) — 差集\n4. boolean_intersect({ handles }) — 交集"
|
|
18
|
+
},
|
|
19
|
+
"export": {
|
|
20
|
+
"code": "",
|
|
21
|
+
"description": "1. 调用 export_stl({ outputPath, handle })导出为 STL 文件\n2. 不传 handle 则导出所有实体"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-batch-operations",
|
|
3
|
+
"description": "批量操作工作流:选择实体 → 批量修改 → 保存。推荐用于大量实体的统一修改",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: select/modify/save", "required": true, "default": "modify" },
|
|
6
|
+
{ "name": "type", "description": "实体类型过滤(如 LINE, CIRCLE, TEXT)", "required": false },
|
|
7
|
+
{ "name": "layer", "description": "图层过滤", "required": false },
|
|
8
|
+
{ "name": "operation", "description": "批量操作: move/copy/delete/set-layer/set-color/rotate/scale/mirror", "required": false, "default": "set-layer" }
|
|
9
|
+
],
|
|
10
|
+
"templates": {
|
|
11
|
+
"select": {
|
|
12
|
+
"code": "",
|
|
13
|
+
"description": "1. 调用 select_entities({ filter: { type, layer } }) 选择实体\n2. 获取返回的 handle 列表\n3. 或使用 stream_entities 先查看有哪些实体"
|
|
14
|
+
},
|
|
15
|
+
"modify": {
|
|
16
|
+
"code": "",
|
|
17
|
+
"description": "根据 operation 选择:\n- move: batch_move({ handles, dx, dy })\n- copy: batch_copy({ handles, dx, dy })\n- delete: batch_delete({ handles })\n- set-layer: batch_set_layer({ handles, layerName })\n- set-color: batch_set_color({ handles, color })\n- rotate: batch_rotate({ handles, angle, basePoint })\n- scale: batch_scale({ handles, scaleFactor, basePoint })\n- mirror: batch_mirror({ handles, startPoint, endPoint })"
|
|
18
|
+
},
|
|
19
|
+
"save": {
|
|
20
|
+
"code": "",
|
|
21
|
+
"description": "1. 调用 save_dwg 保存修改\n2. 如需另存为,传入 filePath 参数"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-block-manage",
|
|
3
|
+
"description": "块操作流程:列出块定义 → 查询块参照 → 获取/修改属性 → 插入/炸开块",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: list/query/attr/insert/explode", "required": true, "default": "list" },
|
|
6
|
+
{ "name": "blockName", "description": "块名称", "required": false },
|
|
7
|
+
{ "name": "blockHandle", "description": "块参照句柄(attr/explode 时需要)", "required": false },
|
|
8
|
+
{ "name": "insertPoint", "description": "插入点(insert 时需要)", "required": false }
|
|
9
|
+
],
|
|
10
|
+
"templates": {
|
|
11
|
+
"list": {
|
|
12
|
+
"code": "",
|
|
13
|
+
"description": "1. 调用 get_blocks() 获取所有块定义\n2. 调用 stream_block_refs({ blockName }) 查看指定块的参照\n3. 或读取 atlisp://dwg/block-refs 资源"
|
|
14
|
+
},
|
|
15
|
+
"query": {
|
|
16
|
+
"code": "",
|
|
17
|
+
"description": "1. 调用 get_dynamic_block_properties({ blockHandle })获取动态块属性\n2. 调用 get_block_parameters({ blockHandle })获取块参数"
|
|
18
|
+
},
|
|
19
|
+
"attr": {
|
|
20
|
+
"code": "",
|
|
21
|
+
"description": "1. 调用 get_block_attributes({ blockHandle })获取属性值\n2. 调用 set_block_attribute({ blockHandle, tag, value })修改属性\n3. 批量操作: batch_get_block_attributes / batch_set_block_attributes"
|
|
22
|
+
},
|
|
23
|
+
"insert": {
|
|
24
|
+
"code": "(command \"_.INSERT\" \"{{blockName}}\" \"{{insertPoint}}\" 1 1 0)",
|
|
25
|
+
"description": "1. 调用 insert_block({ blockName, point: insertPoint, scale: 1, rotation: 0 }) 插入块"
|
|
26
|
+
},
|
|
27
|
+
"explode": {
|
|
28
|
+
"code": "",
|
|
29
|
+
"description": "1. 调用 explode_block({ handle: blockHandle }) 炸开块参照\n2. 炸开后可使用 select_last() 获取新生成的实体"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-drawing-export",
|
|
3
|
+
"description": "打开图纸 → 分析内容 → 导出为 PDF/DXF。端到端的图纸导出工作流",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: open/analyze/export", "required": true, "default": "export" },
|
|
6
|
+
{ "name": "filePath", "description": "DWG 文件路径(open 时需要)", "required": false },
|
|
7
|
+
{ "name": "format", "description": "导出格式: pdf/dxf(export 时需要)", "required": false, "default": "pdf" }
|
|
8
|
+
],
|
|
9
|
+
"templates": {
|
|
10
|
+
"open": {
|
|
11
|
+
"code": "",
|
|
12
|
+
"description": "1. 调用 open_dwg 打开文件\n2. 调用 get_cad_info 获取图纸信息\n3. 调用 stream_entities 获取实体概览"
|
|
13
|
+
},
|
|
14
|
+
"analyze": {
|
|
15
|
+
"code": "",
|
|
16
|
+
"description": "1. 调用 get_cad_info 获取 CAD 信息\n2. 调用 resource atlisp://dwg/context 获取图纸上下文\n3. 调用 stream_entities 查看实体列表\n4. 调用 get_bounding_box 了解图形范围"
|
|
17
|
+
},
|
|
18
|
+
"export": {
|
|
19
|
+
"code": "",
|
|
20
|
+
"description": "1. 先调用 get_cad_info 获取当前图纸名\n2. 调用 export_pdf(或 export_dxf)导出\n3. 如果需要所有布局,先调 list_layouts 获取布局列表\n4. 对每个布局调用 export_pdf"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-entity-analysis",
|
|
3
|
+
"description": "实体分析流程:获取实体 → 分析属性 → 生成统计报告。用于了解图纸内容",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: overview/detail/report", "required": true, "default": "overview" },
|
|
6
|
+
{ "name": "type", "description": "实体类型过滤(可选)", "required": false },
|
|
7
|
+
{ "name": "handle", "description": "指定句柄的详细信息(detail 时需要)", "required": false }
|
|
8
|
+
],
|
|
9
|
+
"templates": {
|
|
10
|
+
"overview": {
|
|
11
|
+
"code": "",
|
|
12
|
+
"description": "1. 读取 atlisp://dwg/context 资源获取图纸概览(实体数、图层数等)\n2. 读取 atlisp://dwg/entities 获取按类型统计\n3. 或调用 stream_entities 获取实体列表"
|
|
13
|
+
},
|
|
14
|
+
"detail": {
|
|
15
|
+
"code": "",
|
|
16
|
+
"description": "1. 调用 get_entity({ handle }) 获取实体属性\n2. 调用 get_entity_info({ handle }) 获取详细信息\n3. 调用 get_bounding_box({ handle }) 获取包围盒\n4. 如果文本,调用 stream_text 查看文本内容"
|
|
17
|
+
},
|
|
18
|
+
"report": {
|
|
19
|
+
"code": "",
|
|
20
|
+
"description": "汇总以上信息生成 JSON 报告:\n{\n docName: ...,\n entityCount: ...,\n byType: { LINE: ..., CIRCLE: ..., TEXT: ... },\n layers: [...],\n extents: { min: ..., max: ... }\n}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-layer-management",
|
|
3
|
+
"description": "图层全套操作:查看、创建、修改属性、隔离、合并、清理。端到端图层管理",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "操作类型: list/create/set/isolate/merge/purge", "required": true, "default": "list" },
|
|
6
|
+
{ "name": "layerName", "description": "图层名", "required": false },
|
|
7
|
+
{ "name": "newName", "description": "新图层名(rename 需要用)", "required": false },
|
|
8
|
+
{ "name": "color", "description": "颜色号(1-255)", "required": false },
|
|
9
|
+
{ "name": "sourceLayer", "description": "源图层名(merge 需要)", "required": false },
|
|
10
|
+
{ "name": "targetLayer", "description": "目标图层名", "required": false }
|
|
11
|
+
],
|
|
12
|
+
"templates": {
|
|
13
|
+
"list": {
|
|
14
|
+
"code": "",
|
|
15
|
+
"description": "使用 atlisp://dwg/tbl/layer 资源获取所有图层信息,或调用 list_tools_by_category({ category: '图层' }) 查看图层相关工具"
|
|
16
|
+
},
|
|
17
|
+
"create": {
|
|
18
|
+
"code": "(layer:make \"{{layerName}}\" {{color}} \"Continuous\" 0)",
|
|
19
|
+
"description": "创建图层 {{layerName}}\n1. 调用 create_layer({ name: layerName, color, linetype })\n2. 调用 set_current_layer({ name: layerName })设为当前"
|
|
20
|
+
},
|
|
21
|
+
"set": {
|
|
22
|
+
"code": "",
|
|
23
|
+
"description": "修改图层属性:\n- set_layer({ name: layerName, property: 'color', value: color })\n- set_layer({ name: layerName, property: 'freeze', value: '1' })\n- set_layer({ name: layerName, property: 'lock', value: '1' })"
|
|
24
|
+
},
|
|
25
|
+
"isolate": {
|
|
26
|
+
"code": "",
|
|
27
|
+
"description": "1. 调用 layer_isolate({ name: layerName })隔离图层(关闭其他)\n2. 操作完成后调用 layer_unisolate() 恢复"
|
|
28
|
+
},
|
|
29
|
+
"merge": {
|
|
30
|
+
"code": "",
|
|
31
|
+
"description": "1. 调用 layer_merge({ sourceName: sourceLayer, targetName: targetLayer })\n2. 源图层所有实体移到目标图层,源图层被删除"
|
|
32
|
+
},
|
|
33
|
+
"purge": {
|
|
34
|
+
"code": "",
|
|
35
|
+
"description": "1. 调用 purge_layers({ namePattern: '*TEMP*' })清理未使用图层\n2. 或调用 purge_all() 清理所有未使用项"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-plot-publish",
|
|
3
|
+
"description": "打印发布流程:创建页面设置 → 分配布局 → 批量打印/发布 PDF",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: setup/assign/publish/plot", "required": true, "default": "publish" },
|
|
6
|
+
{ "name": "pageSetupName", "description": "页面设置名称", "required": false, "default": "A4-PDF" },
|
|
7
|
+
{ "name": "layout", "description": "布局名称", "required": false },
|
|
8
|
+
{ "name": "outputDir", "description": "输出目录", "required": false }
|
|
9
|
+
],
|
|
10
|
+
"templates": {
|
|
11
|
+
"setup": {
|
|
12
|
+
"code": "",
|
|
13
|
+
"description": "1. 调用 create_page_setup({ name: pageSetupName, printer: 'DWG To PDF.pc3', paperSize: 'A4' })\n2. 或调用 list_page_setups() 查看已有的页面设置"
|
|
14
|
+
},
|
|
15
|
+
"assign": {
|
|
16
|
+
"code": "",
|
|
17
|
+
"description": "1. 调用 list_layouts() 查看所有布局\n2. 调用 set_page_setup({ layout, pageSetupName })分配页面设置"
|
|
18
|
+
},
|
|
19
|
+
"publish": {
|
|
20
|
+
"code": "",
|
|
21
|
+
"description": "1. 调用 list_layouts() 获取所有布局列表\n2. 调用 publish_layouts({ layouts: ['布局1','布局2'], outputDir, merge: true })批量发布"
|
|
22
|
+
},
|
|
23
|
+
"plot": {
|
|
24
|
+
"code": "",
|
|
25
|
+
"description": "单张打印:\n1. plot_to_pdf({ outputPath, layout, paperSize: 'A4' })\n2. 或 plot_to_printer({ printerName: '打印机名', layout })"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-sheetset",
|
|
3
|
+
"description": "图纸集操作流程:创建图纸集 → 添加图纸 → 发布/归档",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: create/add/publish/archive", "required": true, "default": "create" },
|
|
6
|
+
{ "name": "sheetSetName", "description": "图纸集名称", "required": false },
|
|
7
|
+
{ "name": "sheetName", "description": "图纸名称", "required": false },
|
|
8
|
+
{ "name": "layoutName", "description": "布局名称", "required": false },
|
|
9
|
+
{ "name": "outputDir", "description": "输出目录", "required": false }
|
|
10
|
+
],
|
|
11
|
+
"templates": {
|
|
12
|
+
"create": {
|
|
13
|
+
"code": "",
|
|
14
|
+
"description": "1. 调用 create_sheet_set({ name: sheetSetName, description: '...' })创建图纸集\n2. 或调用 open_sheet_set({ filePath }) 打开已有 .dst 文件"
|
|
15
|
+
},
|
|
16
|
+
"add": {
|
|
17
|
+
"code": "",
|
|
18
|
+
"description": "1. 调用 add_sheet({ sheetSetName, sheetName, layoutName })添加图纸\n2. 调用 add_sheet 添加更多图纸\n3. 创建子集: create_subset({ sheetSetName, subsetName })"
|
|
19
|
+
},
|
|
20
|
+
"publish": {
|
|
21
|
+
"code": "",
|
|
22
|
+
"description": "1. 调用 list_sheets({ sheetSetName })查看图纸列表\n2. 调用 publish_sheet_set({ sheetSetName, outputDir, format: 'PDF' })发布"
|
|
23
|
+
},
|
|
24
|
+
"archive": {
|
|
25
|
+
"code": "",
|
|
26
|
+
"description": "1. 调用 create_sheet_set_archive({ sheetSetName, archivePath })归档\n2. 或调用 sheet_set_transmit({ sheetSetName })eTransmit 打包"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workflow-text-process",
|
|
3
|
+
"description": "文字处理流程:查找 → 替换 → 格式化。用于批量编辑图纸中的文字内容",
|
|
4
|
+
"arguments": [
|
|
5
|
+
{ "name": "action", "description": "步骤: find/replace/format/convert", "required": true, "default": "find" },
|
|
6
|
+
{ "name": "pattern", "description": "搜索文本模式(支持通配符)", "required": false },
|
|
7
|
+
{ "name": "replacement", "description": "替换文本", "required": false },
|
|
8
|
+
{ "name": "caseSensitive", "description": "是否区分大小写", "required": false, "default": "false" },
|
|
9
|
+
{ "name": "handle", "description": "文字实体句柄", "required": false }
|
|
10
|
+
],
|
|
11
|
+
"templates": {
|
|
12
|
+
"find": {
|
|
13
|
+
"code": "",
|
|
14
|
+
"description": "1. 调用 find_text({ pattern, caseSensitive }) 搜索文本\n2. 或读取 atlisp://dwg/text-content 获取所有文字内容"
|
|
15
|
+
},
|
|
16
|
+
"replace": {
|
|
17
|
+
"code": "",
|
|
18
|
+
"description": "1. 调用 replace_text({ pattern, replacement, caseSensitive }) 全文替换\n2. 如需精确控制,先用 find_text 找到句柄\n3. 再逐个调用 set_text_style_name 或 set_text_height 调整格式"
|
|
19
|
+
},
|
|
20
|
+
"format": {
|
|
21
|
+
"code": "",
|
|
22
|
+
"description": "1. 调用 set_text_height({ handle, height }) 调整文字高度\n2. 调用 set_text_style_name({ handle, styleName }) 修改文字样式\n3. 调用 justify_text({ handle, justification: 'MC' }) 修改对齐方式"
|
|
23
|
+
},
|
|
24
|
+
"convert": {
|
|
25
|
+
"code": "",
|
|
26
|
+
"description": "1. 调用 convert_text_to_mtext({ handles })将单行文字转为多行文字\n2. 调用 explode_text({ handle })将文字分解为线条"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|