As announced previously, Revit Addin Wizard (RevitAddinWizard) and its various wizards, coders and widgets have supported Revit API 2012 additionally natively and seamlessly.
In this post, let us have a look at the External Application Creator/Wizard. Its wizard pages are the same as before. The only difference is that for Revit API 2012 addin projects the Regeneration option has only Manual for choosing.
Other settings, options, UIs and the auto-generated code are the same as before and compatibility with Revit API 2011 is perfectly maintained.
Here is the auto-generated external application class:
#region Namespaces
using System;
using System.Text;
using System.Linq;
using System.Xml;
using System.Reflection;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
using System.IO;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Events;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Plumbing;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.UI.Events;
using Autodesk.Revit.Collections;
using Autodesk.Revit.Exceptions;
using Autodesk.Revit.Utility;
using RvtApplication = Autodesk.Revit.ApplicationServices.Application;
using RvtDocument = Autodesk.Revit.DB.Document;
#endregion
namespace RevitAddinCS1
{
[Transaction(TransactionMode.Automatic)]
[Regeneration(RegenerationOption.Manual)]
public class ExtApp1 : IExternalApplication
{
#region Cached Variables
public static UIControlledApplication _cachedUiCtrApp;
#endregion
#region IExternalApplication Members
public Result OnStartup(UIControlledApplication uiApp)
{
_cachedUiCtrApp = uiApp;
try
{
//TODO: add you code below.
return Result.Succeeded;
}
catch (Exception ex)
{
MessageBox.Show( ex.ToString() );
return Result.Failed;
}
}
public Result OnShutdown(UIControlledApplication uiApp)
{
try
{
//TODO: add you code below.
return Result.Succeeded;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return Result.Failed;
}
}
#endregion
#region Local Methods
#endregion
}
}
Revit Addin Wizard (RevitAddinWizard) and its various wizards, coders and widgets have supported Revit API 2012 additionally natively and seamlessly.
Recent Comments