프로젝트

일반

사용자정보

개정판 0e0edfad

ID0e0edfaddf102f03dca7b718dc2101422eddec7e
상위 b265df51
하위 d50c8f65, 74752074

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : 도면 생성 메서드 / 도면 크기 구하는 메서드 분리

Change-Id: I8f60ce40de547e1f1f4ea7de944b653706fa585a

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
89 89
                _placement = new Placement();
90 90
                dataSource = _placement.PIDDataSource;
91 91

  
92
                newDrawing = application.Drawings.Add(document.Unit, document.Template, document.DrawingNumber, document.DrawingName);
93
                application.ActiveWindow.Fit();
94
                Thread.Sleep(500);
95
                application.ActiveWindow.Zoom = 2000;
96
                Thread.Sleep(1000);
92
                CreateDocument();
97 93

  
98
                double maxX = 0;
99
                double maxY = 0;
100
                foreach (object drawingObj in radApp.ActiveDocument.ActiveSheet.DrawingObjects)
101
                {
102
                    Ingr.RAD2D.SmartFrame2d smartFrame2d = drawingObj as Ingr.RAD2D.SmartFrame2d;
103
                    if (smartFrame2d != null)
104
                    {
105
                        double x1 = 0;
106
                        double x2 = 0;
107
                        double y1 = 0;
108
                        double y2 = 0;
109
                        smartFrame2d.Range(out x1, out y1, out x2, out y2);
110
                        maxX = Math.Max(x2, maxX);
111
                        maxY = Math.Max(y2, maxY);
112
                    }
113
                }
114
                if (maxX != 0 && maxY != 0)
94
                if (DocumentCoordinateCorrection())
115 95
                {
116
                    document.SetSPPIDLocation(maxX, maxY);
117 96
                    int AllCount = ClacProgressCount();
118 97

  
119 98
                    SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true);
99
                    Thread.Sleep(1000);
120 100
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetParent, (IntPtr)radApp.HWnd);
101
                    Thread.Sleep(1000);
121 102
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStep, AllCount);
122 103
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText);
123 104

  
......
233 214
                                            if (mapping != null)
234 215
                                            {
235 216
                                                LMAAttribute _LMAAttribute = _Attributes[mapping.SPPIDATTRIBUTENAME];
236
                                                if (mapping.SPPIDATTRIBUTENAME.Contains("Description"))
217
                                                if (mapping.DisplayAttribute.ToLower().Contains("desc"))
237 218
                                                {
238 219
                                                    if (!DBNull.Value.Equals(_LMAAttribute.get_Value()) && !string.IsNullOrEmpty(_LMAAttribute.get_Value()))
239 220
                                                    {
......
331 312
            }
332 313
        }
333 314

  
315
        private void CreateDocument()
316
        {
317
            newDrawing = application.Drawings.Add(document.Unit, document.Template, document.DrawingNumber, document.DrawingName);
318
            application.ActiveWindow.Fit();
319
            Thread.Sleep(1000);
320
            application.ActiveWindow.Zoom = 2000;
321
            Thread.Sleep(2000);
322
        }
323

  
324
        private bool DocumentCoordinateCorrection()
325
        {
326
            double maxX = 0;
327
            double maxY = 0;
328
            foreach (object drawingObj in radApp.ActiveDocument.ActiveSheet.DrawingObjects)
329
            {
330
                Ingr.RAD2D.SmartFrame2d smartFrame2d = drawingObj as Ingr.RAD2D.SmartFrame2d;
331
                if (smartFrame2d != null)
332
                {
333
                    double x1 = 0;
334
                    double x2 = 0;
335
                    double y1 = 0;
336
                    double y2 = 0;
337
                    smartFrame2d.Range(out x1, out y1, out x2, out y2);
338
                    maxX = Math.Max(x2, maxX);
339
                    maxY = Math.Max(y2, maxY);
340
                }
341
            }
342
            if (maxX != 0 && maxY != 0)
343
            {
344
                document.SetSPPIDLocation(maxX, maxY);
345
                return true;
346
            }
347
            else
348
                return false;
349
        }
350

  
334 351
        private void LineModelingByRun(LineRun run)
335 352
        {
336 353
            Line prevLine = null;
......
1661 1678
                            if (_Attribute != null)
1662 1679
                            {
1663 1680
                                // 임시
1664
                                if (item.ATTRIBUTETYPE == "String")
1681
                                if (mapping.DisplayAttribute.ToLower().Contains("desc"))
1665 1682
                                {
1666 1683
                                    if (!string.IsNullOrEmpty(item.VALUE))
1667 1684
                                    {
DTI_PID/SPPIDConverter/SPPIDConverter.csproj
4 4
  <PropertyGroup>
5 5
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 6
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
    <ProjectGuid>{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}</ProjectGuid>
7
    <ProjectGuid>{81BFB56B-05FE-4674-93C5-DDB2D3437F77}</ProjectGuid>
8 8
    <OutputType>Library</OutputType>
9 9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10 10
    <RootNamespace>Converter.SPPID</RootNamespace>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)