PDA

View Full Version : Show Form in Revit 8.1



samsoncpwong
2006-04-02, 04:20 AM
I want to show a form in Revit. The form contains a combo box. A specific string will return to a parameter depending on what I select from the combo box. Also I want the form can float on top of Revit and keep running so that I can repeat the procedure of selecting objects in Revit and assigning value through the form.

I find that when I click the apply button, Revit is only in the status of "during a current action" (Undo changes to Abort) The action will be completed if I drag or move the selected object. How can I complete the action?

BTW, I tried for my same code, if I show the form as a dialog and hide the form after clicking apply, the action will be completed. What's the implication between show and showdialog?

Thanks a lot.

Danny Polkinhorn
2006-04-05, 03:18 AM
In any situation, your code needs to complete before Revit can/will continue. Your code will run in a single transaction on the Revit database, so your return value will determine whether Revit keeps your changes or discards them.

You cannot create a modeless dialog. So, because of this, ShowDialog (modal) is the most appropriate method to use. If you use Show, your code will only complete when you unload the form (essentially modal).

Hope that helps,

samsoncpwong
2006-04-07, 12:23 PM
Thanks Danny. I hope it will be feasible in future version.