Example #1
0
 private void UpdateActiveView(ViewActivatedEventArgs e)
 {
     if (e.Status == EventStatus.Succeeded)
     {
         activeView = e.CurrentActiveView;
     }
 }
Example #2
0
 /// <summary>
 /// Handler for Revit's ViewActivated event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void OnApplicationViewActivated(object sender, ViewActivatedEventArgs e)
 {
     if (revitDynamoModel != null)
     {
         revitDynamoModel.HandleRevitViewActivated();
     }
 }
        //Check if the Document is a FamilyDocument
        private void CheckDoc(ViewActivatedEventArgs e)
        {
            Document doc = e.CurrentActiveView.Document;

            // If the document is a Family Document, disable the UI
            if (!doc.IsFamilyDocument)
            {
                if (!_disabled)
                {
                    _presenter.Disable();
                    _disabled = true;
                }
                return;
            }
            else
            {
                if (_disabled)
                {
                    _presenter.Enable();
                    _disabled = false;
                }
            }
            if (_document.Title != doc.Title)
            {
                _document           = doc;
                _presenter.Document = doc;
                _presenter.DocumentSwitched();
            }
        }
Example #4
0
 void Application_ViewActivated(
     object sender,
     ViewActivatedEventArgs e)
 {
     m_MyDockableWindow.lblProjectName.Content
         = e.Document.ProjectInformation.Name;
 }
Example #5
0
        /// <summary>
        /// On Document Switched
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnViewActivated(object sender, ViewActivatedEventArgs e)
        {
            Document doc = e.CurrentActiveView.Document;

            // If the document is a Family Document, disable the UI
            if (doc.IsFamilyDocument)
            {
                if (!_disabled)
                {
                    _presenter.Disable();
                    _disabled = true;
                }
                return;
            }
            else
            {
                if (_disabled)
                {
                    _presenter.Enable();
                    _disabled = false;
                }
            }

            if (_document.Title != doc.Title)
            {
                _document               = doc;
                _currentCount           = doc.GetWarnings().Count;
                _presenter._Application = new UIApplication(doc.Application);
                _presenter.DocumentSwitched();
            }
        }
Example #6
0
 private void PassRevitDocumentInstance_OnViewActivated(object sender, ViewActivatedEventArgs e)
 {
     if (_parameterEditorWPFPage.RevitDocument != e.Document)
     {
         _parameterEditorWPFPage.RevitDocument = e.Document;
     }
 }
Example #7
0
        /// <summary>
        /// The onViewActivated
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/></param>
        /// <param name="e">The e<see cref="ViewActivatedEventArgs"/></param>
        private void onViewActivated(object sender, ViewActivatedEventArgs e)
        {
            _doc = e.Document;

            //_uiDoc = new UIDocument(doc);
            PanelProprety._uiDoc = new UIDocument(_doc);
        }
Example #8
0
 /// <summary>
 /// Actions performed when any view has been made ActiveView
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UIControlledApplication_ViewActivated(object sender, ViewActivatedEventArgs e)
 {
     if ((this.doc != null) && (thisApp.doc != e.CurrentActiveView.Document))
     {
         this.doc           = e.CurrentActiveView.Document;
         this.projectNumber = this.doc.Title;
     }
 }
 private void UiApplication_ViewActivated(object sender, ViewActivatedEventArgs e)
 {
     if (!Equals(e.Document, _currentDocument) && MainWindow != null)
     {
         _currentDocument = e.Document;
         SearchImportsAndBind(true);
     }
 }
Example #10
0
 //On Document Switched
 private void OnViewActivated(object sender, ViewActivatedEventArgs e)
 {
     if (!Started)
     {
         return;            // only do if the plugin is active
     }
     Control.Show(e);
 }
 //Show the UI
 public void Show(ViewActivatedEventArgs e)
 {
     if (_presenter == null)
     {
         ShowForm();
         return;
     }
     CheckDoc(e);
 }
 private void Revit_ViewActivated(object sender, ViewActivatedEventArgs e)
 {
     //if Dynamo doesn't have a view, then latch onto this one
     if (DocumentManager.Instance.CurrentUIDocument != null)
     {
         dynSettings.Controller.DynamoLogger.LogWarning(GetDocumentPointerMessage(), WarningLevel.Moderate);
         ResetForNewDocument();
     }
 }
