Esempio n. 1
0
 internal void BeamsFromColumns_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
 {
     if (beamsFromColumnsWindow != null || beamsFromColumnsWindow.isShowned)
     {
         beamsFromColumnsWindow.ReloadBeamFamilies(uiApp);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Handler for the ViewActivated event.
        /// Used to query whether Dynamo can be run on the active view.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Application_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            if (dynSettings.Controller != null)
            {
                if (e.CurrentActiveView is View3D)
                {
                    var view         = e.CurrentActiveView as View3D;
                    var previousView = e.PreviousActiveView as View3D;

                    if (view.IsPerspective)
                    {
                        //warn user that Dynamo can't be run in perspective
                        //and disable the run
                        DynamoLogger.Instance.LogWarning(
                            "Dynamo is not available in a perspective view. Please switch to another view to Run.", WarningLevel.Moderate);
                        dynSettings.Controller.DynamoViewModel.RunEnabled = false;
                    }
                    else if (!view.IsPerspective && (previousView == null || previousView.IsPerspective))
                    {
                        DynamoLogger.Instance.ResetWarning();
                        dynSettings.Controller.DynamoViewModel.RunEnabled = true;
                    }
                }
                else
                {
                    DynamoLogger.Instance.LogWarning(string.Format("Active view is now {0}", e.CurrentActiveView.Name), WarningLevel.Mild);
                    dynSettings.Controller.DynamoViewModel.RunEnabled = true;
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Show dockable panes when view active.
        /// </summary>
        void application_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            if (!DockablePane.PaneExists(DefaultFamilyTypes.PaneId) ||
                !DockablePane.PaneExists(DefaultElementTypes.PaneId))
            {
                return;
            }

            UIApplication uiApp = sender as UIApplication;

            if (uiApp == null)
            {
                return;
            }

            if (DefaultFamilyTypesPane != null)
            {
                DefaultFamilyTypesPane.SetDocument(e.Document);
            }
            if (DefaultElementTypesPane != null)
            {
                DefaultElementTypesPane.SetDocument(e.Document);
            }
        }
Esempio n. 4
0
 public void UIApplication_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
 {
     ExecuteEventHooks(EventType.UIApplication_ViewActivated, sender, e);
 }