示例#1
0
        /// <summary>
        /// When user clicks ok button, create .
        /// </summary>
        /// <param name="sender">Auto generated sender object by Visual Studio.</param>
        /// <param name="e">Auto generated EventArgs by Visual Studio.</param>
        private void okButton_Click(object sender, EventArgs e)
        {
            this.Close();

            // Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;

            foreach (KeyValuePair <string, Layer> currLayer in this.layerList)
            {
                ////                 layer command, Make,     Layer Name          ,Color,TrueColor, Red value of current layer, Green value of curr layer    , Blue value of curr layer, Enter, LineType, Line Type of curr layer, Enter, Enter
                //ed.Command(new Object[] { "-LAYER", "M", currLayer.Value.GetName(), "C", "T", currLayer.Value.GetRed() + "," + currLayer.Value.GetGreen() + "," + currLayer.Value.GetBlue(), "", "L", currLayer.Value.GetLine(), "", "" });

                doc.SendStringToExecute("-LAYER M " + currLayer.Value.GetName() + "\n", true, false, false);
                doc.SendStringToExecute("C T " + currLayer.Value.GetRed() + "," + currLayer.Value.GetGreen() + "," + currLayer.Value.GetBlue() + "\n\n", true, false, false);
                doc.SendStringToExecute("L " + currLayer.Value.GetLine() + "\n\n\n", true, false, false);
            }
        }
        public static void ShowFrameMenu()
        {
            AdeskAppSvr.Document doc = AdeskAppSvr.Application.DocumentManager.MdiActiveDocument;
            doc.SendStringToExecute("UCS W ", false, false, true);//make current coordinate system to be WCS
            AdeskAppSvr.DocumentLock docLock = doc.LockDocument();
            DigitalSign mDigital             = new DigitalSign();

            AdeskAppSvr.Application.ShowModalDialog(mDigital);
            docLock.Dispose();
        }
        /// <summary>
        /// show form
        /// </summary>
        /// <param name="Sender"></param>
        /// <param name="e"></param>
        public static void ShowFrame(Object Sender, EventArgs e)
        {
            AdeskAppSvr.Document doc = AdeskAppSvr.Application.DocumentManager.MdiActiveDocument;
            doc.SendStringToExecute("UCS W ", false, false, true);//make current coordinate system to be WCS
            AdeskAppSvr.DocumentLock docLock = doc.LockDocument();
            NewForm mDigital = new NewForm();

            AdeskAppSvr.Application.ShowModalDialog(mDigital);
            docLock.Dispose();
        }
示例#4
0
        private void LoadCusCUI(string path)
        {
            Autodesk.AutoCAD.ApplicationServices.Document doc = Application.DocumentManager.MdiActiveDocument;

            object oldCmdEcho = Application.GetSystemVariable("CMDECHO");
            object oldFileDia = Application.GetSystemVariable("FILEDIA");

            Application.SetSystemVariable("CMDECHO", 1);
            Application.SetSystemVariable("FILEDIA", 0);
            string LoadCUICommand = "cuiload " + path + " filedia 1";

            doc.SendStringToExecute(LoadCUICommand, true, false, true);
        }