Example #13
0
        void OnViewActivated(object sender, ViewActivatedEventArgs args)
        {
            View     vCurrent         = args.CurrentActiveView;
            Document currentActiveDoc = vCurrent.Document;

            // Сохранение имени активного документа для использования в
            // валидации изменения площадки !текущего файла!
            Globals.ActiveDocumentTitle = currentActiveDoc.Title;
        }
Example #14
0
        static void OnViewActivated(object sender, ViewActivatedEventArgs e)
        {
            View Previous = e.PreviousActiveView;
            View Current  = e.CurrentActiveView;

            if (Previous == null || !Previous.Document.Equals(Current.Document))
            {
                FDirectLink.ActivateInstance(Current.Document);
            }
        }
Example #15
0
        private void OnViewActivated(object sender, ViewActivatedEventArgs e)
        {
            if (e.Document == null)
                return;

            var viewModel = MyDockablePaneControl.DataContext as MyDockablePaneViewModel;

            if (viewModel != null)
            {
                viewModel.DocumentTitle = e.Document.Title;
            }
        }
Example #16
0
        /// <summary>
        /// Handler for Revit's ViewActivated event.
        /// This handler is called when a view is activated. It is called
        /// after the ViewActivating event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Revit_ViewActivated(object sender, ViewActivatedEventArgs e)
        {
            // If there is no active document, then set it to whatever
            // document has just been activated
            if (DocumentManager.Instance.CurrentUIDocument == null)
            {
                DocumentManager.Instance.CurrentUIDocument =
                    DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument;

                DynamoViewModel.RunEnabled = true;
            }
        }
Example #17
0
 void OnViewActivated(object sender, ViewActivatedEventArgs e)
 {
     try {
         View vPrevious = e.PreviousActiveView;
         View vCurrent  = e.CurrentActiveView;
         //TaskDialog.Show("test", (sender as UIApplication).ActiveUIDocument.Document.Title);
         //_window.Close();
         _window = new Lab5Window((sender as UIApplication).ActiveUIDocument);
         //PopulateList();
     } catch (Exception ex) {
         throw ex;
     }
 }
Example #18
0
        private void OnviewActivated(object sender, ViewActivatedEventArgs e)
        {
            var uiapp = sender as UIApplication;
            var uidoc = uiapp.ActiveUIDocument;
            var doc   = uidoc.Document;

            var acview = doc.ActiveView;

            if (acview.Id != Id_view1 && acview.Id != Id_view2 && acview.Id != Id_view3 && acview.Id != Id_view4)
            {
                uiapp.Idling -= OnIdling;
            }
        }
Example #19
0
        private void ViewActivated(object sender, ViewActivatedEventArgs args)
        {
            View vPrev = args.PreviousActiveView;
            View vCurr = args.CurrentActiveView;

            if (AUTO_UPDATE_ON_ACTIVATE_DOCUMENT &&
                !vPrev.Document.Title.ToLower().Equals(vCurr.Document.Title.ToLower()))
            {
                _formProjSel.UpdateWindowLayout();
            }
//			else if (AUTO_UPDATE_ON_OPEN_VIEW)
//			{
//				_formProjSel.UpdateWindowLayoutDelay();
//			}
        }
Example #20
0
 /// <summary>
 /// View change will detect a model change
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void OnViewActivated(object sender, ViewActivatedEventArgs e)
 {
     try
     {
         if (Settings == null)
         {
             Settings = new SettingsHelper(e.Document, null);
         }
         if (Settings.App == null)
         {
             HideDockablePane();
         }
     }
     catch { }
 }
