Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

using mvvm & wpf with transaction & doc.regenerate()

Message 1 of 3
2298 Views, 2 Replies

using mvvm & wpf with transaction & doc.regenerate()

hi dears

i'm working on simple command
it have wpf form bonded to class as per mvvm methods

i call the wpf from my command and it show up using wpf,show();

i use the form and change data then click the buttom to run command on viewmodel from my form as usual in mvvm to pick the objects and change its data
i can close my form
when selecting the object after that i can see that parameter data has changed as i want but document can't fell that changes and i can't generate the document
my problem is i cant use transaction.start on my mvvm command and ca't regenerate the document to see the changes in the tags
how can i solve that?

many thanks in advance

Message 2 of 3
in reply to: Anonymous

It sounds as if your WPF form is not running as a modal form within a valid Revit API context.


Consequently, you are trying to access Revit and its API from outside. This is basically not possible. A workaround exists via the use of an external event:


This issue was recently discussed in another thread on Revit API with WPF:


The official approach is presented in the Revit SDK sample ModelessDialog/ModelessForm_ExternalEvent.


Many other discussions and solutions are listed by The Building Coder in the topic group on Idling and External Events for Modeless Access and Driving Revit from Outside:






Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3
in reply to: jeremytammik

dear Jeremy

many thanks for your continuous support

i will study those links
i fell it will be very helpful

thanks again


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups

Rail Community