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

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
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

2 REPLIES 2
Message 2 of 3
jeremytammik
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:

 

http://www.revitapidocs.com/2018/05089477-4612-35b2-81a2-89c4f44370ea.htm

 

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

 

https://forums.autodesk.com/t5/revit-api-forum/revit-api-with-wpf/m-p/8209618

 

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:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28

 

Cheers,

 

Jeremy

 



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

Message 3 of 3
Anonymous
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