Add plugin GUID, fix template import and dialog improvements

- Add [assembly: Guid(...)] for proper Rhino plugin registration
- Fix Import() to add new config to _configs after importing XML
- Simplify XmlImportDialog: remove section labels, add conflict confirmation
- Move plugin data folder to standard Plug-ins path with GUID suffix
- Add ContractXml as third embedded template
- Update README with correct import flow and build requirements
- Fix csproj duplicate PropertyGroup issue
This commit is contained in:
2026-05-02 11:34:51 +08:00
parent c54bdebe59
commit 37888b5f7e
7 changed files with 184 additions and 86 deletions

View File

@@ -1,6 +1,6 @@
# UserStringProperty
Rhino 插件,用于根据用户自定义 XML 配置,给 Block 实例附加构件属性UserString
Rhino 插件,根据用户自定义 XML 配置,给 Block 实例附加属性UserString
## 功能
@@ -9,7 +9,7 @@ Rhino 插件,用于根据用户自定义 XML 配置,给 Block 实例附加
- 自动保存到 Rhino Block 的 UserString
- 支持多个 XML 模板同时加载、合并
- 模板自动持久化Rhino 重启后自动恢复
- 导入时提供四种合并模式(追加、替代、合并更新、智能合并)
- 导入时检测属性集冲突,覆盖或新增
## 安装
@@ -32,28 +32,25 @@ dotnet build
1. 在 Rhino 中输入命令:`UserstringProperty`
2. 选择要编辑的 Block 实例
3. 默认模板首次启动自动加载;点 **加载XML** 导入自定义模板
4.下拉框中选择属性集,编辑各字段值
5. 点击 **保存**
4.弹出的对话框中选择 cmig 和属性集,若同名已存在则需确认覆盖
5. 在下拉框中选择属性集,编辑各字段值
6. 点击 **写入属性**
## 模板导入模式
## 模板导入
加载 XML 时,如果已有模板,会弹出对话框让选择导入模式
加载 XML 时,会弹出对话框让选择 cmig 和属性集,检测同名冲突
| 模式 | 说明 |
|------|------|
| 添加为新属性集 | 追加到现有列表末尾 |
| 完全替代现有模板 | 清空所有现有属性集 |
| 合并更新 | 同名属性集覆盖,其他保留 |
| 智能合并 | 同名覆盖,同时追加新属性集 |
- **同名属性集不存在** → 直接保存为新模板
- **同名属性集已存在** → 需确认是否覆盖
## XML 配置格式
插件根据 XML 动态生成 UI。示例参见 `Component_Property_base.xml``Component_Property_carbon.xml`
插件根据 XML 动态生成 UI。示例 XML 格式如下:
```xml
<?xml version="1.0" encoding="utf-8"?>
<cmig name="构件编码">
<propertyset name="构件属性-基" exclusive="false">
<cmig name="构件属性">
<propertyset name="构件属性-基" exclusive="false">
<!-- string 类型 → TextBox -->
<property name="0-00-02-年代" type="string" default="PRC"/>
@@ -95,7 +92,7 @@ dotnet build
```
UserStringProperty/
├── CLAUDE.md # agent 指示(不要当作文档)
├── CLAUDE.md # agent 指示
├── PLAN.md # 待办事项与开发计划
├── UserStringProperty.csproj
├── UserStringProperty.cs # 插件主类
@@ -111,11 +108,15 @@ UserStringProperty/
└── EmbeddedTemplates.cs # 内嵌默认 XML 模板
```
## 环境要求
## 编译环境
- **.NET SDK 8.0**
- **Rhino 8**(包含 RhinoCommon.dll SDK 引用)
- Windows 10/11
## 运行时要求
- Rhino 8
- .NET Framework 4.8
- .NET SDK 8.0(编译用)
## License