Example #21
0
        private void OnViewActivated(object sender, ViewActivatedEventArgs e)
        {
            var doc = e.CurrentActiveView.Document;

            if (doc == null || doc.IsFamilyDocument || !DocumentChanged(doc))
            {
                return;
            }

            var uiApp = (UIApplication)sender;

            if (uiApp != null)
            {
                CheckIn(doc);
            }
        }
Example #22
0
        internal void OnViewActivated(object sender, ViewActivatedEventArgs e)
        {
            if (running)
            {
                return;
            }

            Document doc = e.Document;

            if (docdict.ContainsKey(doc))
            {
                countdown  = 0;
                relinquish = false;
                sync       = false;
                close      = false;
            }
        }
Example #23
0
        public void Application_ViewActivated(object sender, ViewActivatedEventArgs args)
        {
            UIApplication uiapp = sender as UIApplication;

            var docTabGroup = GetDocumentTabGroup(uiapp);

            if (docTabGroup != null)
            {
                var docTabs = GetDocumentTabs(docTabGroup);

                foreach (TabItem tab in docTabs)
                {
                    //tab.BorderBrush = Brushes.Red;
                    //tab.BorderThickness = new System.Windows.Thickness(2);

                    SolidColorBrush planBrush = new SolidColorBrush(Colors.PaleVioletRed);
                    planBrush.Opacity = 0.75;

                    SolidColorBrush sectBrush = new SolidColorBrush(Colors.PaleGoldenrod);
                    planBrush.Opacity = 0.75;

                    SolidColorBrush threeDBrush = new SolidColorBrush(Colors.PaleTurquoise);
                    planBrush.Opacity = 0.75;

                    SolidColorBrush sheetBrush = new SolidColorBrush(Colors.PaleGreen);
                    planBrush.Opacity = 0.75;

                    if (tab.ToolTip.ToString().Contains("Plan:"))
                    {
                        tab.Background = planBrush;
                    }
                    else if (tab.ToolTip.ToString().Contains("Section:"))
                    {
                        tab.Background = sectBrush;
                    }
                    else if (tab.ToolTip.ToString().Contains("3D View:"))
                    {
                        tab.Background = threeDBrush;
                    }
                    else if (tab.ToolTip.ToString().Contains("Sheet:"))
                    {
                        tab.Background = sheetBrush;
                    }
                }
            }
        }
Example #24
0
        public static void ViewChangeTime(object sender, ViewActivatedEventArgs args)
        {
            View     closingView = args.PreviousActiveView;
            View     openedView  = args.CurrentActiveView;
            Document closingDoc  = closingView.Document;
            Document openedDoc   = openedView.Document;

            if (closingView != openedView)
            {
                EventData rdata = new EventData("ProjectTime");
                rdata.DirSetup();
                string        fp    = closingDoc.PathName;
                BasicFileInfo bfi   = BasicFileInfo.Extract(fp);
                string        fpath = bfi.CentralPath.Split('\\').Last().Split('.').First();
                string        pnum  = closingDoc.ProjectInformation.Number.ToString();

                EventData cdata = new EventData(pnum);
                string[]  Open  = File.ReadAllLines(cdata.FileName);

                DateTime dtin = DateTime.MinValue;
                DateTime.TryParse(Open.Last().Split(',')[3], out dtin);
                if (dtin != DateTime.MinValue)
                {
                    long     timedif = rdata.Time.Ticks - dtin.Ticks;
                    double   hours   = TimeSpan.FromTicks(timedif).TotalHours;
                    string[] clines  = new string[1];
                    clines[0] = rdata.User + "," + pnum + "," + fpath + "," + rdata.Time + "," + hours.ToString() + "," + Open.Last().Split(',')[4];
                    File.AppendAllLines(rdata.FileName, clines);
                    File.Delete(cdata.FileName);
                }

                if (!openedDoc.IsFamilyDocument)
                {
                    string        ofp    = openedDoc.PathName;
                    BasicFileInfo obfi   = BasicFileInfo.Extract(fp);
                    string        ofpath = obfi.CentralPath.Split('\\').Last().Split('.').First();
                    string        opnum  = openedDoc.ProjectInformation.Number.ToString();
                    EventData     odata  = new EventData(opnum);

                    string[] olines = new string[1];
                    olines[0] = odata.User + "," + opnum + "," + ofpath + "," + odata.Time + "," + openedView.Name;
                    File.AppendAllLines(odata.FileName, olines);
                }
            }
        }
