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: 

How to create a dialog using VB.NET?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
jan
Advocate
779 Views, 5 Replies

How to create a dialog using VB.NET?

Using VB.NET, I need to add a dialog in Revit, but it seems to be a bit problematic.
I have tried to study a C # project created in REX expansion wizard, but I can not figure out how exactly the dialogue is implemented and embedded in Revit.

I can find many examples of the use of a task-dialogue, but that is not the kind of dialogue that I need.

What I need is a dialog box that contains some text boxes, combo boxes, etc. and blends nicely into the Revit user interface.

Does anyone have an example of that?

 

regards

Jan grenov

 

5 REPLIES 5
Message 2 of 6
augusto.goncalves
in reply to: jan

To use Forms inside Revit you just need to create a 'classic' WinForm, and there are several samples of that on the web.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 6
jan
Advocate
in reply to: augusto.goncalves

Thanks Augusto

I guess that I might have posted my question unpecisely. My fault. Sorry!

 

I will try to be a little more precise .. 

  1. I have done the "Hello world" a long! time ago, and I know how to make a form in VB!
  2. I just thought that there migth be some elegant way of implementing forms in Revit so that I do not need to check the WinForms Topmost property.
    Similar as in AutoCAD:
    Dim dia As New someDialog(FormOpener.AutoCAD)

    Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(dia)

I want my form to be hidden when the Revit window is hidden. Not to show as if it was an an independant application. Must I somehow refer to the Revit hwnd or have I missed something basic?

 

Regards

Jan Grenov

 

Message 4 of 6
PhillipM
in reply to: jan

Ok.

 

You want to show a dockable dialog that belongs to Revit.  Two options.

 

  1. Revit 2015 - & 2014.  Using the dockableDialog interface.  There is a good example of that working in the SDK called DocakableDialogs.  You will actually be using WPF forms for this unless you host a Win Form inside of a WPF form.
  2. Pre Revit 2014.  AS you suggest using Revit hwnd and there is examples of that on Jeremy's Building COder blog i'm pretty sure.

Regards

Phillip

Message 5 of 6
jeremy_tammik
in reply to: jan

Dear Jan,

 

Yes, you were indeed imprecise  🙂

 

Yet, rejoice!

 

Salvation is nigh!

 

Google for "JtWindowHandle":

 

http://lmgtfy.com/?q=revit+api+JtWindowHandle

 

Cheers,

 

Jeremy

 

p.s. Phillip's answer is very valuable. If you can use a hosted palette, that is much more elegant and integrated. Thank you, Phillip!

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 6 of 6
jan
Advocate
in reply to: jeremy_tammik

Thanks Guys 🙂
I think that I will look a little more into those "hosted palettes". Sounds as an interesting solution.

Regards
Jan

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community