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?
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
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
Dear PhillipM,
🙂 of course you are right. The blog post dates from 2011, so it describes an old-fashioned way...
Best regards,
Revitalizer