Example #25
0
/*
 *    void ComponentManager_UIElementActivated(object sender, adWin.UIElementActivatedEventArgs e)
 *    {
 *       if (e != null && e.Item != null && e.Item.Id != null)
 *       {
 *          if (e.Item.Id == "ID_RESULT_BUTTON")
 *          {
 *             // Perform the button action
 *             if (((adWin.RibbonToggleButton)(e.Item)).IsChecked)
 *                outputPane.Show();
 *             else
 *                outputPane.Hide();
 *          }
 *          if (e.Item.Id == "ID_SERVICE_BUTTON")
 *          {
 *             // Perform the button action
 *             if (((adWin.RibbonToggleButton)(e.Item)).IsChecked)
 *                servicePane.Show();
 *             else
 *                servicePane.Hide();
 *          }
 *       }
 *    }
 */

        private void Application_ViewActivated(object sender, ViewActivatedEventArgs args)
        {
            if (args.Document == null)
            {
                return;
            }

            // If document exists it is already opened
            if (openedDocuments.ContainsKey(args.Document))
            {
                BimbotDocument curDoc = openedDocuments[args.Document];

                // Change the data context of viewing panels to the current document
                DockableResultPanel.DataContext   = curDoc;
                DockableServicesPanel.DataContext = curDoc;
                ExtEvents.ChangeDocumentHandler.documentToUpdate = curDoc;
            }
        }
Example #26
0
        //public void application_Sync(object sender, DocumentSynchronizingWithCentralEventArgs args)
        //{
        //    Document doc = args.Document;
        //progress.Report(doc);
        //}
        public void getdoc(object sender, ViewActivatedEventArgs args)
        {
            doc = args.Document;
            ComboBoxMemberData Range1 = new ComboBoxMemberData("0", "1/2\"");
            ComboBoxMemberData Range2 = new ComboBoxMemberData("1", "1\"");
            ComboBoxMemberData Range3 = new ComboBoxMemberData("2", "3\"");
            ComboBoxMemberData Range4 = new ComboBoxMemberData("3", "1' 0\"");
            ComboBoxMemberData Range5 = new ComboBoxMemberData("4", "3' 0\"");
            ComboBoxMemberData Range6 = new ComboBoxMemberData("5", "10' 0\"");

            if (doc.DisplayUnitSystem == DisplayUnit.IMPERIAL)
            {
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1/2\"", out StoreExp.vrOpt1);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1\"", out StoreExp.vrOpt2);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "3\"", out StoreExp.vrOpt3);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1'0\"", out StoreExp.vrOpt4);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "3'0\"", out StoreExp.vrOpt5);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "10'0\"", out StoreExp.vrOpt6);
            }
            else
            {
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "1 cm", out StoreExp.vrOpt1);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "2 cm", out StoreExp.vrOpt2);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "10 cm", out StoreExp.vrOpt3);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "30 cm", out StoreExp.vrOpt4);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "90 cm", out StoreExp.vrOpt5);
                UnitFormatUtils.TryParse(doc.GetUnits(), UnitType.UT_Length, "300 cm", out StoreExp.vrOpt6);
                Range1.Text = "1 cm"; Range2.Text = "2 cm"; Range3.Text = "10 cm";
                Range4.Text = "30 cm"; Range5.Text = "90 cm"; Range6.Text = "300 cm";
            }
            UiCtrApp.ViewActivated -= getdoc;
            foreach (RibbonItem item in panel_ViewSetup.GetItems())
            {
                if (item.Name == "ShiftRange")
                {
                    ComboBox ShiftRange_CB = (ComboBox)item;
                    ShiftRange_CB.AddItem(Range1); ShiftRange_CB.AddItem(Range2);
                    ShiftRange_CB.AddItem(Range3); ShiftRange_CB.AddItem(Range4);
                    ShiftRange_CB.AddItem(Range5); ShiftRange_CB.AddItem(Range6);
                }
            }
            doc = null;
        }
