예제 #1
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";
#elif C3D2019
                string versionNumber = "23.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);
            }
        }
예제 #2
0
 public CommentController(Civil3DWindow window)
 {
     this.window = window;
 }