pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.3k stars 332 forks source link

Real Time reporting in Revit through modeless form #952

Closed jashwanthl closed 4 years ago

jashwanthl commented 4 years ago

Hey Ehsan,

Is your feature request related to a problem? Please describe. The feature request is not part of a problem but a possible solution to a problem... I was wondering if it was possible to create a modeless form that can update itself when the user makes changes in the project.

Describe the solution you'd like The textblock in the xaml/UI is able to update itself either to a hook such as doc-changed event or a timed refresh so that it can reflect the updated calculated values and area in the project

Describe alternatives you've considered I have been experimenting different methods to create a revit widget/dashboard that could display information like the square footage or program types using forms/UIs etc., but inside revit if I was to start something a transaction is invoked and the user can't make any changes.So I figured a modeless form could help achieve this goal...

Additional context But the problem I encountered with modeless form is that I'm not able to find a way to update the text block. for eg., I tried to get the base constraint to update as per the selection but I'm having to close the ui and open it again for it to change the textblock to the new selection. (Attached image from a test project)

pyrevit question

eirannejad commented 4 years ago

If you are using C# take a look at this: https://github.com/mitevpi/revit-wpf-template It has great examples of how modeless windows can work in Revit

If you are using python, [take a look at this bundle] (https://github.com/eirannejad/pyRevit/tree/master/extensions/pyRevitDevTools.extension/pyRevitDev.tab/Debug.panel/Unit%20Tests.pulldown/Test%20Sensors.pushbutton). You can find it and run it in pyRevitDev extension under Unit Tests. I'm working on an api to make this process super easy on python, so the API is subject to change but it will give you a glimpse of what is coming

I'm also working on a video tutorial series for creating GUI interfaces: https://www.notion.so/pyrevitlabs/d14da0c8a75e4510ada489aaa43d8e4e?v=ed14f61623ba422a9004b0dc0ef71e4d

jashwanthl commented 4 years ago

@eirannejad That is amazing !!! Thank you sir for a speedy response I owe you a great debt :)