BuildingCoder.CmdNewBlend.Execute C# (CSharp) 메소드

Execute() 공개 메소드

public Execute ( ExternalCommandData commandData, string &message, ElementSet elements ) : System.Result
commandData ExternalCommandData
message string
elements ElementSet
리턴 System.Result
        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;
              }
        }