当前位置: 首页>>代码示例>>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;未经允许,请勿转载。