Skip to main content

revit-dockable-pane

Register a WPF dockable pane in the Autodesk Revit UI with Nice3point.Revit.Toolkit DockablePaneProvider. USE FOR: registering a dockable pane and its initial dock state during application startup with the fluent API.

跳到安装

来源信息

仓库
Nice3point/revit-skills
最近来源活动
2026年7月23日 12:21
检测到的 SKILL.md 语言
英语
星标
13
分支
3

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
revit-dockable-pane
description
Register a WPF dockable pane in the Autodesk Revit UI with Nice3point.Revit.Toolkit DockablePaneProvider. USE FOR: registering a dockable pane and its initial dock state during application startup with the fluent API.
license
MIT
# Revit Dockable Pane `DockablePaneProvider.Register(...).SetConfiguration(...)` (from `Nice3point.Revit.Toolkit`) wraps the verbose `IDockablePaneProvider` registration into a fluent call. Register the pane once during application startup. ## When to use - Adding a WPF dockable pane to the Revit UI and setting its initial dock position. ## Workflow ### Step 1: Register during startup ```csharp DockablePaneProvider .Register(uiControlledApplication, paneId, "Analysis") .SetConfiguration(data => { data.FrameworkElement = new AnalysisPaneView(); data.InitialState = new DockablePaneState { MinimumWidth = 300, DockPosition = DockPosition.Right }; }); ``` where `paneId` is a `Guid` or `DockablePaneId` value. `.Register(uiControlledApplication, paneId, "Analysis")` can be replaced with: ```csharp DockablePaneProvider .Register(uiControlledApplication) .SetId(paneId) // or SetId(dockablePaneId) .SetTitle("Analysis"); ``` ### Step 2: Resolve the view from DI when needed For a pane element built from a DI container, set `data.FrameworkElementCreator` to a `FrameworkElementCreator<T>` backed by the service provider (from `Nice3point.Revit.Toolkit`): ```csharp data.FrameworkElementCreator = new FrameworkElementCreator<AnalysisPaneView>(serviceProvider); ``` ### Step 3: Verify Confirm the pane appears under the Revit view tab and docks in the configured position. ## Validation - [ ] The pane is registered once during application startup with a stable pane id. - [ ] `FrameworkElement` (or `FrameworkElementCreator`) and `InitialState` are set. ## Common Pitfalls | Pitfall | Correct approach | |----------------------------------------------|-----------------------------------------------------------------| | Implementing `IDockablePaneProvider` by hand | Use `DockablePaneProvider.Register(...).SetConfiguration(...)`. | | A new pane id (`Guid`) generated per run | Use a stable, persisted pane id. | | `DockablePaneProvider` not found | The `Nice3point.Revit.Toolkit` package is not referenced. |
在 GitHub 查看