Exemple #1
0
        static void ActiveUIApplication_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            var directShapeCategories = Enum.GetValues(typeof(BuiltInCategory)).Cast <BuiltInCategory>().
                                        Where(categoryId => DirectShape.IsValidCategoryId(new ElementId(categoryId), e.CurrentActiveView.Document)).
                                        Select(categoryId => Autodesk.Revit.DB.Category.GetCategory(e.CurrentActiveView.Document, categoryId));

            foreach (var group in directShapeCategories.GroupBy(x => x.CategoryType).OrderBy(x => x.Key.ToString()))
            {
                foreach (var category in group.OrderBy(x => x.Name))
                {
                    var comboBoxMemberData = new ComboBoxMemberData(((BuiltInCategory)category.Id.IntegerValue).ToString(), category.Name)
                    {
                        GroupName = group.Key.ToString()
                    };
                    var item = categoriesComboBox.AddItem(comboBoxMemberData);

                    if ((BuiltInCategory)category.Id.IntegerValue == BuiltInCategory.OST_GenericModel)
                    {
                        categoriesComboBox.Current = item;
                    }
                }
            }

            Revit.ApplicationUI.ViewActivated -= ActiveUIApplication_ViewActivated;
        }
        void Revit_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            //if Dynamo doesn't have a view, then latch onto this one
            if (dynRevitSettings.Doc == null)
            {
                dynRevitSettings.Doc = dynRevitSettings.Revit.ActiveUIDocument;
                DynamoLogger.Instance.LogWarning(string.Format("Dynamo is now pointing at document: {0}", dynRevitSettings.Doc.Document.PathName), WarningLevel.Moderate);

                ResetForNewDocument();
            }
        }
Exemple #3
0
        //checks whether to refresh the stream list in case the user changes active view and selects a different document
        private void RevitApp_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            if (e.Document == null || e.Document.IsFamilyDocument || e.PreviousActiveView == null || GetDocHash(e.Document) == GetDocHash(e.PreviousActiveView.Document))
            {
                return;
            }

            var streams = GetStreamsInFile();

            UpdateSavedStreams(streams);
        }
Exemple #4
0
        private void uiapp_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            if (doc.ActiveView.GetType().Name == "ViewSheet")
            {
                Autodesk.Revit.DB.ViewSheet curViewSheet = doc.ActiveView as Autodesk.Revit.DB.ViewSheet;

                if (curViewSheet != null)
                {
                    //updatePositionsInit(curViewSheet);
                }
            }
        }
Exemple #5
0
        public void MyEventMgr_UiApp_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            File.AppendAllText(
                Path.Combine(desktopPath, "hooks.log"),
                string.Format("00000000000000000 [view-activated-csharp] doc:\"{0}\" active_view:\"{1}\" prev_view:\"{2}\" status:\"{3}\"\n",
                              e.Document != null ? e.Document.ToString() : "",
                              e.CurrentActiveView != null ? e.CurrentActiveView.ToString() : "",
                              e.PreviousActiveView != null ? e.PreviousActiveView.ToString() : "",
                              e.Status.ToString()
                              )
                );
        }
        //checks whether to refresh the stream list in case the user changes active view and selects a different document
        private void RevitApp_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            if (e.Document == null || e.Document.IsFamilyDocument || e.PreviousActiveView == null || GetDocHash(e.Document) == GetDocHash(e.PreviousActiveView.Document))
            {
                return;
            }

            var appEvent = new ApplicationEvent()
            {
                Type        = ApplicationEvent.EventType.ViewActivated,
                DynamicInfo = GetStreamsInFile()
            };

            NotifyUi(appEvent);
        }
Exemple #7
0
 private void Uiapp_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
 {
     try
     {
         if ((!(doc.ActiveView.Id == viewSec.Id)) && SectionConfigForm.checkState)
         {
             using (Transaction t = new Transaction(doc, "Deletion"))
             {
                 t.Start();
                 doc.Delete(viewSec.Id);
                 t.Commit();
             }
         }
     }
     catch (Exception ex)
     {
         //TaskDialog.Show("Wd", ex.Message);
     }
 }
Exemple #8
0
        private void Application_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            var app = (Autodesk.Revit.UI.UIApplication)sender;

            $safeprojectname$UserControl.Instance.TextBlockProjectTitle.Text = app.ActiveUIDocument.Document.Title;
        }
        private void OnViewChanged(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            var doc = e.Document;

            this.UpdateContext(doc);
        }
Exemple #10
0
 private void Application_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
 {
     Btn_Export.Enabled = e.CurrentActiveView is View3D;
 }
        /***************************************************/

        private void Application_ViewActivated(object sender, Autodesk.Revit.UI.Events.ViewActivatedEventArgs e)
        {
            RevitAdapter.InternalAdapter = GetAdapter(e.Document);
        }