Ejemplo n.º 1
0
        void App_Startup(object sender, StartupEventArgs e)
        {
            DataPipeClient dataPipeClient;

            if (e.Args.Length == 4)
            {
                dataPipeClient = new DataPipeClient(e.Args[0], e.Args[1]);
                AutocadDataService.DataPipeClient = dataPipeClient;
                uibindings = new SpeckleUIBindingsAutoCAD(dataPipeClient);

                waitHandles = new WaitHandle[2];
                waitHandles[SHOW_UI_SIGNAL] = EventWaitHandle.OpenExisting(e.Args[2]);
                waitHandles[AUTOCAD_SELECTION_CHANGED_SIGNAL] = EventWaitHandle.OpenExisting(e.Args[3]);
                eventProcessorThread = new Thread(ProcessEvent);
                eventProcessorThread.IsBackground = true;
                eventProcessorThread.Start();
            }
            else
            {
                uibindings = new SpeckleUIBindingsAutoCAD(null);
            }


            //Create main application window
            var path      = Directory.GetParent(Assembly.GetExecutingAssembly().Location);
            var indexPath = string.Format(@"{0}\app\index.html", path);

            indexPath     = indexPath.Replace("\\", "/");
            SpeckleWindow = new SpeckleUiWindow(uibindings, indexPath);
            SpeckleWindow.Show();
        }
Ejemplo n.º 2
0
        public void Speckle()
        {
            // Gets the current document, and prints some basic information about it
            // to the command editor window.



            CivilDocument doc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument;

            var bindings = new SpeckleUIBindingsAutoCAD(doc);

            ObjectIdCollection alignments = doc.GetAlignmentIds();
            ObjectIdCollection sites      = doc.GetSiteIds();
            String             docInfo    = String.Format("\nHello Speckle!");

            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(docInfo);

            SpeckleWindow = new SpeckleUiWindow(bindings);

            var helper = new System.Windows.Interop.WindowInteropHelper(SpeckleWindow);

            helper.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;

            SpeckleWindow.Show();
            Launched = true;
        }