Add TemporaryGraphics wrapper and developer example bundle#3440
Open
Wurschdhaud wants to merge 7 commits into
Open
Add TemporaryGraphics wrapper and developer example bundle#3440Wurschdhaud wants to merge 7 commits into
Wurschdhaud wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new pyrevit.revit.tmpgfx helper module that wraps Revit’s TemporaryGraphicsManager and ITemporaryGraphicsHandler, plus a DevTools sample command demonstrating placing an in-canvas warning icon on a picked element and handling clicks.
Changes:
- Added
pyrevit.revit.tmpgfxwithHandler(service registration + click dispatch) andControlManager(add/remove/clear/sync temporary in-canvas controls). - Added a persistent-engine developer example bundle that places a warning icon control on a selected element and shows element info on click.
- Added a bundle
config.pyintended to clean up temp graphics/handlers for the persistent example.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
pyrevitlib/pyrevit/revit/tmpgfx.py |
New wrapper module around TemporaryGraphics external service handler + per-view control management utilities |
extensions/pyRevitDevTools.extension/pyRevitDev.tab/Developer Examples.panel/TemporaryGraphics.pushbutton/script.py |
Developer sample placing a control and handling clicks via the new wrapper |
extensions/pyRevitDevTools.extension/pyRevitDev.tab/Developer Examples.panel/TemporaryGraphics.pushbutton/config.py |
Cleanup logic for the persistent example bundle |
extensions/pyRevitDevTools.extension/pyRevitDev.tab/Developer Examples.panel/TemporaryGraphics.pushbutton/bundle.yaml |
Declares title and persistent engine requirement for the sample |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
Won't be able to fix the comments for the next 2-3 weeks. So I guess one for the next release |
- safeguard against -1 (not documented for Revit API, but little to no overhead)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
pyrevit.revit.tmpgfxhelper module for managing Revit temporary in-canvas controls and click handlers.ControlManagerandHandlerabstractions forDB.TemporaryGraphicsManagerandUI.ITemporaryGraphicsHandlerextensions/pyRevitDevTools.extension/.../TemporaryGraphics.pushbuttonChecklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}