當前位置: 首頁>>代碼示例>>C#>>正文


C# Model.GetProjectInfo方法代碼示例

本文整理匯總了C#中System.ComponentModel.Model.GetProjectInfo方法的典型用法代碼示例。如果您正苦於以下問題:C# Model.GetProjectInfo方法的具體用法?C# Model.GetProjectInfo怎麽用?C# Model.GetProjectInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.ComponentModel.Model的用法示例。


在下文中一共展示了Model.GetProjectInfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PrintToFile

        private bool PrintToFile(Drawing currentDrawing)
        {
            bool Result = false;
            double scale = 1.0;

            if (rbtnSCALE.Checked)
            {
                //get scale of the first view
                //scale = GetScaleFromTheView();
            }

            DrawingHandler MyDrawingHandler = new DrawingHandler();
            PrintAttributes printAttributes = new PrintAttributes();
            printAttributes.Scale = scale;
            printAttributes.PrintToMultipleSheet = false;
            printAttributes.NumberOfCopies = 1;
            printAttributes.Orientation = DotPrintOrientationType.Auto;
            printAttributes.PrintArea = DotPrintAreaType.EntireDrawing;
            printAttributes.PrinterInstance = "DWG";

            string DrawingType = GetDrawingTypeCharacter(currentDrawing);

            /*
            set XS_DRAWING_PLOT_FILE_DIRECTORY=.\PlotFiles
            set XS_DRAWING_PLOT_FILE_NAME_A=%%UDA:PROJECT_USERFIELD_1%%-%%NAME.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
            set XS_DRAWING_PLOT_FILE_NAME_W=%%UDA:PROJECT_USERFIELD_1%%-%%NAME.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
            set XS_DRAWING_PLOT_FILE_NAME_C=%%UDA:PROJECT_USERFIELD_1%%-%%NAME.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
            set XS_DRAWING_PLOT_FILE_NAME_G=%%UDA:PROJECT_USERFIELD_1%%-%%TITLE.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
            set XS_DRAWING_PLOT_FILE_NAME_M=%%UDA:PROJECT_USERFIELD_1%%-%%TITLE.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
             */

            //string output_path = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_DIRECTORY");
            string output_path = "c:\\pdf";
            string output_file = "out.dwg";

            Model CurrentModel = new Model();
            ProjectInfo ProjectInfo = CurrentModel.GetProjectInfo();
            if (CurrentModel.GetConnectionStatus())
            {
                output_file = ProjectInfo.ProjectNumber;
            }

            string DrawingName = "";

            //TSM.Operations.Operation.DisplayPrompt("DrawingType" + DrawingType);

            switch (DrawingType)
            {
                case "A":
                //output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_A");
                case "W":
                //output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_W");
                case "C":
                    //output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_C");
                    DrawingName = currentDrawing.Mark;
                    DrawingName = RemoveBrackets(DrawingName);
                    break;
                case "G":
                //output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_G");
                case "M":
                    //output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_M");
                    DrawingName = currentDrawing.Name;
                    break;
                default:
                    goto case "A";
            }

            DrawingName = DrawingName.Replace('.', '-');
            output_file += "-" + DrawingName + ".dwg";

            if (!String.IsNullOrEmpty(output_path) && !String.IsNullOrEmpty(output_file))
                Result = MyDrawingHandler.PrintDrawing(currentDrawing, printAttributes, output_path + "\\" + output_file);

            return Result;
        }
開發者ID:jorhop,項目名稱:TS_app_QuickPrintDrawings,代碼行數:75,代碼來源:Form1.cs


注:本文中的System.ComponentModel.Model.GetProjectInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。