Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transactions Impossible? #9

Open
RyanDaley opened this issue Oct 23, 2022 · 2 comments
Open

Transactions Impossible? #9

RyanDaley opened this issue Oct 23, 2022 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@RyanDaley
Copy link

I am writing new methods in the Methods.cs class. Everything works fine until I try to use a transaction to make a change to the active document. I can't get transactions to work at all. Are transactions not possible from a plugin?

@RyanDaley
Copy link
Author

image

@mitevpi
Copy link
Owner

mitevpi commented Oct 24, 2022

Transactions are possible from a plugin, but they have to happen in a valid Revit API context.

Here is an example method using a transaction in this template

And here is how that same method is invoked from the WPF UI.

Most of the work is done by the RevitEventWrapper which basically just ensures the transaction happens in a "valid Revit API context".

@mitevpi mitevpi self-assigned this Oct 24, 2022
@mitevpi mitevpi added the question Further information is requested label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants