프로젝트

일반

사용자정보

개정판 4d4dce52

ID4d4dce5214a2072da2dd5b97925083e999aff50a
상위 6f404d45
하위 9d6edced

함의성이(가) 약 3년 전에 추가함

revert

Change-Id: I82422eba1357822cff080d21514121e2a36208ed

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
4 4
using System.Text;
5 5
using System.Threading.Tasks;
6 6
using System.Data;
7
using Llama;
8
using Plaice;
7 9
using Ingr.RAD2D.Interop.RAD2D;
8 10
using Ingr.RAD2D.Internal;
9 11
using Ingr.RAD2D.Helper;
......
20 22
using Microsoft.VisualBasic;
21 23
using Newtonsoft.Json;
22 24
using DevExpress.XtraSplashScreen;
23
using Ingr.SPPID.Llama;
24
using Ingr.SPPID.Plaice;
25

  
26 25
namespace Converter.SPPID
27 26
{
28 27
    [Flags]
......
39 38
        Placement _placement;
40 39
        LMADataSource dataSource;
41 40
        string drawingID;
42
        Ingr.SPPID.PIDAuto.Drawing newDrawing;
41
        dynamic newDrawing;
43 42
        dynamic application;
44 43
        bool closeDocument;
45 44
        Ingr.RAD2D.Application radApp;
46
        Ingr.SPPID.PIDAuto.Application pidApp;
47 45
        SPPID_Document document;
48 46
        ETCSetting _ETCSetting;
49 47
        DataTable nominalDiameterTable = null;
......
59 57
        public AutoModeling(SPPID_Document document, bool closeDocument)
60 58
        {
61 59
            application = Interaction.GetObject("", "PIDAutomation.Application");
62
            WrapperApplication wApp = new WrapperApplication(application);
63
            radApp = wApp.Application.RADApplication;
64

  
65
            pidApp = new Ingr.SPPID.PIDAuto.Application();
60
            WrapperApplication wApp = new WrapperApplication(application.Application);
61
            radApp = wApp.RADApplication;
66 62

  
67 63
            this.closeDocument = closeDocument;
68 64
            this.document = document;
......
97 93
                nominalDiameterTable = Project_DB.SelectProjectNominalDiameter();
98 94
                _placement = new Placement();
99 95
                dataSource = _placement.PIDDataSource;
100

  
96
                
101 97
                if (CreateDocument(ref drawingNumber, ref drawingName) && DocumentCoordinateCorrection())
102 98
                {
103 99
                    Log.Write("Start Modeling");
......
107 103
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText);
108 104

  
109 105
                    // VendorPackage Modeling
106
                    // ID2에서 VendorPackage로 된 Symbol을 SPPID에서 그림
110 107
                    RunVendorPackageModeling();
111 108
                    // Equipment Modeling
109
                    // Id2에서 인식한 Equipment일 경우 SPPID에 Draft
112 110
                    RunEquipmentModeling();
113 111
                    // Symbol Modeling
112
                    // ID2의 Symbol Draft
113
                    // 단 Symbol draft할 때 붙어 있는 symbol도 draft함
114 114
                    RunSymbolModeling();
115 115
                    // LineRun Line Modeling
116
                    // Line 그리는 우선 순위 
117
                    // 1. Branch 없는 것
118
                    // 2. Symbol 연결 개수
119
                    // 3. Symbol 제외 Item 연결 개수
120
                    // 4. ConnectedItem이 없는것
116 121
                    RunLineModeling();
117 122
                    // Vent Drain Modeling
123
                    // Vent/Drain으로 인식한 Item draft
124
                    // 인식 조건
125
                    // 1. ID2에서 Line이 하나며 Branch된 Line이 있고
126
                    // 2. Valve가 line에 붙어있다.
118 127
                    RunVentDrainModeling();
119 128
                    // Clear Attribute
129
                    // SPPID에서 Line 생성 시 자동으로 Nominal Diameter가 입력되는 경우가 있음
130
                    // 모든 Item의 Nominal Diameter 속성값 초기화
120 131
                    RunClearNominalDiameter();
121 132
                    // Join SameConnector
133
                    // 기존 Line을 그릴때 SPPID에서는 같은 Run으로 생성되지 않고 각각 PipeRun이 생성됨
134
                    // ID2의 EndBreak등 segmentbreak가 없으면 Line을 합침
122 135
                    RunJoinRunForSameConnector();
123 136
                    // Join Run
137
                    // 같은 Type의 Line일 경우 Join함
124 138
                    RunJoinRun();
139

  
125 140
                    // EndBreak Modeling
126 141
                    RunEndBreakModeling();
127 142
                    // SpecBreak Modeling
128 143
                    RunSpecBreakModeling();
129 144
                    //Line Number Modeling
145
                    // Label만 draft
130 146
                    RunLineNumberModeling();
131 147
                    // Note Modeling
132 148
                    RunNoteModeling();
......
142 158
                    RunInputEndBreakAttribute();
143 159
                    // Label Symbol Modeling
144 160
                    RunLabelSymbolModeling();
161

  
145 162
                    // Correct Text
163
                    // LabelPersist 정렬 로직
164
                    // 예) Valve Size label 등
146 165
                    RunCorrectAssociationText();
147 166
                    // ETC
167
                    // Label을 Front로 옮김
148 168
                    RunETC();
149
                    // BulkAttribute
169
                    // input bulk attribute
150 170
                    RunBulkAttribute();
151
                    // Result Logging
171
                    // log file 생성
152 172
                    document.CheckModelingResult();
153 173
                }
154 174
            }
......
176 196
                Thread.Sleep(1000);
177 197

  
178 198
                Log.Write("End Modeling");
179
                
180
                // TODO : ZOOM FIT
181
                //radApp.ActiveDocument.ActiveSheet.Fit();
199
                radApp.ActiveWindow.Fit();
182 200

  
183 201
                ReleaseCOMObjects(application);
184 202
                application = null;
......
188 206
                    {
189 207
                        newDrawing.Save();
190 208
                        newDrawing.CloseDrawing(true);
209
                        ReleaseCOMObjects(newDrawing); 
191 210
                        newDrawing = null;
192 211
                    }
193 212
                    else if (newDrawing == null)
......
503 522
                    {
504 523
                        LMAAttribute attribute = modelItem.Attributes["NominalDiameter"];
505 524
                        if (attribute != null)
506
                            attribute.Value = DBNull.Value;
525
                            attribute.set_Value(DBNull.Value);
507 526

  
508 527
                        modelItem.Commit();
509 528
                        ReleaseCOMObjects(modelItem);
......
526 545
                    {
527 546
                        LMAAttribute attribute = modelItem.Attributes["NominalDiameter"];
528 547
                        if (attribute != null)
529
                            attribute.Value = DBNull.Value;
548
                            attribute.set_Value(DBNull.Value);
530 549
                        int index = 1;
531 550
                        while (true)
532 551
                        {
533 552
                            attribute = modelItem.Attributes[string.Format("PipingPoint{0}.NominalDiameter", index)];
534 553
                            if (attribute != null)
535
                                attribute.Value = DBNull.Value;
554
                                attribute.set_Value(DBNull.Value);
536 555
                            else
537 556
                                break;
538 557
                            index++;
......
549 568
                    {
550 569
                        foreach (LMConnector connector in symbol.Connect1Connectors)
551 570
                        {
552
                            if (connector.ItemStatus.ToString() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
571
                            if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
553 572
                            {
554
                                endClearModelItemID.Add(connector.ModelItemID.ToString());
573
                                endClearModelItemID.Add(connector.ModelItemID);
555 574
                                LMModelItem modelItem = connector.ModelItemObject;
556 575
                                if (modelItem != null)
557 576
                                {
558 577
                                    LMAAttribute attribute = modelItem.Attributes["NominalDiameter"];
559 578
                                    if (attribute != null)
560
                                        attribute.Value = DBNull.Value;
579
                                        attribute.set_Value(DBNull.Value);
561 580

  
562 581
                                    modelItem.Commit();
563 582
                                    ReleaseCOMObjects(modelItem);
......
567 586
                        }
568 587
                        foreach (LMConnector connector in symbol.Connect2Connectors)
569 588
                        {
570
                            if (connector.ItemStatus.ToString() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
589
                            if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
571 590
                            {
572
                                endClearModelItemID.Add(connector.ModelItemID.ToString());
591
                                endClearModelItemID.Add(connector.ModelItemID);
573 592
                                LMModelItem modelItem = connector.ModelItemObject;
574 593
                                if (modelItem != null)
575 594
                                {
576 595
                                    LMAAttribute attribute = modelItem.Attributes["NominalDiameter"];
577 596
                                    if (attribute != null)
578
                                        attribute.Value = DBNull.Value;
597
                                        attribute.set_Value(DBNull.Value);
579 598

  
580 599
                                    modelItem.Commit();
581 600
                                    ReleaseCOMObjects(modelItem);
......
602 621
                filter.ItemType = "Relationship";
603 622
                criterion.SourceAttributeName = "SP_DRAWINGID";
604 623
                criterion.Operator = "=";
605
                criterion.ValueAttribute = drawingID;
606
                filter.Criteria.Add(criterion);
624
                criterion.set_ValueAttribute(drawingID);
625
                filter.get_Criteria().Add(criterion);
607 626

  
608 627
                LMRelationships relationships = new LMRelationships();
609 628
                relationships.Collect(dataSource, Filter: filter);
......
616 635
                {
617 636
                    foreach (LMInconsistency inconsistency in relationship.Inconsistencies)
618 637
                    {
619
                        if (inconsistency.InconsistencyTypeIndex == 1)
638
                        if (inconsistency.get_InconsistencyTypeIndex() == 1)
620 639
                        {
621 640
                            LMModelItem modelItem1 = relationship.Item1RepresentationObject == null ? null : relationship.Item1RepresentationObject.ModelItemObject;
622 641
                            LMModelItem modelItem2 = relationship.Item2RepresentationObject == null ? null : relationship.Item2RepresentationObject.ModelItemObject;
623
                            string[] array = inconsistency.Name.ToString().Split(new char[] { '=' });
642
                            string[] array = inconsistency.get_Name().ToString().Split(new char[] { '=' });
624 643
                            if (modelItem1 != null)
625 644
                            {
626 645
                                string attrName = array[0];
627 646
                                if (attrName.Contains("PipingPoint"))
628 647
                                {
629 648
                                    string originalAttr = attrName.Split(new char[] { '.' })[1];
630
                                    int index = Convert.ToInt32(relationship.Item1Location);
649
                                    int index = Convert.ToInt32(relationship.get_Item1Location());
631 650
                                    LMAAttribute attribute1 = modelItem1.Attributes["PipingPoint" + index + "." + originalAttr];
632
                                    if (attribute1 != null && !DBNull.Value.Equals(attribute1.Value))
651
                                    if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value()))
633 652
                                    {
634 653
                                        loop = true;
635
                                        attribute1.Value = DBNull.Value;
654
                                        attribute1.set_Value(DBNull.Value);
636 655
                                    }
637 656
                                    attribute1 = null;
638 657
                                }
639 658
                                else
640 659
                                {
641 660
                                    LMAAttribute attribute1 = modelItem1.Attributes[attrName];
642
                                    if (attribute1 != null && !DBNull.Value.Equals(attribute1.Value))
661
                                    if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value()))
643 662
                                    {
644 663
                                        loop = true;
645
                                        attribute1.Value = DBNull.Value;
664
                                        attribute1.set_Value(DBNull.Value);
646 665
                                    }
647 666
                                    attribute1 = null;
648 667
                                }
......
654 673
                                if (attrName.Contains("PipingPoint"))
655 674
                                {
656 675
                                    string originalAttr = attrName.Split(new char[] { '.' })[1];
657
                                    int index = Convert.ToInt32(relationship.Item2Location);
676
                                    int index = Convert.ToInt32(relationship.get_Item2Location());
658 677
                                    LMAAttribute attribute2 = modelItem2.Attributes["PipingPoint" + index + "." + originalAttr];
659
                                    if (attribute2 != null && !DBNull.Value.Equals(attribute2.Value))
678
                                    if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value()))
660 679
                                    {
661
                                        attribute2.Value = DBNull.Value;
680
                                        attribute2.set_Value(DBNull.Value);
662 681
                                        loop = true;
663 682
                                    }
664 683
                                    attribute2 = null;
......
666 685
                                else
667 686
                                {
668 687
                                    LMAAttribute attribute2 = modelItem2.Attributes[attrName];
669
                                    if (attribute2 != null && !DBNull.Value.Equals(attribute2.Value))
688
                                    if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value()))
670 689
                                    {
671
                                        attribute2.Value = DBNull.Value;
690
                                        attribute2.set_Value(DBNull.Value);
672 691
                                        loop = true;
673 692
                                    }
674 693
                                    attribute2 = null;
......
804 823
            foreach (var item in document.LINENUMBERS)
805 824
            {
806 825
                LMLabelPersist label = dataSource.GetLabelPersist(item.SPPID.RepresentationId);
807
                if (label == null || (label != null && label.ItemStatus.ToString() != "Active"))
826
                if (label == null || (label != null && label.get_ItemStatus() != "Active"))
808 827
                {
809 828
                    ReleaseCOMObjects(label);
810 829
                    item.SPPID.RepresentationId = null;
......
1042 1061
                LMLabelPersist label = dataSource.GetLabelPersist(item);
1043 1062
                if (label != null)
1044 1063
                {
1045
                    Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[label.GraphicOID.ToString()] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
1064
                    label.get_GraphicOID();
1065
                    DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[label.get_GraphicOID().ToString()] as DependencyObject;
1046 1066
                    if (dependency != null)
1047 1067
                        dependency.BringToFront();
1048 1068
                }
......
1074 1094
            Log.Write("Drawing name : " + drawingName);
1075 1095
            Log.Write("Drawing number : " + drawingNumber);
1076 1096
            Thread.Sleep(1000);
1077
            
1078
            string drawingTemplate = document.Template;
1079
            newDrawing = pidApp.Drawings.Add(document.Unit, ref drawingTemplate, drawingNumber, ref drawingName);
1080

  
1097
            newDrawing = application.Drawings.Add(document.Unit, document.Template, drawingNumber, drawingName);
1081 1098
            if (newDrawing != null)
1082 1099
            {
1083 1100
                document.SPPID_DrawingNumber = drawingNumber;
1084 1101
                document.SPPID_DrawingName = drawingName;
1085 1102
                Thread.Sleep(1000);
1086
                // TODO : ZOOM FIT
1087
                //radApp.ActiveWindow.Fit();
1103
                radApp.ActiveWindow.Fit();
1088 1104
                Thread.Sleep(1000);
1089
                // TODO : ZOOM FIT
1090
                //radApp.ActiveWindow.Zoom = 2000;
1105
                radApp.ActiveWindow.Zoom = 2000;
1091 1106
                Thread.Sleep(2000);
1092 1107

  
1093 1108
                //current LMDrawing 가져오기
......
1096 1111
                filter.ItemType = "Drawing";
1097 1112
                criterion.SourceAttributeName = "Name";
1098 1113
                criterion.Operator = "=";
1099
                criterion.ValueAttribute = drawingName;
1100
                filter.Criteria.Add(criterion);
1114
                criterion.set_ValueAttribute(drawingName);
1115
                filter.get_Criteria().Add(criterion);
1101 1116

  
1102 1117
                LMDrawings drawings = new LMDrawings();
1103 1118
                drawings.Collect(dataSource, Filter: filter);
1104 1119

  
1105 1120
                // Input Drawing Attribute
1106
                LMDrawing drawing = drawings.Nth(1);
1121
                LMDrawing drawing = ((dynamic)drawings).Nth(1);
1107 1122
                if (drawing != null)
1108 1123
                {
1109 1124
                    using (DataTable drawingAttributeDT = Project_DB.SelectDrawingProjectAttribute())
......
1121 1136
                                    string value = text.VALUE;
1122 1137
                                    LMAAttribute attribute = drawing.Attributes[mappingName];
1123 1138
                                    if (attribute != null)
1124
                                        attribute.Value = value;
1139
                                        attribute.set_Value(value);
1125 1140
                                    ReleaseCOMObjects(attribute);
1126 1141
                                    document.TEXTINFOS.Remove(text);
1127 1142
                                }
......
1187 1202

  
1188 1203
            foreach (LMDrawing item in drawings)
1189 1204
            {
1190
                drawingNameList.Add(item.Attributes["Name"].Value.ToString());
1191
                drawingNumberList.Add(item.Attributes["DrawingNumber"].Value.ToString());
1205
                drawingNameList.Add(item.Attributes["Name"].get_Value().ToString());
1206
                drawingNumberList.Add(item.Attributes["DrawingNumber"].get_Value().ToString());
1192 1207
            }
1193 1208

  
1194 1209
            int nameLength = drawingName.Length;
......
1303 1318
                    GetTargetSymbolConnectorPoint(connector, targetSymbol, ref x, ref y);
1304 1319

  
1305 1320
                LMConnector temp = LineModelingForSymbolZeroLength(symbol, _TargetItem, x, y);
1306
                _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, null, TargetItem: _TargetItem.AsLMRepresentation());
1321
                _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: _TargetItem);
1307 1322
                if (temp != null)
1308 1323
                    _placement.PIDRemovePlacement(temp.AsLMRepresentation());
1309 1324
                ReleaseCOMObjects(temp);
......
1325 1340
                List<string> ids = new List<string>();
1326 1341
                foreach (LMConnector item in _LMSymbol.Connect1Connectors)
1327 1342
                {
1328
                    if (item.ItemStatus.ToString() == "Active" && !ids.Contains(item.Id))
1343
                    if (item.get_ItemStatus() == "Active" && !ids.Contains(item.Id))
1329 1344
                        ids.Add(item.Id);
1330 1345
                    ReleaseCOMObjects(item);
1331 1346
                }
1332 1347
                foreach (LMConnector item in _LMSymbol.Connect2Connectors)
1333 1348
                {
1334
                    if (item.ItemStatus.ToString() == "Active" && !ids.Contains(item.Id))
1349
                    if (item.get_ItemStatus() == "Active" && !ids.Contains(item.Id))
1335 1350
                        ids.Add(item.Id);
1336 1351
                    ReleaseCOMObjects(item);
1337 1352
                }
......
1339 1354
                int createdSymbolCount = document.SYMBOLS.FindAll(i => i.CONNECTORS.Find(j => j.CONNECTEDITEM == symbol.UID) != null && !string.IsNullOrEmpty(i.SPPID.RepresentationId)).Count;
1340 1355
                if (targetSymbol == null && ids.Count != createdSymbolCount)
1341 1356
                {
1342
                    double currentX = Convert.ToDouble(_LMSymbol.XCoordinate);
1343
                    double currentY = Convert.ToDouble(_LMSymbol.YCoordinate);
1357
                    double currentX = _LMSymbol.get_XCoordinate();
1358
                    double currentY = _LMSymbol.get_YCoordinate();
1344 1359

  
1345 1360

  
1346 1361
                }
1347 1362

  
1348 1363
                symbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id;
1349
                symbol.SPPID.ModelItemID = _LMSymbol.ModelItemID.ToString();
1350
                symbol.SPPID.GraphicOID = _LMSymbol.GraphicOID.ToString();
1364
                symbol.SPPID.ModelItemID = _LMSymbol.ModelItemID;
1365
                symbol.SPPID.GraphicOID = _LMSymbol.get_GraphicOID().ToString();
1351 1366

  
1352 1367
                foreach (var item in symbol.ChildSymbols)
1353 1368
                    CreateChildSymbol(item, _LMSymbol, symbol);
1354 1369

  
1355
                symbol.SPPID.SPPID_X = Convert.ToDouble(_LMSymbol.XCoordinate);
1356
                symbol.SPPID.SPPID_Y = Convert.ToDouble(_LMSymbol.YCoordinate);
1370
                symbol.SPPID.SPPID_X = _LMSymbol.get_XCoordinate();
1371
                symbol.SPPID.SPPID_Y = _LMSymbol.get_YCoordinate();
1357 1372

  
1358 1373
                double[] range = null;
1359 1374
                GetSPPIDSymbolRange(symbol, ref range);
......
1416 1431
                            }
1417 1432
                        }
1418 1433

  
1419
                        LMAItem _LMAItem = _placement.PIDCreateItem(sppidLine);
1434
                        _LMAItem _LMAItem = _placement.PIDCreateItem(sppidLine);
1420 1435
                        PlaceRunInputs placeRunInputs = new PlaceRunInputs();
1421 1436
                        placeRunInputs.AddPoint(-1, -1);
1422 1437
                        placeRunInputs.AddSymbolTarget(_TargetItem, lineX, lineY);
......
1443 1458
        {
1444 1459
            LMModelItem modelItem = symbol.ModelItemObject;
1445 1460
            LMPipingPoints pipingPoints = null;
1446
            if (modelItem.ItemTypeName.ToString() == "PipingComp")
1461
            if (modelItem.get_ItemTypeName() == "PipingComp")
1447 1462
            {
1448 1463
                LMPipingComp pipingComp = dataSource.GetPipingComp(modelItem.Id);
1449 1464
                pipingPoints = pipingComp.PipingPoints;
1450 1465
                ReleaseCOMObjects(pipingComp);
1451 1466
                pipingComp = null;
1452 1467
            }
1453
            else if (modelItem.ItemTypeName.ToString() == "Instrument")
1468
            else if (modelItem.get_ItemTypeName() == "Instrument")
1454 1469
            {
1455 1470
                LMInstrument instrument = dataSource.GetInstrument(modelItem.Id);
1456 1471
                pipingPoints = instrument.PipingPoints;
......
1469 1484
                    {
1470 1485
                        if (attribute.Name == "PipingPointNumber")
1471 1486
                        {
1472
                            int index = Convert.ToInt32(attribute.Value);
1487
                            int index = Convert.ToInt32(attribute.get_Value());
1473 1488
                            if (info.Find(loopX => loopX[0] == index) == null)
1474 1489
                            {
1475 1490
                                double x = 0;
......
1578 1593
            double SPPIDgapX = gapX * percentX;
1579 1594
            double SPPIDgapY = gapY * percentY;
1580 1595

  
1581
            double[] SPPIDOriginPoint = new double[] { Convert.ToDouble(_TargetItem.XCoordinate) - SPPIDgapX, Convert.ToDouble(_TargetItem.YCoordinate) + SPPIDgapY };
1596
            double[] SPPIDOriginPoint = new double[] { _TargetItem.get_XCoordinate() - SPPIDgapX, _TargetItem.get_YCoordinate() + SPPIDgapY };
1582 1597
            double distance = double.MaxValue;
1583 1598
            double[] resultPoint;
1584 1599
            foreach (var point in points)
......
1619 1634
        private void GetSPPIDSymbolRangeAndConnectionPoints(Symbol symbol, ref double[] range, List<double[]> points)
1620 1635
        {
1621 1636
            LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId);
1622
            Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
1637
            Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()];
1623 1638
            double x1 = 0;
1624 1639
            double y1 = 0;
1625 1640
            double x2 = 0;
......
1646 1661
            LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId);
1647 1662
            if (_TargetItem != null)
1648 1663
            {
1649
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
1664
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()];
1650 1665
                double x1 = 0;
1651 1666
                double y1 = 0;
1652 1667
                double x2 = 0;
......
1744 1759
                double y2 = double.MinValue;
1745 1760
                range = new double[] { x1, y1, x2, y2 };
1746 1761

  
1747
                Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[labelPersist.GraphicOID.ToString()] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
1762
                Ingr.RAD2D.DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[labelPersist.get_GraphicOID().ToString()] as DependencyObject;
1748 1763
                foreach (var item in dependency.DrawingObjects)
1749 1764
                {
1750 1765
                    Ingr.RAD2D.TextBox textBox = item as Ingr.RAD2D.TextBox;
......
1800 1815
            LMSymbol _ChildSymbol = dataSource.GetSymbol(childSymbol.SPPID.RepresentationId);
1801 1816
            if (_ChildSymbol != null)
1802 1817
            {
1803
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
1818
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.get_GraphicOID().ToString()];
1804 1819
                double x1 = 0;
1805 1820
                double y1 = 0;
1806 1821
                double x2 = 0;
......
1833 1848
            LMSymbol _ChildSymbol = dataSource.GetSymbol(childSymbol.SPPID.RepresentationId);
1834 1849
            if (_ChildSymbol != null)
1835 1850
            {
1836
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
1851
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.get_GraphicOID().ToString()];
1837 1852
                double x1 = 0;
1838 1853
                double y1 = 0;
1839 1854
                double x2 = 0;
......
1861 1876
                BaseModel.Attribute itemAttribute = symbol.ATTRIBUTES.Find(x => x.ATTRIBUTE == "OWNERSYMBOL");
1862 1877
                if (itemAttribute == null || string.IsNullOrEmpty(itemAttribute.VALUE) || itemAttribute.VALUE == "None")
1863 1878
                    return;
1864
                double[] points = new double[] { 0, symbol.SPPID.ORIGINAL_X, symbol.SPPID.ORIGINAL_Y };
1879
                Array points = new double[] { 0, symbol.SPPID.ORIGINAL_X, symbol.SPPID.ORIGINAL_Y };
1865 1880

  
1866 1881
                string symbolUID = itemAttribute.VALUE;
1867 1882
                object targetItem = SPPIDUtil.FindObjectByUID(document, symbolUID);
......
1885 1900

  
1886 1901
                        // Target Symbol Item 가져오고 Label Modeling
1887 1902
                        LMSymbol _TargetItem = dataSource.GetSymbol(sRep);
1888
                        LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, points, null, Rotation: symbol.ANGLE, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: leaderLine);
1903
                        LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, ref points, Rotation: symbol.ANGLE, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: leaderLine);
1889 1904

  
1890 1905
                        //Leader 선 센터로
1891 1906
                        if (_LMLabelPresist != null)
......
1893 1908
                            // Target Item에 Label의 Attribute Input
1894 1909
                            InputSymbolAttribute(targetItem, symbol.ATTRIBUTES);
1895 1910

  
1896
                            string OID = _LMLabelPresist.GraphicOID.ToString();
1897
                            Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
1911
                            string OID = _LMLabelPresist.get_GraphicOID().ToString();
1912
                            DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as DependencyObject;
1898 1913
                            if (dependency != null)
1899 1914
                            {
1900 1915
                                bool result = false;
......
1911 1926
                                                if (drawingObject.Type == Ingr.RAD2D.ObjectType.igLineString2d)
1912 1927
                                                {
1913 1928
                                                    Ingr.RAD2D.LineString2d lineString2D = drawingObject as Ingr.RAD2D.LineString2d;
1914
                                                    double prevX = Convert.ToDouble(_TargetItem.XCoordinate);
1915
                                                    double prevY = Convert.ToDouble(_TargetItem.YCoordinate);
1929
                                                    double prevX = _TargetItem.get_XCoordinate();
1930
                                                    double prevY = _TargetItem.get_YCoordinate();
1916 1931
                                                    lineString2D.InsertVertex(lineString2D.VertexCount, prevX, prevY);
1917 1932
                                                    lineString2D.RemoveVertex(lineString2D.VertexCount);
1918 1933
                                                    result = true;
......
1954 1969
                        if (symbolMapping != null)
1955 1970
                            leaderLine = symbolMapping.LEADERLINE;
1956 1971

  
1957
                        LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, points, null, Rotation: symbol.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
1972
                        LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, ref points, Rotation: symbol.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
1958 1973
                        if (_LMLabelPresist != null)
1959 1974
                        {
1960 1975
                            symbol.SPPID.RepresentationId = _LMLabelPresist.AsLMRepresentation().Id;
......
2016 2031
                    {
2017 2032
                        targetItem = dataSource.GetSymbol(connEquipment.SPPID.RepresentationId);
2018 2033
                        if (targetItem != null)
2019
                            _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, null, TargetItem: targetItem.AsLMRepresentation());
2034
                            _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: targetItem);
2020 2035
                        else
2021 2036
                            _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle);
2022 2037
                    }
......
2031 2046
                    {
2032 2047
                        targetItem = dataSource.GetSymbol(connVendorPackage.SPPID.RepresentationId);
2033 2048
                        if (targetItem != null)
2034
                            _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, null, TargetItem: targetItem.AsLMRepresentation());
2049
                            _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: targetItem);
2035 2050
                        else
2036 2051
                            _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle);
2037 2052
                    }
......
2050 2065
            {
2051 2066
                _LMSymbol.Commit();
2052 2067
                equipment.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id;
2053
                equipment.SPPID.GraphicOID = _LMSymbol.GraphicOID.ToString();
2068
                equipment.SPPID.GraphicOID = _LMSymbol.get_GraphicOID().ToString();
2054 2069
                ReleaseCOMObjects(_LMSymbol);
2055 2070
            }
2056 2071

  
......
2315 2330
        /// <param name="parentSymbol"></param>
2316 2331
        private void CreateChildSymbol(ChildSymbol childSymbol, LMSymbol parentSymbol, Symbol parent)
2317 2332
        {
2318
            Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[parentSymbol.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
2333
            Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[parentSymbol.get_GraphicOID().ToString()];
2319 2334
            double x1 = 0;
2320 2335
            double x2 = 0;
2321 2336
            double y1 = 0;
2322 2337
            double y2 = 0;
2323 2338
            symbol2d.Range(out x1, out y1, out x2, out y2);
2324 2339

  
2325
            LMSymbol _LMSymbol = _placement.PIDPlaceSymbol(childSymbol.SPPID.MAPPINGNAME, (x1 + x2) / 2, (y1 + y2) / 2, null, null, null, TargetItem: parentSymbol.AsLMRepresentation());
2340
            LMSymbol _LMSymbol = _placement.PIDPlaceSymbol(childSymbol.SPPID.MAPPINGNAME, (x1 + x2) / 2, (y1 + y2) / 2, TargetItem: parentSymbol);
2326 2341
            if (_LMSymbol != null)
2327 2342
            {
2328 2343
                _LMSymbol.Commit();
......
2355 2370
                bool diagonal = false;
2356 2371
                if (groupLine.SlopeType != SlopeType.HORIZONTAL && groupLine.SlopeType != SlopeType.VERTICAL)
2357 2372
                    diagonal = true;
2358
                LMAItem _LMAItem = _placement.PIDCreateItem(groupLine.SPPID.MAPPINGNAME);
2373
                _LMAItem _LMAItem = _placement.PIDCreateItem(groupLine.SPPID.MAPPINGNAME);
2359 2374
                LMSymbol _LMSymbolStart = null;
2360 2375
                LMSymbol _LMSymbolEnd = null;
2361 2376
                PlaceRunInputs placeRunInputs = new PlaceRunInputs();
......
2451 2466
                if (_lMConnector != null)
2452 2467
                {
2453 2468
                    _lMConnector.Commit();
2454
                    groupLine.SPPID.ModelItemId = _lMConnector.ModelItemID.ToString();
2469
                    groupLine.SPPID.ModelItemId = _lMConnector.ModelItemID;
2455 2470

  
2456 2471
                    bool bRemodelingStart = false;
2457 2472
                    if (_LMSymbolStart != null)
......
2472 2487
                    {
2473 2488
                        LMAAttribute attribute = modelItem.Attributes["FlowDirection"];
2474 2489
                        if (attribute != null)
2475
                            attribute.Value = "End 1 is upstream (Inlet)";
2490
                            attribute.set_Value("End 1 is upstream (Inlet)");
2476 2491
                        modelItem.Commit();
2477 2492
                    }
2478 2493
                    ReleaseCOMObjects(modelItem);
......
2512 2527
            bool diagonal = false;
2513 2528
            if (line.SlopeType != SlopeType.HORIZONTAL && line.SlopeType != SlopeType.VERTICAL)
2514 2529
                diagonal = true;
2515
            LMAItem _LMAItem = _placement.PIDCreateItem(line.SPPID.MAPPINGNAME);
2530
            _LMAItem _LMAItem = _placement.PIDCreateItem(line.SPPID.MAPPINGNAME);
2516 2531
            LMSymbol _LMSymbolStart = null;
2517 2532
            LMSymbol _LMSymbolEnd = null;
2518 2533
            PlaceRunInputs placeRunInputs = new PlaceRunInputs();
......
2591 2606
            {
2592 2607
                foreach (LMRepresentation rep in modelItem.Representations)
2593 2608
                {
2594
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
2609
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
2595 2610
                    {
2596 2611
                        LMConnector _LMConnector = dataSource.GetConnector(rep.Id);
2597
                        dynamic OID = rep.GraphicOID.ToString();
2598
                        Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
2612
                        dynamic OID = rep.get_GraphicOID().ToString();
2613
                        DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
2599 2614
                        Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
2600 2615
                        int verticesCount = lineStringGeometry.VertexCount;
2601 2616
                        double[] vertices = null;
......
2623 2638
            {
2624 2639
                foreach (LMRepresentation rep in modelItem.Representations)
2625 2640
                {
2626
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
2641
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
2627 2642
                        _placement.PIDRemovePlacement(rep);
2628 2643
                }
2629 2644
                ReleaseCOMObjects(modelItem);
......
2850 2865
            bool diagonal = false;
2851 2866
            if (line.SlopeType != SlopeType.HORIZONTAL && line.SlopeType != SlopeType.VERTICAL)
2852 2867
                diagonal = true;
2853
            LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
2868
            _LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
2854 2869
            LMConnector newConnector = null;
2855
            dynamic OID = prevLMConnector.GraphicOID.ToString();
2856
            Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
2870
            dynamic OID = prevLMConnector.get_GraphicOID().ToString();
2871
            DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
2857 2872
            Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
2858 2873
            int verticesCount = lineStringGeometry.VertexCount;
2859 2874
            PlaceRunInputs placeRunInputs = new PlaceRunInputs();
......
2941 2956
                    {
2942 2957
                        _LMConnector.Commit();
2943 2958
                        RemoveConnectorForReModelingLine(newConnector);
2944
                        ZeroLengthModelItemID.Add(_LMConnector.ModelItemID.ToString());
2959
                        ZeroLengthModelItemID.Add(_LMConnector.ModelItemID);
2945 2960
                        ReleaseCOMObjects(_LMConnector);
2946 2961
                    }
2947 2962
                    ReleaseCOMObjects(placeRunInputs);
......
2952 2967
                {
2953 2968
                    if (startSymbol != null)
2954 2969
                    {
2955
                        Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(newConnector.ModelItemID.ToString());
2970
                        Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(newConnector.ModelItemID);
2956 2971
                        newConnector = dicVertices.First().Key;
2957 2972
                    }
2958 2973

  
......
2965 2980
                    {
2966 2981
                        _LMConnector.Commit();
2967 2982
                        RemoveConnectorForReModelingLine(newConnector);
2968
                        ZeroLengthModelItemIDReverse.Add(_LMConnector.ModelItemID.ToString());
2983
                        ZeroLengthModelItemIDReverse.Add(_LMConnector.ModelItemID);
2969 2984
                        ReleaseCOMObjects(_LMConnector);
2970 2985
                    }
2971 2986
                    ReleaseCOMObjects(placeRunInputs);
2972 2987
                    ReleaseCOMObjects(_LMAItem);
2973 2988
                }
2974 2989

  
2975
                line.SPPID.ModelItemId = newConnector.ModelItemID.ToString();
2990
                line.SPPID.ModelItemId = newConnector.ModelItemID;
2976 2991
                ReleaseCOMObjects(newConnector);
2977 2992
            }
2978 2993

  
......
2985 3000
        /// <param name="connector"></param>
2986 3001
        private void RemoveConnectorForReModelingLine(LMConnector connector)
2987 3002
        {
2988
            Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(connector.ModelItemID.ToString());
3003
            Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(connector.ModelItemID);
2989 3004
            foreach (var item in dicVertices)
2990 3005
            {
2991 3006
                if (item.Value.Count == 2)
......
3091 3106

  
3092 3107
                SegmentLocation location;
3093 3108
                double[] point = GetSegmentPoint(ownerObj, connectedItem, targetLMConnector, out location);
3094
                double[] array = null;
3109
                Array array = null;
3095 3110
                if (point != null)
3096 3111
                    array = new double[] { 0, point[0], point[1] };
3097 3112
                else
3098 3113
                    array = new double[] { 0, endBreak.SPPID.ORIGINAL_X, endBreak.SPPID.ORIGINAL_Y };
3099
                LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, array, null, null, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
3114
                LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
3100 3115
                if (_LmLabelPersist != null)
3101 3116
                {
3102 3117
                    _LmLabelPersist.Commit();
3103 3118
                    endBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id;
3104 3119
                    if (_LmLabelPersist.ModelItemObject != null)
3105
                        endBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID.ToString();
3106
                    endBreak.SPPID.GraphicOID = _LmLabelPersist.GraphicOID.ToString();
3120
                        endBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID;
3121
                    endBreak.SPPID.GraphicOID = _LmLabelPersist.get_GraphicOID().ToString();
3107 3122

  
3108
                    MoveSmartLabelObject(endBreak.SPPID.GraphicOID, location);
3123
                    MoveDependencyObject(endBreak.SPPID.GraphicOID, location);
3109 3124

  
3110 3125
                    ReleaseCOMObjects(_LmLabelPersist);
3111 3126
                }
......
3118 3133
            }
3119 3134
        }
3120 3135

  
3121
        private void MoveSmartLabelObject(string graphicOID, SegmentLocation location)
3136
        private void MoveDependencyObject(string graphicOID, SegmentLocation location)
3122 3137
        {
3123 3138
            double x = 0, y = 0;
3124 3139
            if (location.HasFlag(SegmentLocation.Up))
......
3134 3149
            if (x != 0 || y != 0)
3135 3150
            {
3136 3151
                radApp.ActiveSelectSet.RemoveAll();
3137
                Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
3152
                DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID] as DependencyObject;
3138 3153
                if (dependency != null)
3139 3154
                {
3140 3155
                    radApp.ActiveSelectSet.Add(dependency);
......
3162 3177
            #endregion
3163 3178

  
3164 3179
            LMConnector newConnector = null;
3165
            dynamic OID = connector.GraphicOID.ToString();
3166
            Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
3180
            dynamic OID = connector.get_GraphicOID().ToString();
3181
            DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
3167 3182
            Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
3168 3183
            int verticesCount = lineStringGeometry.VertexCount;
3169 3184
            PlaceRunInputs placeRunInputs = new PlaceRunInputs();
3170
            LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
3185
            _LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
3171 3186

  
3172
            if (Convert.ToBoolean(connector.IsZeroLength))
3187
            if (Convert.ToBoolean(connector.get_IsZeroLength()))
3173 3188
            {
3174 3189
                double[] vertices = null;
3175 3190
                lineStringGeometry.GetVertices(ref verticesCount, ref vertices);
......
3179 3194

  
3180 3195
                string flowDirection = string.Empty;
3181 3196
                LMAAttribute flowAttribute = connector.ModelItemObject.Attributes["FlowDirection"];
3182
                if (flowAttribute != null && !DBNull.Value.Equals(flowAttribute.Value))
3183
                    flowDirection = flowAttribute.Value.ToString();
3197
                if (flowAttribute != null && !DBNull.Value.Equals(flowAttribute.get_Value()))
3198
                    flowDirection = flowAttribute.get_Value().ToString();
3184 3199

  
3185 3200
                if (flowDirection == "End 1 is downstream (Outlet)")
3186 3201
                {
......
3193 3208
                    placeRunInputs.AddSymbolTarget(connector.ConnectItem1SymbolObject, x, y);
3194 3209
                    placeRunInputs.AddSymbolTarget(connector.ConnectItem2SymbolObject, x, y);
3195 3210
                }
3196
                string oldModelItemId = connector.ModelItemID.ToString();
3211
                string oldModelItemId = connector.ModelItemID;
3197 3212
                _placement.PIDRemovePlacement(connector.AsLMRepresentation());
3198 3213
                newConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
3199 3214
                newConnector.Commit();
3200
                ZeroLengthSymbolToSymbolModelItemID.Add(newConnector.ModelItemID.ToString());
3215
                ZeroLengthSymbolToSymbolModelItemID.Add(newConnector.ModelItemID);
3201 3216
                if (!string.IsNullOrEmpty(flowDirection))
3202
                    newConnector.ModelItemObject.Attributes["FlowDirection"].Value = flowDirection;
3217
                    newConnector.ModelItemObject.Attributes["FlowDirection"].set_Value(flowDirection);
3203 3218
                ReleaseCOMObjects(connector);
3204 3219

  
3205 3220
                foreach (var line in document.LINES.FindAll(z => z.SPPID.ModelItemId == oldModelItemId))
......
3207 3222
                    foreach (var repId in line.SPPID.Representations)
3208 3223
                    {
3209 3224
                        LMConnector _connector = dataSource.GetConnector(repId);
3210
                        if (_connector != null && _connector.ItemStatus.ToString() == "Active")
3225
                        if (_connector != null && _connector.get_ItemStatus() == "Active")
3211 3226
                        {
3212
                            if (line.SPPID.ModelItemId != _connector.ModelItemID.ToString())
3227
                            if (line.SPPID.ModelItemId != _connector.ModelItemID)
3213 3228
                            {
3214
                                line.SPPID.ModelItemId = _connector.ModelItemID.ToString();
3229
                                line.SPPID.ModelItemId = _connector.ModelItemID;
3215 3230
                                line.SPPID.Representations = GetRepresentations(line.SPPID.ModelItemId);
3216 3231
                            }
3217 3232
                        }
......
3252 3267
                            string MappingPath = mapping.SPPIDSYMBOLNAME;
3253 3268
                            SegmentLocation location;
3254 3269
                            double[] point = GetSegmentPoint(upStreamObj, downStreamObj, targetLMConnector, out location);
3255
                            double[] array = null;
3270
                            Array array = null;
3256 3271
                            if (point != null)
3257 3272
                                array = new double[] { 0, point[0], point[1] };
3258 3273
                            else
3259 3274
                                array = new double[] { 0, specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y };
3260
                            LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(MappingPath, array, null, null, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine);
3275
                            LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(MappingPath, ref array, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine);
3261 3276

  
3262 3277
                            if (_LmLabelPersist != null)
3263 3278
                            {
3264 3279
                                _LmLabelPersist.Commit();
3265 3280
                                specBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id;
3266 3281
                                if (_LmLabelPersist.ModelItemObject != null)
3267
                                    specBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID.ToString();
3268
                                specBreak.SPPID.GraphicOID = _LmLabelPersist.GraphicOID.ToString();
3282
                                    specBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID;
3283
                                specBreak.SPPID.GraphicOID = _LmLabelPersist.get_GraphicOID().ToString();
3269 3284

  
3270
                                MoveSmartLabelObject(specBreak.SPPID.GraphicOID, location);
3285
                                MoveDependencyObject(specBreak.SPPID.GraphicOID, location);
3271 3286

  
3272 3287
                                ReleaseCOMObjects(_LmLabelPersist);
3273 3288
                            }
......
3278 3293
                    if (property != null && !string.IsNullOrEmpty(property.VALUE) && property.VALUE.Equals("True"))
3279 3294
                    {
3280 3295
                        // temp
3281
                        ReleaseCOMObjects(_placement.PIDPlaceSymbol(@"\Design\Annotation\Graphics\Break.sym", specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y, null, Rotation: specBreak.ANGLE));
3296
                        ReleaseCOMObjects(_placement.PIDPlaceSymbol(@"\Design\Annotation\Graphics\Break.sym", specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y, Rotation: specBreak.ANGLE));
3282 3297
                    }
3283 3298
                    ReleaseCOMObjects(targetLMConnector);
3284 3299
                }
......
3304 3319

  
3305 3320
                foreach (LMConnector connector in targetLMSymbol.Avoid1Connectors)
3306 3321
                {
3307
                    if (connector.ItemStatus.ToString() != "Active")
3322
                    if (connector.get_ItemStatus() != "Active")
3308 3323
                        continue;
3309 3324

  
3310 3325
                    if (connector.ConnectItem1SymbolObject.Id == connectedLMSymbol.Id)
......
3321 3336

  
3322 3337
                foreach (LMConnector connector in targetLMSymbol.Avoid2Connectors)
3323 3338
                {
3324
                    if (connector.ItemStatus.ToString() != "Active")
3339
                    if (connector.get_ItemStatus() != "Active")
3325 3340
                        continue;
3326 3341

  
3327 3342
                    if (connector.ConnectItem1SymbolObject.Id == connectedLMSymbol.Id)
......
3344 3359
                LMModelItem targetModelItem = dataSource.GetModelItem(targetLine.SPPID.ModelItemId);
3345 3360
                LMModelItem connectedModelItem = dataSource.GetModelItem(connectedLine.SPPID.ModelItemId);
3346 3361

  
3347
                if (targetModelItem != null && targetModelItem.ItemStatus.ToString() == "Active" && connectedModelItem != null && connectedModelItem.ItemStatus.ToString() == "Active")
3362
                if (targetModelItem != null && targetModelItem.get_ItemStatus() == "Active" && connectedModelItem != null && connectedModelItem.get_ItemStatus() == "Active")
3348 3363
                {
3349 3364
                    foreach (LMRepresentation rep in targetModelItem.Representations)
3350 3365
                    {
3351 3366
                        if (targetConnector != null)
3352 3367
                            break;
3353 3368

  
3354
                        if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
3369
                        if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
3355 3370
                        {
3356 3371
                            LMConnector _LMConnector = dataSource.GetConnector(rep.Id);
3357 3372

  
......
3389 3404
                {
3390 3405
                    foreach (LMConnector connector in connectedLMSymbol.Avoid1Connectors)
3391 3406
                    {
3392
                        if (connector.ItemStatus.ToString() != "Active")
3407
                        if (connector.get_ItemStatus() != "Active")
3393 3408
                            continue;
3394 3409

  
3395 3410
                        if (IsConnected(connector, targetModelItem))
......
3403 3418
                    {
3404 3419
                        foreach (LMConnector connector in connectedLMSymbol.Avoid2Connectors)
3405 3420
                        {
3406
                            if (connector.ItemStatus.ToString() != "Active")
3421
                            if (connector.get_ItemStatus() != "Active")
3407 3422
                                continue;
3408 3423

  
3409 3424
                            if (IsConnected(connector, targetModelItem))
......
3428 3443
            Line connLine = connObj as Line;
3429 3444
            Symbol connSymbol = connObj as Symbol;
3430 3445
            location = SegmentLocation.None;
3431
            if (Convert.ToBoolean(targetConnector.IsZeroLength))
3446
            if (Convert.ToBoolean(targetConnector.get_IsZeroLength()))
3432 3447
            {
3433 3448
                result = GetConnectorVertices(targetConnector)[0];
3434 3449
                if (targetSymbol != null && connSymbol != null)
......
3526 3541
                if (result)
3527 3542
                    break;
3528 3543

  
3529
                if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
3544
                if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
3530 3545
                {
3531 3546
                    LMConnector _LMConnector = dataSource.GetConnector(rep.Id);
3532 3547

  
......
3578 3593
                if (connectedConnector != null)
3579 3594
                    break;
3580 3595

  
3581
                if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
3596
                if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
3582 3597
                {
3583 3598
                    LMConnector _LMConnector = dataSource.GetConnector(rep.Id);
3584 3599

  
......
3637 3652
                if (connector1 != null)
3638 3653
                {
3639 3654
                    vertices1 = GetConnectorVertices(connector1);
3640
                    graphicOID1 = connector1.GraphicOID.ToString();
3655
                    graphicOID1 = connector1.get_GraphicOID();
3641 3656
                }
3642
                LMAItem item1 = modelItem1.AsLMAItem();
3657
                _LMAItem item1 = modelItem1.AsLMAItem();
3643 3658
                ReleaseCOMObjects(connector1);
3644 3659
                connector1 = null;
3645 3660

  
......
3650 3665
                if (connector2 != null)
3651 3666
                {
3652 3667
                    vertices2 = GetConnectorVertices(connector2);
3653
                    graphicOID2 = connector2.GraphicOID.ToString();
3668
                    graphicOID2 = connector2.get_GraphicOID();
3654 3669
                }
3655
                LMAItem item2 = modelItem2.AsLMAItem();
3670
                _LMAItem item2 = modelItem2.AsLMAItem();
3656 3671
                ReleaseCOMObjects(connector2);
3657 3672
                connector2 = null;
3658 3673

  
......
3664 3679
                string beforeID = string.Empty;
3665 3680
                string afterID = string.Empty;
3666 3681

  
3667
                if (modelItem1.ItemStatus.ToString() == "Active" && modelItem2.ItemStatus.ToString() != "Active")
3682
                if (modelItem1.get_ItemStatus() == "Active" && modelItem2.get_ItemStatus() != "Active")
3668 3683
                {
3669 3684
                    beforeID = modelItem2.Id;
3670 3685
                    afterID = modelItem1.Id;
3671 3686
                    survivorId = afterID;
3672 3687
                }
3673
                else if (modelItem1.ItemStatus.ToString() != "Active" && modelItem2.ItemStatus.ToString() == "Active")
3688
                else if (modelItem1.get_ItemStatus() != "Active" && modelItem2.get_ItemStatus() == "Active")
3674 3689
                {
3675 3690
                    beforeID = modelItem1.Id;
3676 3691
                    afterID = modelItem2.Id;
3677 3692
                    survivorId = afterID;
3678 3693
                }
3679
                else if (modelItem1.ItemStatus.ToString() == "Active" && modelItem2.ItemStatus.ToString() == "Active")
3694
                else if (modelItem1.get_ItemStatus() == "Active" && modelItem2.get_ItemStatus() == "Active")
3680 3695
                {
3681 3696
                    int model1Cnt = GetConnectorCount(modelId1);
3682 3697
                    int model2Cnt = GetConnectorCount(modelId2);
......
3744 3759
            List<LMConnector> connectors = new List<LMConnector>();
3745 3760
            foreach (LMConnector connector in symbol.Avoid1Connectors)
3746 3761
            {
3747
                if (connector.ItemStatus.ToString() != "Active")
3762
                if (connector.get_ItemStatus() != "Active")
3748 3763
                    continue;
3749 3764

  
3750 3765
                LMModelItem modelItem = connector.ModelItemObject;
3751 3766
                LMSymbol connOtherSymbol = FindOtherConnectedSymbol(connector);
3752
                if (modelItem.ItemStatus.ToString() == "Active" && modelItem.ItemTypeName.ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
3767
                if (modelItem.get_ItemStatus() == "Active" && modelItem.get_ItemTypeName().ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
3753 3768
                    temp.Add(modelItem.Id);
3754 3769

  
3755 3770
                if (temp.Contains(modelItem.Id) &&
3756 3771
                    connOtherSymbol != null &&
3757
                    connOtherSymbol.RepresentationType.ToString() == "Branch" &&
3758
                    Convert.ToBoolean(connector.IsZeroLength))
3772
                    connOtherSymbol.get_RepresentationType() == "Branch" &&
3773
                    Convert.ToBoolean(connector.get_IsZeroLength()))
3759 3774
                    temp.Remove(modelItem.Id);
3760 3775

  
3761 3776

  
......
3769 3784

  
3770 3785
            foreach (LMConnector connector in symbol.Avoid2Connectors)
3771 3786
            {
3772
                if (connector.ItemStatus.ToString() != "Active")
3787
                if (connector.get_ItemStatus() != "Active")
3773 3788
                    continue;
3774 3789

  
3775 3790
                LMModelItem modelItem = connector.ModelItemObject;
3776 3791
                LMSymbol connOtherSymbol = FindOtherConnectedSymbol(connector);
3777
                if (modelItem.ItemStatus.ToString() == "Active" && modelItem.ItemTypeName.ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
3792
                if (modelItem.get_ItemStatus() == "Active" && modelItem.get_ItemTypeName().ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
3778 3793
                    temp.Add(modelItem.Id);
3779 3794

  
3780 3795
                if (temp.Contains(modelItem.Id) &&
3781 3796
                    connOtherSymbol != null &&
3782
                    connOtherSymbol.RepresentationType.ToString() == "Branch" &&
3783
                    Convert.ToBoolean(connector.IsZeroLength))
3797
                    connOtherSymbol.get_RepresentationType() == "Branch" &&
3798
                    Convert.ToBoolean(connector.get_IsZeroLength()))
3784 3799
                    temp.Remove(modelItem.Id);
3785 3800

  
3786 3801
                if (temp.Contains(modelItem.Id))
......
3796 3811
            string originalName = GetSPPIDFileName(modelId);
3797 3812
            foreach (var connector in connectors)
3798 3813
            {
3799
                string fileName = GetSPPIDFileName(connector.ModelItemID.ToString());
3814
                string fileName = GetSPPIDFileName(connector.ModelItemID);
3800 3815
                if (originalName == fileName)
3801
                    result.Add(connector.ModelItemID.ToString());
3816
                    result.Add(connector.ModelItemID);
3802 3817
                else
3803 3818
                {
3804
                    if (document.LINES.Find(x => x.SPPID.ModelItemId == connector.ModelItemID.ToString()) == null && Convert.ToBoolean(connector.IsZeroLength))
3805
                        result.Add(connector.ModelItemID.ToString());
3819
                    if (document.LINES.Find(x => x.SPPID.ModelItemId == connector.ModelItemID) == null && Convert.ToBoolean(connector.get_IsZeroLength()))
3820
                        result.Add(connector.ModelItemID);
3806 3821
                    else
3807 3822
                    {
3808 3823
                        Line line1 = document.LINES.Find(x => x.SPPID.ModelItemId == modelId);
3809 3824
                        Line line2 = document.LINES.Find(x => x.SPPID.ModelItemId == connector.ModelItemID.ToString());
3810 3825
                        if (line1 != null && line2 != null && line1.TYPE == line2.TYPE)
3811
                            result.Add(connector.ModelItemID.ToString());
3826
                            result.Add(connector.ModelItemID);
3812 3827
                    }
3813 3828
                }
3814 3829
            }
......
3822 3837
            LMSymbol FindOtherConnectedSymbol(LMConnector connector)
3823 3838
            {
3824 3839
                LMSymbol findResult = null;
3825
                if (connector.ConnectItem1SymbolObject != null && connector.ConnectItem1SymbolObject.Id != symbol.Id && connector.ConnectItem1SymbolObject.ItemStatus.ToString() == "Active")
3840
                if (connector.ConnectItem1SymbolObject != null && connector.ConnectItem1SymbolObject.Id != symbol.Id && connector.ConnectItem1SymbolObject.get_ItemStatus() == "Active")
3826 3841
                    findResult = connector.ConnectItem1SymbolObject;
3827
                else if (connector.ConnectItem2SymbolObject != null && connector.ConnectItem2SymbolObject.Id != symbol.Id && connector.ConnectItem2SymbolObject.ItemStatus.ToString() == "Active")
3842
                else if (connector.ConnectItem2SymbolObject != null && connector.ConnectItem2SymbolObject.Id != symbol.Id && connector.ConnectItem2SymbolObject.get_ItemStatus() == "Active")
3828 3843
                    findResult = connector.ConnectItem2SymbolObject;
3829 3844

  
3830 3845
                return findResult;
......
3845 3860
            {
3846 3861
                foreach (LMRepresentation rep in modelItem.Representations)
3847 3862
                {
3848
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
3863
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
3849 3864
                    {
3850 3865
                        LMConnector _LMConnector = dataSource.GetConnector(rep.Id);
3851
                        if (!ContainZeroLength && Convert.ToBoolean(_LMConnector.IsZeroLength))
3866
                        if (!ContainZeroLength && Convert.ToBoolean(_LMConnector.get_IsZeroLength()))
3852 3867
                        {
3853 3868
                            ReleaseCOMObjects(_LMConnector);
3854 3869
                            _LMConnector = null;
3855 3870
                            continue;
3856 3871
                        }
3857 3872
                        connectorVertices.Add(_LMConnector, new List<double[]>());
3858
                        dynamic OID = rep.GraphicOID.ToString();
3859
                        Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
3873
                        dynamic OID = rep.get_GraphicOID().ToString();
3874
                        DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
3860 3875
                        Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
3861 3876
                        int verticesCount = lineStringGeometry.VertexCount;
3862 3877
                        double[] vertices = null;
......
3865 3880
                        {
3866 3881
                            double x = 0;
3867 3882
                            double y = 0;
3868
                            //TODO : ddd
3869
                            lineStringGeometry.GetVertex(i, ref x, ref y);
3883
                            lineStringGeometry.GetVertex(i + 1, ref x, ref y);
3870 3884
                            connectorVertices[_LMConnector].Add(new double[] { x, y });
3871 3885
                        }
3872 3886
                    }
......
3883 3897
            List<double[]> vertices = new List<double[]>();
3884 3898
            if (connector != null)
3885 3899
            {
3886
                dynamic OID = connector.GraphicOID.ToString();
3887
                Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
3900
                dynamic OID = connector.get_GraphicOID().ToString();
3901
                DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
3888 3902
                Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
3889 3903
                int verticesCount = lineStringGeometry.VertexCount;
3890 3904
                double[] value = null;
......
3906 3920
            List<double[]> vertices = new List<double[]>();
3907 3921
            if (connector != null)
3908 3922
            {
3909
                dynamic OID = connector.GraphicOID.ToString();
3910
                Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
3923
                dynamic OID = connector.get_GraphicOID().ToString();
3924
                DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
3911 3925
                Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
3912 3926
                int verticesCount = lineStringGeometry.VertexCount;
3913 3927
                double[] value = null;
......
3932 3946
            List<double[]> vertices = new List<double[]>();
3933 3947
            if (connector != null)
3934 3948
            {
3935
                dynamic OID = connector.GraphicOID.ToString();
3936
                Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
3949
                dynamic OID = connector.get_GraphicOID().ToString();
3950
                DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
3937 3951
                double minX = 0;
3938 3952
                double minY = 0;
3939 3953
                double maxX = 0;
......
3947 3961
        private List<double[]> GetConnectorVertices(dynamic graphicOID)
3948 3962
        {
3949 3963
            List<double[]> vertices = null;
3950
            Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID] as Ingr.RAD2D.Components.Connector.Connector;
3964
            DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID];
3951 3965
            if (drawingObject != null)
3952 3966
            {
3953 3967
                vertices = new List<double[]>();
......
4143 4157
                            {
4144 4158
                                foreach (LMConnector connector in connSymbol.Connect1Connectors)
4145 4159
                                {
4146
                                    if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
4160
                                    if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
4147 4161
                                        containZeroLength = true;
4148 4162
                                }
4149 4163
                                foreach (LMConnector connector in connSymbol.Connect2Connectors)
4150 4164
                                {
4151
                                    if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
4165
                                    if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
4152 4166
                                        containZeroLength = true;
4153 4167
                                }
4154 4168
                            }
4155 4169

  
4156 4170
                            if (connSymbol == null ||
4157
                                (connSymbol != null && connSymbol.ItemStatus.ToString() == "Active" && connSymbol.RepresentationType.ToString() != "Branch") ||
4171
                                (connSymbol != null && connSymbol.get_ItemStatus() == "Active" && connSymbol.get_RepresentationType() != "Branch") ||
4158 4172
                                containZeroLength)
4159 4173
                            {
4160 4174
                                bool bCalcX = false;
......
4216 4230
                            {
4217 4231
                                foreach (LMConnector connector in connSymbol.Connect1Connectors)
4218 4232
                                {
4219
                                    if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
4233
                                    if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
4220 4234
                                        containZeroLength = true;
4221 4235
                                }
4222 4236
                                foreach (LMConnector connector in connSymbol.Connect2Connectors)
4223 4237
                                {
4224
                                    if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
4238
                                    if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
4225 4239
                                        containZeroLength = true;
4226 4240
                                }
4227 4241
                            }
4228 4242

  
4229 4243
                            if (connSymbol == null ||
4230
                                 (connSymbol != null && connSymbol.ItemStatus.ToString() == "Active" && connSymbol.RepresentationType.ToString() != "Branch") ||
4244
                                 (connSymbol != null && connSymbol.get_ItemStatus() == "Active" && connSymbol.get_RepresentationType() != "Branch") ||
4231 4245
                                containZeroLength)
4232 4246
                            {
4233 4247
                                bool bCalcX = false;
......
4302 4316
            {
4303 4317
                foreach (LMRepresentation rep in modelItem.Representations)
4304 4318
                {
4305
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
4319
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
4306 4320
                        connectors.Add(dataSource.GetConnector(rep.Id));
4307 4321
                }
4308 4322

  
......
4327 4341
            {
4328 4342
                foreach (LMRepresentation rep in modelItem.Representations)
4329 4343
                {
4330
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" &&
4331
                        rep.Attributes["ItemStatus"].Value.ToString() == "Active")
4344
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" &&
4345
                        rep.Attributes["ItemStatus"].get_Value() == "Active")
4332 4346
                    {
4333 4347
                        LMConnector connector = dataSource.GetConnector(rep.Id);
4334
                        if (!Convert.ToBoolean(connector.IsZeroLength))
4348
                        if (!Convert.ToBoolean(connector.get_IsZeroLength()))
4335 4349
                        {
4336 4350
                            result = connector;
4337 4351
                            break;
......
4358 4372
            {
4359 4373
                foreach (LMRepresentation rep in modelItem.Representations)
4360 4374
                {
4361
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
4375
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
4362 4376
                        result++;
4363 4377
                    ReleaseCOMObjects(rep);
4364 4378
                }
......
4376 4390
            {
4377 4391
                foreach (LMRepresentation rep in modelItem.Representations)
4378 4392
                {
4379
                    if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
4393
                    if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
4380 4394
                        result.Add(rep.Id);
4381 4395
                }
4382 4396
                ReleaseCOMObjects(modelItem);
......
4398 4412
                LMConnector connectedLMConnector = FindTargetLMConnectorForLabel(connectorVertices, x, y);
4399 4413
                if (connectedLMConnector != null)
4400 4414
                {
4401
                    double[] points = new double[] { 0, x, y };
4415
                    Array points = new double[] { 0, x, y };
4402 4416
                    lineNumber.SPPID.SPPID_X = x;
4403 4417
                    lineNumber.SPPID.SPPID_Y = y;
4404
                    LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, points, null, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false);
4418
                    LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false);
4405 4419

  
4406 4420
                    if (_LmLabelPresist != null)
4407 4421
                    {
......
4426 4440
                LMLabelPersist removeLabel = dataSource.GetLabelPersist(lineNumber.SPPID.RepresentationId);
4427 4441
                if (removeLabel != null)
4428 4442
                {
4429
                    lineNumber.SPPID.SPPID_X = Convert.ToDouble(removeLabel.XCoordinate);
4430
                    lineNumber.SPPID.SPPID_Y = Convert.ToDouble(removeLabel.YCoordinate);
4443
                    lineNumber.SPPID.SPPID_X = removeLabel.get_XCoordinate();
4444
                    lineNumber.SPPID.SPPID_Y = removeLabel.get_YCoordinate();
4431 4445

  
4432 4446
                    GridSetting gridSetting = GridSetting.GetInstance();
4433 4447
                    LMConnector connector = dataSource.GetConnector(removeLabel.RepresentationID);
......
4529 4543
                        if (offsetY != 0 || offsetY != 0)
4530 4544
                        {
4531 4545
                            if (connector.ConnectItem1SymbolObject != null &&
4532
                                connector.ConnectItem1SymbolObject.RepresentationType.ToString() == "OPC")
4546
                                connector.ConnectItem1SymbolObject.get_RepresentationType() == "OPC")
4533 4547
                            {
4534
                                Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem1SymbolObject.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
4548
                                Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem1SymbolObject.get_GraphicOID().ToString()];
4535 4549

  
4536 4550
                                double x1, y1, x2, y2, originX, originY;
4537 4551
                                symbol.Range(out x1, out y1, out x2, out y2);
......
4542 4556
                                    offsetX = -1 * (originX - gridSetting.Length * 30 - labelCenterX);
4543 4557
                            }
4544 4558
                            else if (connector.ConnectItem2SymbolObject != null &&
4545
                                    connector.ConnectItem2SymbolObject.RepresentationType.ToString() == "OPC")
4559
                                    connector.ConnectItem2SymbolObject.get_RepresentationType() == "OPC")
4546 4560
                            {
4547
                                Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem2SymbolObject.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
4561
                                Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem2SymbolObject.get_GraphicOID().ToString()];
4548 4562

  
4549 4563
                                double x1, y1, x2, y2, originX, originY;
4550 4564
                                symbol.Range(out x1, out y1, out x2, out y2);
......
4556 4570
                            }
4557 4571

  
4558 4572
                            radApp.ActiveSelectSet.RemoveAll();
4559
                            Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[removeLabel.GraphicOID.ToString()] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
4573
                            DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[removeLabel.get_GraphicOID().ToString()] as DependencyObject;
4560 4574
                            if (dependency != null)
4561 4575
                            {
4562 4576
                                radApp.ActiveSelectSet.Add(dependency);
......
4598 4612
                    List<double[]> vertices = GetConnectorVertices(connector);
4599 4613
                    vertices = vertices.FindAll(x => x[0] > 0 && x[1] > 0);
4600 4614
                    double[] point = vertices[vertices.Count - 1];
4601
                    double[] array = new double[] { 0, point[0], point[1] };
4602
                    LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mappingPath, array, null, null, LabeledItem: connector.AsLMRepresentation());
4615
                    Array array = new double[] { 0, point[0], point[1] };
4616
                    LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mappingPath, ref array, LabeledItem: connector.AsLMRepresentation());
4603 4617
                    if (_LMLabelPersist != null)
4604 4618
                    {
4605 4619
                        _LMLabelPersist.Commit();
......
4637 4651
                        if (line != null && !endLine.Contains(line.SPPID.ModelItemId))
4638 4652
                        {
4639 4653
                            LMModelItem _LMModelItem = dataSource.GetModelItem(line.SPPID.ModelItemId);
4640
                            if (_LMModelItem != null && _LMModelItem.ItemStatus.ToString() == "Active")
4654
                            if (_LMModelItem != null && _LMModelItem.get_ItemStatus() == "Active")
4641 4655
                            {
4642 4656
                                foreach (var attribute in lineNumber.ATTRIBUTES)
4643 4657
                                {
......
4654 4668
                                                if (dt.Rows.Count == 1)
4655 4669
                                                {
4656 4670
                                                    string fluidSystem = dt.Rows[0]["CODELIST_TEXT"].ToString();
4657
                                                    if (DBNull.Value.Equals(_FluidSystemAttribute.Value))
4658
                                                        _FluidSystemAttribute.Value = fluidSystem;
4659
                                                    else if (_FluidSystemAttribute.Value.ToString() != fluidSystem)
4660
                                                        _FluidSystemAttribute.Value = fluidSystem;
4671
                                                    if (DBNull.Value.Equals(_FluidSystemAttribute.get_Value()))
4672
                                                        _FluidSystemAttribute.set_Value(fluidSystem);
4673
                                                    else if (_FluidSystemAttribute.get_Value() != fluidSystem)
4674
                                                        _FluidSystemAttribute.set_Value(fluidSystem);
4661 4675

  
4662 4676
                                                    if (_LMAAttribute != null)
4663 4677
                                                    {
4664
                                                        if (DBNull.Value.Equals(_LMAAttribute.Value))
4665
                                                            _LMAAttribute.Value = attribute.VALUE;
4666
                                                        else if (_LMAAttribute.Value.ToString() != attribute.VALUE)
4667
                                                            _LMAAttribute.Value = attribute.VALUE;
4678
                                                        if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
4679
                                                            _LMAAttribute.set_Value(attribute.VALUE);
4680
                                                        else if (_LMAAttribute.get_Value() != attribute.VALUE)
4681
                                                            _LMAAttribute.set_Value(attribute.VALUE);
4668 4682
                                                    }
4669 4683
                                                }
4670 4684
                                                if (dt != null)
......
4682 4696
                                                else
4683 4697
                                                    attribute.VALUE = rows[0]["InchStr"].ToString();
4684 4698

  
4685
                                                if (DBNull.Value.Equals(_LMAAttribute.Value))
4686
                                                    _LMAAttribute.Value = attribute.VALUE;
4687
                                                else if (_LMAAttribute.Value.ToString() != attribute.VALUE)
4688
                                                    _LMAAttribute.Value = attribute.VALUE;
4699
                                                if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
4700
                                                    _LMAAttribute.set_Value(attribute.VALUE);
4701
                                                else if (_LMAAttribute.get_Value() != attribute.VALUE)
4702
                                                    _LMAAttribute.set_Value(attribute.VALUE);
4689 4703
                                            }
4690 4704
                                        }
4691 4705
                                        else if (_LMAAttribute != null)
4692 4706
                                        {
4693
                                            if (DBNull.Value.Equals(_LMAAttribute.Value))
4694
                                                _LMAAttribute.Value = attribute.VALUE;
4695
                                            else if (_LMAAttribute.Value.ToString() != attribute.VALUE)
4696
                                                _LMAAttribute.Value = attribute.VALUE;
4707
                                            if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
4708
                                                _LMAAttribute.set_Value(attribute.VALUE);
4709
                                            else if (_LMAAttribute.get_Value() != attribute.VALUE)
4710
                                                _LMAAttribute.set_Value(attribute.VALUE);
4697 4711
                                        }
4698 4712
                                    }
4699 4713
                                }
......
4749 4763
                                    else
4750 4764
                                        item.VALUE = rows[0]["InchStr"].ToString();
4751 4765

  
4752
                                    if (DBNull.Value.Equals(_LMAAttribute.Value))
4753
                                        _LMAAttribute.Value = item.VALUE;
4754
                                    else if (_LMAAttribute.Value.ToString() != item.VALUE)
4755
                                        _LMAAttribute.Value = item.VALUE;
4766
                                    if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
4767
                                        _LMAAttribute.set_Value(item.VALUE);
4768
                                    else if (_LMAAttribute.get_Value() != item.VALUE)
4769
                                        _LMAAttribute.set_Value(item.VALUE);
4756 4770
                                }
4757 4771
                            }
4758 4772
                            else if (_LMAAttribute != null)
4759 4773
                            {
4760
                                _LMAAttribute.Value = item.VALUE;
4774
                                _LMAAttribute.set_Value(item.VALUE);
4761 4775
                                // OPC 일경우 Attribute 저장
4762 4776
                                if (targetItem.GetType() == typeof(Symbol))
4763 4777
                                {
......
4768 4782
                            }
4769 4783
                        }
4770 4784
                        else
4771
                            DefaultTextModeling(item.VALUE, Convert.ToDouble(_LMSymbol.XCoordinate), Convert.ToDouble(_LMSymbol.YCoordinate));
4785
                            DefaultTextModeling(item.VALUE, _LMSymbol.get_XCoordinate(), _LMSymbol.get_YCoordinate());
4772 4786
                    }
4773 4787
                }
4774 4788
                _LMModelItem.Commit();
......
4798 4812
                            if (dt.Rows.Count == 1)
4799 4813
                            {
4800 4814
                                string fluidSystem = dt.Rows[0]["CODELIST_TEXT"].ToString();
4801
                                if (DBNull.Value.Equals(_FluidSystemAttribute.Value))
4802
                                    _FluidSystemAttribute.Value = fluidSystem;
4803
                                else if (_FluidSystemAttribute.Value.ToString() != fluidSystem)
4804
                                    _FluidSystemAttribute.Value = fluidSystem;
4815
                                if (DBNull.Value.Equals(_FluidSystemAttribute.get_Value()))
4816
                                    _FluidSystemAttribute.set_Value(fluidSystem);
4817
                                else if (_FluidSystemAttribute.get_Value() != fluidSystem)
4818
                                    _FluidSystemAttribute.set_Value(fluidSystem);
4805 4819

  
4806 4820
                                if (_LMAAttribute != null)
4807 4821
                                {
4808
                                    if (DBNull.Value.Equals(_LMAAttribute.Value))
4809
                                        _LMAAttribute.Value = item.VALUE;
4810
                                    else if (_LMAAttribute.Value.ToString() != item.VALUE)
4811
                                        _LMAAttribute.Value = item.VALUE;
4822
                                    if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
4823
                                        _LMAAttribute.set_Value(item.VALUE);
4824
                                    else if (_LMAAttribute.get_Value() != item.VALUE)
4825
                                        _LMAAttribute.set_Value(item.VALUE);
4812 4826
                                }
4813 4827
                            }
4814 4828
                            if (dt != null)
......
4826 4840
                            else
4827 4841
                                item.VALUE = rows[0]["InchStr"].ToString();
4828 4842

  
4829
                            if (DBNull.Value.Equals(_LMAAttribute.Value))
4830
                                _LMAAttribute.Value = item.VALUE;
4831
                            else if (_LMAAttribute.Value.ToString() != item.VALUE)
4832
                                _LMAAttribute.Value = item.VALUE;
4843
                            if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
4844
                                _LMAAttribute.set_Value(item.VALUE);
4845
                            else if (_LMAAttribute.get_Value() != item.VALUE)
4846
                                _LMAAttribute.set_Value(item.VALUE);
4833 4847
                        }
4834 4848
                    }
4835 4849
                    else if (mapping != null && !string.IsNullOrEmpty(item.VALUE) && item.VALUE != "None")
......
4838 4852
                        {
4839 4853
                            LMAAttribute _Attribute = _Attributes[mapping.SPPIDATTRIBUTENAME];
4840 4854
                            if (_Attribute != null)
4841
                                _Attribute.Value = item.VALUE;
4855
                                _Attribute.set_Value(item.VALUE);
4842 4856
                        }
4843 4857
                    }
4844 4858
                }
......
4867 4881
                {
4868 4882
                    foreach (LMLabelPersist _LMLabelPersist in targetLMConnector.LabelPersists)
4869 4883
                    {
4870
                        string symbolPath = _LMLabelPersist.FileName.ToString();
4884
                        string symbolPath = _LMLabelPersist.get_FileName();
4871 4885
                        AttributeMapping mapping = document.AttributeMappings.Find(x => x.SPPIDSYMBOLNAME == symbolPath);
4872 4886
                        if (mapping != null)
4873 4887
                        {
......
4913 4927

  
4914 4928
                    foreach (LMConnector connector in upStreamLMSymbol.Avoid1Connectors)
4915 4929
                    {
4916
                        if (connector.ItemStatus.ToString() != "Active")
4930
                        if (connector.get_ItemStatus() != "Active")
4917 4931
                            continue;
4918 4932

  
4919 4933
                        if (connector.Id != zeroLenthConnector.Id)
......
4922 4936

  
4923 4937
                    foreach (LMConnector connector in upStreamLMSymbol.Avoid2Connectors)
4924 4938
                    {
4925
                        if (connector.ItemStatus.ToString() != "Active")
4939
                        if (connector.get_ItemStatus() != "Active")
4926 4940
                            continue;
4927 4941

  
4928 4942
                        if (connector.Id != zeroLenthConnector.Id)
......
4931 4945

  
4932 4946
                    foreach (LMConnector connector in downStreamLMSymbol.Avoid1Connectors)
4933 4947
                    {
4934
                        if (connector.ItemStatus.ToString() != "Active")
4948
                        if (connector.get_ItemStatus() != "Active")
4935 4949
                            continue;
4936 4950

  
4937 4951
                        if (connector.Id != zeroLenthConnector.Id)
......
4940 4954

  
4941 4955
                    foreach (LMConnector connector in downStreamLMSymbol.Avoid2Connectors)
4942 4956
                    {
4943
                        if (connector.ItemStatus.ToString() != "Active")
4957
                        if (connector.get_ItemStatus() != "Active")
4944 4958
                            continue;
4945 4959

  
4946 4960
                        if (connector.Id != zeroLenthConnector.Id)
......
4959 4973

  
4960 4974
                    foreach (LMConnector connector in upStreamLMSymbol.Avoid1Connectors)
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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