Beispiel #1
0
        private void Application_DocumentOpened(object sender, DocumentOpenedEventArgs args)
        {
            if (args.Document == null ||
                (Path.GetTempPath().StartsWith(Path.GetDirectoryName(args.Document.PathName)) &&
                 args.Document.PathName.EndsWith(".ifc.RVT")))
            {
                return;
            }

            try
            {
                openedDocuments.Add(args.Document, new BimbotDocument(args.Document));
                BimbotDocument curDoc = openedDocuments[args.Document];

                DockableResultPanel.DataContext   = curDoc;
                DockableServicesPanel.DataContext = curDoc;
                ExtEvents.ChangeDocumentHandler.documentToUpdate = curDoc;

                //            ActiveDocument = curApp.openedDocuments[args.Document];
                outputPane  = uiApplication.GetDockablePane(OutputPaneId);
                servicePane = uiApplication.GetDockablePane(ServicePaneId);
                ViewToggleButtonResults.IsChecked  = true;
                ViewToggleButtonResults.IsEnabled  = true;
                ViewToggleButtonServices.IsChecked = true;
                ViewToggleButtonServices.IsEnabled = true;
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to open bimbot part in document due to:\n" + e.Message);
            }
        }
Beispiel #2
0
        public void ShowPanel(UIControlledApplication uiControlledApp)
        {
            _uiControlledApp = uiControlledApp;

            Autodesk.Revit.UI.DockablePane dp = uiControlledApp.GetDockablePane(DockablePaneId_FaceWall);
            dp.Show();
        }
Beispiel #3
0
        public Autodesk.Revit.UI.DockablePane GetPanel(UIControlledApplication uiControlledApp)
        {
            _uiControlledApp = uiControlledApp;

            Autodesk.Revit.UI.DockablePane dp = uiControlledApp.GetDockablePane(DockablePaneId_FaceWall);
            return(dp);
        }
Beispiel #4
0
 /// <summary>
 /// Close the Dockable Pane
 /// </summary>
 internal void HideDockablePane()
 {
     try
     {
         DockablePane m_dp = uiApp.GetDockablePane(GlobalHelper.MainDockablePaneId);
         m_dp.Hide();
     }
     catch { }
 }
Beispiel #5
0
 /// <summary>
 /// Close the Dockable Pane
 /// </summary>
 internal void HideDockablePane()
 {
     try
     {
         var m_dp = uiApp.GetDockablePane(GlobalHelper.MainDockablePaneId);
         m_dp.Hide();
     }
     catch
     {
         // ignored
     }
 }
Beispiel #6
0
    public static bool PaneExists(this UIControlledApplication application, Guid id, out DockablePane pane)
    {
        var dPid = new DockablePaneId(id);

        if (DockablePane.PaneExists(dPid))
        {
            pane = application.GetDockablePane(dPid);
            return(true);
        }
        pane = null;
        return(false);
    }
Beispiel #7
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);
     }
 }
Beispiel #8
0
 public void HidePanel(UIControlledApplication uiApp)
 {
     Autodesk.Revit.UI.DockablePane dp = uiApp.GetDockablePane(DockablePaneId_FaceWall);
     dp.Hide();
 }