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: 

Developing Modulus Windows Form Addin

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
648 Views, 2 Replies

Developing Modulus Windows Form Addin

I am trying to develop a addin that uses a Windows From User Control, with a lot of inputs/ buttons that I would like to interact with the revit model. I have read through various sources that you have to be careful when using the API through an external application so I had a few questions.

 

My Form UserControl is brought up in a window after a button is clicked on the ribbon panel. The excute method of the button passes the commandData to the usercontrol class, where I interact with the API. An example of the functionality of the windows form is exporting to DWF. 

 

Is it ok to pass the command data to my usercontrol ssince the excute method of the button on the ribbon panel is active as long as the usercontrol window is open? I played around with trying to do it other ways like using Idling, but this is much harder to implement seeing that I am interacting with the API alot.

 

Any help is appreciated.

 

Thanks

2 REPLIES 2
Message 2 of 3
arnostlobel
in reply to: Anonymous

Hello jzayas,

 

As long as your form is modal - that is you can not return from execution of your external command untill the form is dismissed, you can call the Revit API from it pretty much in any way you want. And yes, you can pass the commandData to it and use it there.

 

The workflow based on the Idling event is only necessary for modeless dialogs, that is dialogs that stay open after the external command that brought it up finishes its execution and returns control back to Revit.

 

Thank you for you interest

 

Arnošt Löbel

Autodesk, Revit R&D

 

 

Arnošt Löbel
Message 3 of 3
Anonymous
in reply to: arnostlobel

Hi jzayas,
I'm learning the Revit API and I'm trying to create a similar addin which I use the Windows Form. Do you have an example of how you accomplished passing the command data to the form and applying it to the From button and UserControls.

Thank you.

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

Post to forums  

Autodesk Customer Advisory Groups


Rail Community