public Result Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
UIApplication app = commandData.Application;
Document doc = app.ActiveUIDocument.Document;
if( doc.IsFamilyDocument )
{
using ( Transaction t = new Transaction( doc ) )
{
t.Start( "New Blend" );
Blend blend = CreateBlend( doc );
t.Commit();
}
return Result.Succeeded;
}
else
{
message = "Please run this command "
+ "in a family document.";
return Result.Failed;
}
}