Interface design document and manual now share one authoritative surface inventory (333 surfaces across 9 categories, gap 0), and every chapter carries real Playwright screenshots of the panels it documents. - tools/fcweb: ui-surface-scan/ui-surface-inventory (deterministic --check), build-ui-doc renders panel catalog, workbench matrix and mapping tables; blank toolbar crops (<1 KB) are skipped and pruned instead of embedded - web/tools/manual: generate-panel-index (ch16), audit-ui-gaps, generate-final-status, generate-gaps-doc; pager is per-chapter so the manual no longer overflows horizontally - manual: 130 screenshot references / 128 PNGs, panel sections for ch02-ch13 - web/src: utility menus stop click propagation (menu reopened on item click); workbench shell gains an OPFS document picker so workbench.html can bind a real document instead of the fixed workbench-document id; Sketcher panel moves from the command column to the main stage Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
176 lines
8.6 KiB
Markdown
176 lines
8.6 KiB
Markdown
---
|
||
id: ch06
|
||
order: 6
|
||
title: 测量、检查、材质与表格
|
||
level: core
|
||
---
|
||
|
||
# 第 6 章 测量、检查、材质与表格
|
||
|
||
## 学习目标
|
||
|
||
1. 用 Spreadsheet 建参数表、写公式、设置别名,让表格驱动模型尺寸。
|
||
2. 用 Measure 读距离、角度与质量属性,并与属性面板交叉验证。
|
||
3. 用 Inspection 查看面、边、顶点的几何数据。
|
||
4. 用 Material / Appearance 设置材质与显示颜色,并确认保存后仍保留。
|
||
|
||
## 6.1 Spreadsheet 参数表
|
||
|
||
把工作台切到 `Spreadsheet`,点“Create spreadsheet”建一张表。
|
||
|
||
| 功能 | 命令 |
|
||
|---|---|
|
||
| 新建表 | `Spreadsheet_CreateSheet` |
|
||
| 编辑单元格 | 双击单元格直接输入 |
|
||
| 设别名 | `Spreadsheet_SetAlias` |
|
||
| 合并 / 拆分 | `MergeCells` / `SplitCell` |
|
||
| 对齐 | `AlignLeft` / `AlignCenter` / `AlignRight` |
|
||
| 样式 | `StyleBold` / `StyleItalic` / `StyleUnderline` |
|
||
| 导入 / 导出 | `Spreadsheet_Import` / `Spreadsheet_Export` |
|
||
|
||
**公式**以 `=` 开头,可以引用其他单元格,例如 `=B2+C2`。
|
||
**别名**是给单元格起一个可读名字(如 `wallHeight`),之后模型属性可以绑定到别名。
|
||
|
||

|
||
|
||
上图的取图步骤可以照做:打开 `project.html`,`File → 新建 Document`,
|
||
再把顶部的 `Workbench` 下拉切到 `Spreadsheet`,点 `Create spreadsheet`。
|
||
表格出现在主舞台,公式栏在上方,样式按钮在下方的任务区。
|
||
|
||
参数驱动的实际价值:把墙高、板厚、阵列数量都放进同一张表,
|
||
改一个数字,所有引用它的对象一起更新,不用逐个打开任务面板。
|
||
这也是第 9 章 BIM 推荐的建模方式。
|
||
|
||
## 6.2 Measure 测量
|
||
|
||
| 命令 | 用途 |
|
||
|---|---|
|
||
| `Std_Measure` | 两点/两面之间的距离与角度 |
|
||
| `Std_MassProperties` | 体积、表面积、质量、质心 |
|
||
| `measure.measurementApi` | 通过 API 读取测量结果 |
|
||
| `measure.objectFamily` | 对象级测量 |
|
||
|
||
在项目页 Tasks 区点 `Std_Measure — Measure` 或 `Std_MassProperties — Mass properties`,
|
||
选中对象或子元素后读结果。
|
||
|
||
**交叉验证很重要**:一个 60 × 40 × 20 的 Box,属性面板与 `MassProperties` 都应给出
|
||
48,000 mm³。两个来源不一致,说明选中的对象不是你以为的那个。
|
||
|
||
`Std_MassProperties` 的任务面板是一个 `Add object` 分组:先选对象加进列表,
|
||
再点 `Refresh` 重算。
|
||
|
||

|
||
|
||
点 `Refresh` 之后,面板里出现体积、表面积、质量与质心四组结果:
|
||
|
||

|
||
|
||
## 6.3 Inspection 检查
|
||
|
||
- `Inspection_InspectElement`:检查选中的面、边、顶点信息。
|
||
- `Inspection_VisualInspection`:可视化检查,用于看曲率或偏差分布。
|
||
|
||
任务面板会列出选中元素的数量、类型与几何数据。做布尔之后用它确认
|
||
切出来的面确实存在,而不是凭体积猜。
|
||
|
||
## 6.4 Material 与 Appearance
|
||
|
||
| 命令 | 用途 |
|
||
|---|---|
|
||
| `Std_SetAppearance` | 设置显示颜色与外观 |
|
||
| `Std_SetMaterial` | 指定材料 |
|
||
| `Material_Edit` | 编辑材料属性 |
|
||
| `Materials_InspectAppearance` | 检查外观 |
|
||
| `Materials_InspectMaterial` | 检查材料 |
|
||
|
||
`Material_Edit` 打开的是材料属性编辑器,可以改名称、类别、密度等字段:
|
||
|
||

