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 open the dialog 'New Project' from my application Visual Basic 2012

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
756 Views, 4 Replies

how to open the dialog 'New Project' from my application Visual Basic 2012

Hi, I am developing an application to add design templates in REVIT 2014 using Visual Studio 2012 My question is:
how to open the dialog 'New Project' from my application Visual Basic 2012?

4 REPLIES 4
Message 2 of 5
Revitalizer
in reply to: Anonymous

Dear marcosmateo,

 

you could just simulate user input by using UIAutomation:

 

http://thebuildingcoder.typepad.com/blog/2011/01/ribbon-spying-and-ui-automation.html

 

There is a method called OpenRevitFile(string filePath) which opens the "Open File" dialog.

The "New Projekt" dialog may be shown in a similar manner.

 

Note that this is an old post, so the internal menu structure may have changed, meaning that you need to adjust the code for your purposes.

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 3 of 5
Anonymous
in reply to: Revitalizer

Hi Revitalizer

Thanks for answer.

Message 4 of 5
PhillipM
in reply to: Anonymous

Or a much tidier way of handling this which is also supported by the Revit API is using the postable command.

 

  formapp.PostCommand(Autodesk.Revit.UI.RevitCommandId.LookupPostableCommandId(Autodesk.Revit.UI.PostableCommand.OpenRevitFile))

 

Cheers

Phillip

Message 5 of 5
Revitalizer
in reply to: PhillipM

Dear PhillipM,

 

🙂 of course you are right. The blog post dates from 2011, so it describes an old-fashioned way...

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





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