- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm currently working on a custom Add-in for Revit with pyRevit. The Add-in runs a form created with Windows.Forms library with a button in it. When the button is pressed its supposed to take id of an object from project and appliy Selection Box command to it. I did everything right, but the problem is that the PostableCommand only executes if you close the form. Else if you press the button twice or more it just gives back an error saying 'Revit does not support more than command are posted'.
If I get it right, you cannot run a command and form together at one time. Anyways, I'm sure there is some way to avoid it.
On the internet I found solutions like:
-subscribing to Idling to see if Revit is busy with some command at the moment
-some 'Invoking' methods. (Didnot get how it works)
-closing the current form and creating a new one (the closest one)
maybe the last one is what I need. But how do I make Revit do the command in the span of time from closing original
form and running a new one? (run the first form -> button pressed -> close the form -> execute command -> run the copy of the original form)
Big thanks to all who will answer!!
Solved! Go to Solution.