|
||
|
||
`Std_SetAppearance` 控制显示外观,面板顶部是 `Custom appearance` 入口:
|
||
|
||

|
||
|
||
颜色写入 FCStd 的 `WebDisplayColor` 属性,保存后重新打开仍保留。
|
||
|
||
**边界**:Material 原生库在 Web 端对稀疏数组与单位处理不完整,
|
||
部分命令会失败或返回不完整数据。以界面任务实际可用的项为准,
|
||
不要假定材料库的全部 API 都能调用。
|
||
|
||
## 测量、检测、材料与表格的面板
|
||
|
||
| 工作台 | 面板 / 工具栏 | 用途 |
|
||
|---|---|---|
|
||
| Measure | Measure | 选两个元素测距离;选面测面积,选体测体积 |
|
||
| Measure | Mass properties | 质量、体积、质心、惯性矩与主惯性轴 |
|
||
| Measure | Measure appearance defaults | 设置测量标注的显示样式与默认精度 |
|
||
| Inspection | Visual Inspection | 生成检测视图,对比实测与标称形状 |
|
||
| Inspection | Inspect element | 读取单个面/边的几何参数 |
|
||
| Material | Material | 材料库浏览、默认材料与物理属性编辑 |
|
||
| Spreadsheet | Spreadsheet 工具栏 | 新建表格、单元格引用与表达式 |
|
||
|
||
测量标注默认不写入模型,只是视口叠层;需要长期保留的尺寸请用 TechDraw 标注。表格里的单元格可以被 Part/PartDesign 的属性用表达式引用,改一个数即可驱动整套参数。
|
||
|
||
### 测量与检测面板实拍
|
||
|
||
`Inspection_VisualInspection` 的字段区含 `Refresh document` / `Open FCStd`、`Actual` 与 `Nominal` 两组对象选择、
|
||
`Search distance`(默认 1)、`Length unit`(mm)以及 `OK` / `Cancel` / `Help`。Actual 与 Nominal 都要先载入文档才非空:
|
||
|
||

|
||
|
||
Mass properties 点 `Refresh` 之后的结果表是本章最值得对照的证据:Cube 的体积 60 cm³、质量 60 g,
|
||
后面依次是质心、惯性矩阵、主惯性轴与包围盒。它与属性面板的体积读数应当一致:
|
||
|
||

|
||
|
||
按面设置外观:`Shape` 选 Cube,勾选 `Face1` 后可填该面颜色,`Face1–Face6` 各有颜色与不透明度,底部 `Apply colors` 提交:
|
||
|
||

|
||
|
||
Measure 面板的 `Mode` 决定语义:`Distance` 需要两个源与其子元素,`Area` 只需一个面。
|
||
距离测量在 Web 端实测会报 `native_protocol_error: Invalid native builder display geometry`(预览几何构建失败),
|
||
而面积测量正常输出:
|
||
|
||

|
||
|
||
面积测量选 Cube 的 Face1,输出 `10.00 cm^2`:
|
||
|
||

|
||
|
||
`Measure appearance defaults`(点 `Annotate` 打开)控制标注显示:`Label`、Line / Text / Background 三段样式与 `Size`(18),`Apply appearance` 提交:
|
||
|
||

|
||
|
||
**实测缺口**:`Inspection_InspectElement` 没有任务面板(命令状态为 boundary · no worker,任务桥记录 0 task panels),
|
||
本章只讲 `VisualInspection`;距离测量的预览报错如上,面积与标注外观可用。
|
||
|
||
## 边界与注意
|
||
|
||
- 公式与别名的绑定需要在对象属性里显式引用,光设别名不会自动生效。
|
||
- 测量前必须先选中对象,否则任务返回空结果,看起来像功能坏了。
|
||
- 材质库是边界,颜色与外观可用,材料物理属性不一定完整。
|
||
|
||
## 自检
|
||
|
||
- [ ] 能建 Spreadsheet 并输入文本、数字与公式。
|
||
- [ ] 公式 `=B2+C2` 能随 B2 变化自动更新。
|
||
- [ ] 能打开 Measure 与 MassProperties 并读到数值。
|
||
- [ ] 用两种方式测同一对象体积,结果一致。
|
||
- [ ] 能设置颜色并在保存后重新打开确认仍在。
|
||
- [ ] 知道 Material 库的 Web 边界。
|
||
|
||
## 常见错误
|
||
|
||
1. 公式输入后没按 Enter 或没点应用,值没生效。
|
||
2. 测量时没选对象,得到空结果就以为功能不可用。
|
||
3. 只改颜色没触发应用,保存后颜色丢了。
|
||
4. 设置了别名但没在对象属性里引用,以为能自动联动。
|
||
5. 改完表格数值没重新计算,模型还是旧尺寸。
|
||
|
||
## 练习
|
||
|
||
1. 建一张 3 行参数表,用公式计算长 × 宽,并给结果单元格设别名。
|
||
2. 测量一个 Box 的体积与质心,与属性面板对照,记录是否一致。
|
||
3. 给两个对象设不同颜色,保存、刷新、重新打开,确认颜色保留。
|
||
4. 把一个 Box 的 Length 绑定到表格别名,改表格数值,观察对象是否更新。
|