dxf_dimensions
Append linear, aligned, radius, diameter, and angular dimensions to DXF drawings, automatically creating missing files and returning measured values.
Instructions
向 DXF 图纸追加尺寸标注;文件不存在时自动创建。
每个标注是一个 dict,公共可选字段:layer、color、dimstyle(默认 "Standard")、 text(自定义标注文字,不传则显示实测值)。
标注类型与必填字段(坐标单位与绘图一致): linear: p1, p2, location[标注线位置点, 可选], angle(0=水平标注, 90=垂直) aligned: p1, p2, location[标注线位置点, 可选] radius: center, radius, angle(引线方向, 度, 可选), location(可选) diameter: center, radius, angle(可选), location(可选) angular: center, p1, p2[两条射线的端点], location(标注弧位置点, 可选, 不传则画在角平分线上)
返回值含每个标注的实测测量值(measurement),可直接核对。 注意:标注的预览渲染是 ezdxf 的简化实现,与 AutoCAD 的显示可能有差异 (例如 angular 预览可能显示补角);打开 AutoCAD 后 CAD 会按定义点 重新渲染,以 CAD 显示为准。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dims | Yes | ||
| path | Yes | ||
| dxfversion | No | R2010 |