示例#1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="_uiapp"></param>
        /// <param name="exEvent"></param>
        /// <param name="handler"></param>
        public Civil3DWindow(Document doc)
        {
            try
            {
                InitializeComponent();
                this.Title = AITPlugin.getAutoCADProductName() + " | Arup Issue Tracker by CASE";

                mainPan.jiraPan.AddIssueBtn.Click += new RoutedEventHandler(AddIssueJira);
                mainPan.bcfPan.AddIssueBtn.Click  += new RoutedEventHandler(AddIssueBCF);

                mainPan.bcfPan.open3dViewEvent  += new RoutedEventHandler(Open3dViewBCF);
                mainPan.jiraPan.open3dViewEvent += new RoutedEventHandler(Open3dViewJira);

                // for ICommentController callback
                commentController              = new CommentController(this);
                commentController.client       = AuthoringTool.Civil3D;
                mainPan.jiraPan.AddCommBtn.Tag = commentController;
                mainPan.bcfPan.AddCommBtn.Tag  = commentController;

                // for IComponentController
                componentController         = new ComponentController(this);
                mainPan.componentController = this.componentController;

                // for open 3d view and show components
                //mainPan.jiraPan.open3dView.Visibility = System.Windows.Visibility.Visible;
                //mainPan.jiraPan.showComponents.Visibility = System.Windows.Visibility.Visible;
                //mainPan.bcfPan.isShowBcfFirstViewpointButtons = true;

                this.doc = doc;
            }

            catch (System.Exception ex1)
            {
                MessageBox.Show("exception: " + ex1);
            }
        }
示例#2
0
        public void Run()
        {
            try
            {
#if C3D2014
                string versionNumber = "19.1";
                Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("FILEDIA", 0);
#elif C3D2015
                string versionNumber = "20.0";
#elif C3D2016
                string versionNumber = "20.1";
#elif C3D2017
                string versionNumber = "21.0";
#elif C3D2018
                string versionNumber = "22.0";
#endif

                // Version
                if (!Autodesk.AutoCAD.ApplicationServices.Application.Version.ToString().Contains(versionNumber))
                {
                    MessageBox.Show(string.Format("This Add-In was built for {0} {1}, please find the Arup Issue Tracker group in Yammer for assistance...", versionNumber, AITPlugin.getAutoCADProductName()), "Incompatible Version");
                    return;
                }

                // Form Running?
                if (_isRunning && window != null && window.IsLoaded)
                {
                    window.Focus();
                    return;
                }

                _isRunning = true;

                window = new Civil3DWindow(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument);
                window.Show();

                // register a document closed event
                Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.BeginDocumentClose += MdiActiveDocument_BeginDocumentClose;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("exception: " + ex);
            }
        }