Revit and MVVM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
New to programming in C# and the Revit API and I think implementing some MVVM will help solve a lot of the complications my programs are running into.
First basic question, would implementing a MVVM allow me to quickly see, say a list of beams in revit, and if the beam type names get updated in revit, the beam list would update dynamically?
See below in the gif, the current setup does not know that the initial selected types names changed, would an MVVM solution solve this?
Secondly, are there any good examples of Revit and MVVM? This is a sea of syntax I have not seen before, so some examples would be very helpful. I assume I could also follow any MVVM example and the lessons learned would still apply, but if there are good Revit examples, that would be helpful.
I have the non-working test code (shown in the .gif above) up on github:
https://github.com/retug/LearningCSharp/tree/main/MVVM
My Model - RevitFramingModel.cs
My ViewModel - MainViewModel.cs
My View - MainWindow.cs
Most of this was put together with chatgpt, but if you see any issues regarding the datagrid not dynamically updating with the updated Revit beam type names, I would appreciate the pointer.
Thanks!