public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var uiApp = commandData.Application;
            var doc   = uiApp.ActiveUIDocument.Document;

            doc.SaveAs(StartDesigning.GetSafeFilePath(doc));

            return(Result.Succeeded);
        }
        private void ControlledApplication_DocumentOpened(object sender, Autodesk.Revit.DB.Events.DocumentOpenedEventArgs e)
        {
            var document = e.Document;

            if (!StartDesigning.IsProjectReady(document))
            {
                return;
            }

            document.SaveAs(StartDesigning.GetSafeFilePath(document));
            document.ReloadLatest(new ReloadLatestOptions());
        }
 public bool IsCommandAvailable(UIApplication a, CategorySet b)
 {
     return(StartDesigning.IsProjectReady(a));
 }