Example #27
0
        // 刷新时事件
        private void OnRefreshGridsAndViewInfo(object sender, ViewActivatedEventArgs ViewActivated)
        {
            UIApplication uiapplication = sender as UIApplication;

            if (uiapplication == null)
            {
                return;
            }
            ShowGridApplication.m_gridNumberShowForm.UnLoad();
            this.m_uiDoc = uiapplication.ActiveUIDocument;
            if (!this.DrawGridNumber)
            {
                ShowGridApplication.m_gridNumberShowForm.Hide();
            }
            else if (!ShowGridApplication.m_gridNumberShowForm.Visible)
            {
                ShowGridApplication.m_gridNumberShowForm.Show(this.m_hWndRevit);
            }
            ShowGridApplication.m_gridNumberShowForm.RefreshDocAndView(this.m_uiDoc);
        }
Example #28
0
    void onViewActivated(object sender, ViewActivatedEventArgs e)
    {
        View     vCurrent = e.CurrentActiveView;
        Document doc      = e.Document;
        string   pathname = doc.PathName;

        TaskDialog.Show("asd", pathname);
        string id       = Convert.ToString(vCurrent.Id);
        string name     = vCurrent.Name;
        string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
        string now      = Convert.ToString(DateTime.Now);
        string content  = now + ", " + id + ", " + name + ", " + userName + "\n";

        string path = @"E:\H1503200 Montreign Resort Casino\3-CD\views.txt";

        using (System.IO.StreamWriter sw = System.IO.File.AppendText(path))
        {
            sw.WriteLine(content);
        }
    }
Example #29
0
        private void ViewActivated(object sender, ViewActivatedEventArgs args)
        {
            View vPrev = args.PreviousActiveView;
            View vCurr = args.CurrentActiveView;

//			if (AUTO_UPDATE_ON_ACTIVATE_DOCUMENT &&
//				!vPrev.Document.Title.ToLower().Equals(vCurr.Document.Title.ToLower()))
//			{
//				OrganizeRevitWindows.winMgr.UpdateWindowLayout();
//			}

            if (WindowManager._autoUpdateOnActivateWindow &&
                !vPrev.Title.ToLower().Equals(vCurr.Title.ToLower()))
            {
                OrganizeRevitWindows.winMgr.UpdateWindowLayout();
            }

            //			else if (AUTO_UPDATE_ON_OPEN_VIEW)
            //			{
            //				_formProjSel.UpdateWindowLayoutDelay();
            //			}
        }
Example #30
0
        /// <summary>
        /// On Document Switched
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnViewActivated(object sender, ViewActivatedEventArgs e)
        {
            if (!Started)
            {
                return;            // only do if the plugin is active
            }
            if (_presenter == null)
            {
                ShowForm();
                return;
            }

            Document doc = e.CurrentActiveView.Document;

            // If the document is a Family Document, disable the UI
            if (!doc.IsFamilyDocument)
            {
                if (!_disabled)
                {
                    _presenter.Disable();
                    _disabled = true;
                }
                return;
            }
            else
            {
                if (_disabled)
                {
                    _presenter.Enable();
                    _disabled = false;
                }
            }
            if (_document.Title != doc.Title)
            {
                _document            = doc;
                _presenter._Document = doc;
                _presenter.DocumentSwitched();
            }
        }
