Example #1
0
        public bool Run()
        {
            RoomWindow sw = new RoomWindow();

            sw.DataContext = this;
            if (sw.ShowDialog() == true)
            {
                return(true);
            }
            return(false);
        }
Example #2
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {
                m_app = commandData.Application;
                m_doc = m_app.ActiveUIDocument.Document;
                Log.AppendLog(LogMessageType.INFO, "Started");

                // (Konrad) We are gathering information about the addin use. This allows us to
                // better maintain the most used plug-ins or discontiue the unused ones.
                AddinUtilities.PublishAddinLog(
                    new AddinLog("MassTools-CreateMass", commandData.Application.Application.VersionNumber));

                GetModelInformation();
                var sourceWindow = new MassSourceWindow(m_app, modelDictionary);
                if (sourceWindow.ShowDialog() == true)
                {
                    selectedSource = sourceWindow.SelectedSourceType;
                    switch (selectedSource)
                    {
                    case SourceType.Rooms:
                        roomDictionary = sourceWindow.RoomDictionary;
                        var roomWindow = new RoomWindow(m_app, modelDictionary, roomDictionary);
                        roomWindow.ShowDialog();
                        break;

                    case SourceType.Areas:
                        areaDictionary = sourceWindow.AreaDictionary;
                        var areaWindow = new AreaWindow(m_app, modelDictionary, areaDictionary);
                        areaWindow.ShowDialog();
                        break;

                    case SourceType.Floors:
                        floorDictionary = sourceWindow.FloorDictionary;
                        var floorWindow = new FloorWindow(m_app, modelDictionary, floorDictionary);
                        floorWindow.ShowDialog();
                        break;
                    }
                }

                Log.AppendLog(LogMessageType.INFO, "Ended.");
                return(Result.Succeeded);
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
                return(Result.Failed);
            }
        }