Example #31
0
 private void OnViewActivated(object sender, ViewActivatedEventArgs e)
 {
     try
     {
         //重新打开视图则隐藏Panel
         DockablePane panel = m_uiApp.GetDockablePane(new DockablePaneId(ElementInfoPanel.GetInstance().Id));
         if (panel != null)
         {
             ElementInfoPanel.GetInstance().Update(new InfoEntityData());
             panel.Hide();
         }
         DockablePane imageControl = m_uiApp.GetDockablePane(new DockablePaneId(ImageControl.Instance().Id));
         if (imageControl != null)
         {
             imageControl.Hide();
         }
     }
     catch (System.Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
Example #32
0
        /// <summary>
        /// Handler for Revit's ViewActivated event.
        /// This handler is called when a view is activated. It is called
        /// after the ViewActivating event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Revit_ViewActivated(object sender, ViewActivatedEventArgs e)
        {
            // If there is no active document, then set it to whatever
            // document has just been activated
            if (DocumentManager.Instance.CurrentUIDocument == null)
            {
                DocumentManager.Instance.CurrentUIDocument =
                DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument;

                DynamoViewModel.RunEnabled = true;
            }
        }
Example #33
0
 private void UpdateActiveView(ViewActivatedEventArgs e)
 {
     if (e.Status == EventStatus.Succeeded)
         activeView = e.CurrentActiveView;
 }
        private void Revit_ViewActivated(object sender, ViewActivatedEventArgs e)
        {
            //if Dynamo doesn't have a view, then latch onto this one
            if (DocumentManager.Instance.CurrentUIDocument != null)
            {
                //DocumentManager.Instance.CurrentUIDocument =
                //    DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument;
                DynamoLogger.Instance.LogWarning(
                    string.Format(
                        "Dynamo is now pointing at document: {0}",
                        DocumentManager.Instance.CurrentUIDocument.Document.PathName),
                    WarningLevel.Moderate);

                ResetForNewDocument();
            }
        }
Example #35
0
        /// <summary>
        /// Handler for Revit's ViewActivated event.
        /// This handler is called when a view is activated. It is called
        /// after the ViewActivating event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Revit_ViewActivated(object sender, ViewActivatedEventArgs e)
        {
            // If there is no active document, then set it to whatever
            // document has just been activated
            if (DocumentManager.Instance.CurrentUIDocument == null)
            {
                DocumentManager.Instance.CurrentUIDocument =
                DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument;

                DynamoViewModel.RunEnabled = true;

                //In the case that the current document is null, we also need to do
                //a reset for the current document.
                ResetForNewDocument();
            }
        }
Example #36
0
 /// <summary>
 /// Handler for Revit's ViewActivated event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void OnApplicationViewActivated(object sender, ViewActivatedEventArgs e)
 {
     if (revitDynamoModel != null)
     {
         revitDynamoModel.HandleRevitViewActivated();
     }
 }
Example #37
0
 private void CurrentUIApplication_ViewActivated(object sender, ViewActivatedEventArgs e)
 {
     CurrentUIApplicationOnViewActivated();
 }
 private void Revit_ViewActivated(object sender, ViewActivatedEventArgs e)
 {
     //if Dynamo doesn't have a view, then latch onto this one
     if (DocumentManager.Instance.CurrentUIDocument != null)
     {
         dynSettings.Controller.DynamoLogger.LogWarning(GetDocumentPointerMessage(), WarningLevel.Moderate);
         ResetForNewDocument();
     }
 }
Example #39
0
		private static void ActivateProjectFromFile(object sender, ViewActivatedEventArgs e) {
			if (!(bool)PropertyRegistry.Get("AutoActivateProject", true)) {
				return;
			}

			if (!ValidationHelpers.ValidateCurrentProjectGroupNotNull() || !ValidationHelpers.ValidateCurrentModuleNotNull()) {
				return;
			}
			
			string fileName = OtaUtils.GetCurrentEditorFileName();
			IOTAProject active = OtaUtils.GetCurrentProject();
			if (active.FileInProject(fileName)) {
				return;
			}

			IOTAModuleServices ms = OtaUtils.GetModuleServices();
			if (ms != null)
			{
				IOTAProject proj = ms.FindProjectFromFileNameEntry(fileName);
				if (proj != null)
				{
					proj.Activate();
				}
			} else {
				LoggingService.Warn("Current file not found in any project!");
			}
		}
Example #40
0
 /// <summary>
 /// React to Revit view activation.
 /// </summary>
 private void OnViewActivated(
     object sender,
     ViewActivatedEventArgs e)
 {
     _currentView = e.CurrentActiveView;
 }