개정판 32da6a8a
SPPID2019 이전으로 회귀
Change-Id: I1a4d3104e911ab79f2a9f6a2bf5558bb2c568f29
DTI_PID/DTI_PID.sln | ||
---|---|---|
1 | 1 |
|
2 | 2 |
Microsoft Visual Studio Solution File, Format Version 12.00 |
3 |
# Visual Studio 15
|
|
4 |
VisualStudioVersion = 15.0.28010.2016
|
|
3 |
# Visual Studio Version 16
|
|
4 |
VisualStudioVersion = 16.0.29613.14
|
|
5 | 5 |
MinimumVisualStudioVersion = 10.0.40219.1 |
6 | 6 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PDF_TO_IMAGE", "PDF_TO_IMAGE\PDF_TO_IMAGE.csproj", "{B7B8B0AE-9F03-4543-BC05-813A25E9D584}" |
7 | 7 |
EndProject |
... | ... | |
11 | 11 |
EndProject |
12 | 12 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ID2PSN", "ID2PSN\ID2PSN.csproj", "{202B8B3F-2070-4643-A43B-2C57B36B8D63}" |
13 | 13 |
EndProject |
14 |
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "DTI_PID", "DTI_PID\DTI_PID.pyproj", "{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}" |
|
15 |
EndProject |
|
16 | 14 |
Global |
17 | 15 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
18 | 16 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
71 | 69 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x64.Build.0 = Release|Any CPU |
72 | 70 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x86.ActiveCfg = Release|Any CPU |
73 | 71 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x86.Build.0 = Release|Any CPU |
74 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
75 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Debug|x64.ActiveCfg = Debug|Any CPU |
|
76 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
77 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
78 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Release|x64.ActiveCfg = Release|Any CPU |
|
79 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Release|x86.ActiveCfg = Release|Any CPU |
|
80 | 72 |
EndGlobalSection |
81 | 73 |
GlobalSection(SolutionProperties) = preSolution |
82 | 74 |
HideSolutionNode = FALSE |
DTI_PID/SPPIDConverter/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?>
|
|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 | 2 |
<configuration> |
3 | 3 |
<configSections> |
4 | 4 |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
5 |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
|
5 |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> |
|
6 | 6 |
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
7 |
<section name="Converter.SPPID.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
7 |
<section name="Converter.SPPID.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> |
|
8 | 8 |
</sectionGroup> |
9 | 9 |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
10 | 10 |
</configSections> |
11 | 11 |
<entityFramework> |
12 | 12 |
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> |
13 | 13 |
<parameters> |
14 |
<parameter value="mssqllocaldb" />
|
|
14 |
<parameter value="mssqllocaldb"/> |
|
15 | 15 |
</parameters> |
16 | 16 |
</defaultConnectionFactory> |
17 | 17 |
<providers> |
18 |
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
|
19 |
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
|
18 |
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/> |
|
19 |
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/> |
|
20 | 20 |
</providers> |
21 | 21 |
</entityFramework> |
22 | 22 |
<userSettings> |
23 | 23 |
<Converter.SPPID.Properties.Settings> |
24 | 24 |
<setting name="ProjectPath" serializeAs="String"> |
25 |
<value />
|
|
25 |
<value/> |
|
26 | 26 |
</setting> |
27 | 27 |
<setting name="DefaultTemplate" serializeAs="String"> |
28 |
<value /> |
|
29 |
</setting> |
|
30 |
<setting name="DefaultBulkRule" serializeAs="String"> |
|
31 |
<value /> |
|
28 |
<value/> |
|
32 | 29 |
</setting> |
33 | 30 |
<setting name="DefaultUnit" serializeAs="String"> |
34 |
<value />
|
|
31 |
<value/> |
|
35 | 32 |
</setting> |
36 | 33 |
<setting name="ProjectDBType" serializeAs="String"> |
37 | 34 |
<value>0</value> |
38 | 35 |
</setting> |
39 | 36 |
<setting name="ProjectServerIP" serializeAs="String"> |
40 |
<value />
|
|
37 |
<value/> |
|
41 | 38 |
</setting> |
42 | 39 |
<setting name="ProjectPort" serializeAs="String"> |
43 |
<value />
|
|
40 |
<value/> |
|
44 | 41 |
</setting> |
45 | 42 |
<setting name="ProjectDBUser" serializeAs="String"> |
46 |
<value />
|
|
43 |
<value/> |
|
47 | 44 |
</setting> |
48 | 45 |
<setting name="ProjectDBPassword" serializeAs="String"> |
49 |
<value />
|
|
46 |
<value/> |
|
50 | 47 |
</setting> |
51 | 48 |
<setting name="DrawingX" serializeAs="String"> |
52 | 49 |
<value>0</value> |
... | ... | |
54 | 51 |
<setting name="DrawingY" serializeAs="String"> |
55 | 52 |
<value>0</value> |
56 | 53 |
</setting> |
57 |
<setting name="LicenseKey" serializeAs="String"> |
|
58 |
<value /> |
|
59 |
</setting> |
|
60 | 54 |
</Converter.SPPID.Properties.Settings> |
61 | 55 |
</userSettings> |
62 | 56 |
<system.data> |
63 | 57 |
<DbProviderFactories> |
64 |
<remove invariant="System.Data.SQLite.EF6" />
|
|
65 |
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
|
66 |
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
|
|
58 |
<remove invariant="System.Data.SQLite.EF6"/> |
|
59 |
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6"/> |
|
60 |
<remove invariant="System.Data.SQLite"/><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/></DbProviderFactories>
|
|
67 | 61 |
</system.data> |
68 |
<runtime> |
|
69 |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|
70 |
<dependentAssembly> |
|
71 |
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> |
|
72 |
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" /> |
|
73 |
</dependentAssembly> |
|
74 |
</assemblyBinding> |
|
75 |
</runtime> |
|
76 |
</configuration> |
|
62 |
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration> |
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; |
|
9 | 7 |
using Ingr.RAD2D.Interop.RAD2D; |
10 | 8 |
using Ingr.RAD2D.Internal; |
11 | 9 |
using Ingr.RAD2D.Helper; |
... | ... | |
22 | 20 |
using Microsoft.VisualBasic; |
23 | 21 |
using Newtonsoft.Json; |
24 | 22 |
using DevExpress.XtraSplashScreen; |
23 |
using Ingr.SPPID.Llama; |
|
24 |
using Ingr.SPPID.Plaice; |
|
25 |
|
|
25 | 26 |
namespace Converter.SPPID |
26 | 27 |
{ |
27 | 28 |
[Flags] |
... | ... | |
38 | 39 |
Placement _placement; |
39 | 40 |
LMADataSource dataSource; |
40 | 41 |
string drawingID; |
41 |
dynamic newDrawing;
|
|
42 |
Ingr.SPPID.PIDAuto.Drawing newDrawing;
|
|
42 | 43 |
dynamic application; |
43 | 44 |
bool closeDocument; |
44 | 45 |
Ingr.RAD2D.Application radApp; |
46 |
Ingr.SPPID.PIDAuto.Application pidApp; |
|
45 | 47 |
SPPID_Document document; |
46 | 48 |
ETCSetting _ETCSetting; |
47 | 49 |
DataTable nominalDiameterTable = null; |
... | ... | |
57 | 59 |
public AutoModeling(SPPID_Document document, bool closeDocument) |
58 | 60 |
{ |
59 | 61 |
application = Interaction.GetObject("", "PIDAutomation.Application"); |
60 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
61 |
radApp = wApp.RADApplication; |
|
62 |
WrapperApplication wApp = new WrapperApplication(application); |
|
63 |
radApp = wApp.Application.RADApplication; |
|
64 |
|
|
65 |
pidApp = new Ingr.SPPID.PIDAuto.Application(); |
|
62 | 66 |
|
63 | 67 |
this.closeDocument = closeDocument; |
64 | 68 |
this.document = document; |
... | ... | |
93 | 97 |
nominalDiameterTable = Project_DB.SelectProjectNominalDiameter(); |
94 | 98 |
_placement = new Placement(); |
95 | 99 |
dataSource = _placement.PIDDataSource; |
96 |
|
|
100 |
|
|
97 | 101 |
if (CreateDocument(ref drawingNumber, ref drawingName) && DocumentCoordinateCorrection()) |
98 | 102 |
{ |
99 | 103 |
Log.Write("Start Modeling"); |
... | ... | |
103 | 107 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText); |
104 | 108 |
|
105 | 109 |
// VendorPackage Modeling |
106 |
// ID2에서 VendorPackage로 된 Symbol을 SPPID에서 그림 |
|
107 | 110 |
RunVendorPackageModeling(); |
108 | 111 |
// Equipment Modeling |
109 |
// Id2에서 인식한 Equipment일 경우 SPPID에 Draft |
|
110 | 112 |
RunEquipmentModeling(); |
111 | 113 |
// 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이 없는것 |
|
121 | 116 |
RunLineModeling(); |
122 | 117 |
// Vent Drain Modeling |
123 |
// Vent/Drain으로 인식한 Item draft |
|
124 |
// 인식 조건 |
|
125 |
// 1. ID2에서 Line이 하나며 Branch된 Line이 있고 |
|
126 |
// 2. Valve가 line에 붙어있다. |
|
127 | 118 |
RunVentDrainModeling(); |
128 | 119 |
// Clear Attribute |
129 |
// SPPID에서 Line 생성 시 자동으로 Nominal Diameter가 입력되는 경우가 있음 |
|
130 |
// 모든 Item의 Nominal Diameter 속성값 초기화 |
|
131 | 120 |
RunClearNominalDiameter(); |
132 | 121 |
// Join SameConnector |
133 |
// 기존 Line을 그릴때 SPPID에서는 같은 Run으로 생성되지 않고 각각 PipeRun이 생성됨 |
|
134 |
// ID2의 EndBreak등 segmentbreak가 없으면 Line을 합침 |
|
135 | 122 |
RunJoinRunForSameConnector(); |
136 | 123 |
// Join Run |
137 |
// 같은 Type의 Line일 경우 Join함 |
|
138 | 124 |
RunJoinRun(); |
139 |
|
|
140 | 125 |
// EndBreak Modeling |
141 | 126 |
RunEndBreakModeling(); |
142 | 127 |
// SpecBreak Modeling |
143 | 128 |
RunSpecBreakModeling(); |
144 | 129 |
//Line Number Modeling |
145 |
// Label만 draft |
|
146 | 130 |
RunLineNumberModeling(); |
147 | 131 |
// Note Modeling |
148 | 132 |
RunNoteModeling(); |
... | ... | |
158 | 142 |
RunInputEndBreakAttribute(); |
159 | 143 |
// Label Symbol Modeling |
160 | 144 |
RunLabelSymbolModeling(); |
161 |
|
|
162 | 145 |
// Correct Text |
163 |
// LabelPersist 정렬 로직 |
|
164 |
// 예) Valve Size label 등 |
|
165 | 146 |
RunCorrectAssociationText(); |
166 | 147 |
// ETC |
167 |
// Label을 Front로 옮김 |
|
168 | 148 |
RunETC(); |
169 |
// input bulk attribute
|
|
149 |
// BulkAttribute
|
|
170 | 150 |
RunBulkAttribute(); |
171 |
// log file 생성
|
|
151 |
// Result Logging
|
|
172 | 152 |
document.CheckModelingResult(); |
173 | 153 |
} |
174 | 154 |
} |
... | ... | |
196 | 176 |
Thread.Sleep(1000); |
197 | 177 |
|
198 | 178 |
Log.Write("End Modeling"); |
199 |
radApp.ActiveWindow.Fit(); |
|
179 |
|
|
180 |
// TODO : ZOOM FIT |
|
181 |
//radApp.ActiveDocument.ActiveSheet.Fit(); |
|
200 | 182 |
|
201 | 183 |
ReleaseCOMObjects(application); |
202 | 184 |
application = null; |
... | ... | |
206 | 188 |
{ |
207 | 189 |
newDrawing.Save(); |
208 | 190 |
newDrawing.CloseDrawing(true); |
209 |
ReleaseCOMObjects(newDrawing); |
|
210 | 191 |
newDrawing = null; |
211 | 192 |
} |
212 | 193 |
else if (newDrawing == null) |
... | ... | |
522 | 503 |
{ |
523 | 504 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
524 | 505 |
if (attribute != null) |
525 |
attribute.set_Value(DBNull.Value);
|
|
506 |
attribute.Value = DBNull.Value;
|
|
526 | 507 |
|
527 | 508 |
modelItem.Commit(); |
528 | 509 |
ReleaseCOMObjects(modelItem); |
... | ... | |
545 | 526 |
{ |
546 | 527 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
547 | 528 |
if (attribute != null) |
548 |
attribute.set_Value(DBNull.Value);
|
|
529 |
attribute.Value = DBNull.Value;
|
|
549 | 530 |
int index = 1; |
550 | 531 |
while (true) |
551 | 532 |
{ |
552 | 533 |
attribute = modelItem.Attributes[string.Format("PipingPoint{0}.NominalDiameter", index)]; |
553 | 534 |
if (attribute != null) |
554 |
attribute.set_Value(DBNull.Value);
|
|
535 |
attribute.Value = DBNull.Value;
|
|
555 | 536 |
else |
556 | 537 |
break; |
557 | 538 |
index++; |
... | ... | |
568 | 549 |
{ |
569 | 550 |
foreach (LMConnector connector in symbol.Connect1Connectors) |
570 | 551 |
{ |
571 |
if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
|
|
552 |
if (connector.ItemStatus.ToString() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
|
|
572 | 553 |
{ |
573 |
endClearModelItemID.Add(connector.ModelItemID); |
|
554 |
endClearModelItemID.Add(connector.ModelItemID.ToString());
|
|
574 | 555 |
LMModelItem modelItem = connector.ModelItemObject; |
575 | 556 |
if (modelItem != null) |
576 | 557 |
{ |
577 | 558 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
578 | 559 |
if (attribute != null) |
579 |
attribute.set_Value(DBNull.Value);
|
|
560 |
attribute.Value = DBNull.Value;
|
|
580 | 561 |
|
581 | 562 |
modelItem.Commit(); |
582 | 563 |
ReleaseCOMObjects(modelItem); |
... | ... | |
586 | 567 |
} |
587 | 568 |
foreach (LMConnector connector in symbol.Connect2Connectors) |
588 | 569 |
{ |
589 |
if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
|
|
570 |
if (connector.ItemStatus.ToString() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID))
|
|
590 | 571 |
{ |
591 |
endClearModelItemID.Add(connector.ModelItemID); |
|
572 |
endClearModelItemID.Add(connector.ModelItemID.ToString());
|
|
592 | 573 |
LMModelItem modelItem = connector.ModelItemObject; |
593 | 574 |
if (modelItem != null) |
594 | 575 |
{ |
595 | 576 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
596 | 577 |
if (attribute != null) |
597 |
attribute.set_Value(DBNull.Value);
|
|
578 |
attribute.Value = DBNull.Value;
|
|
598 | 579 |
|
599 | 580 |
modelItem.Commit(); |
600 | 581 |
ReleaseCOMObjects(modelItem); |
... | ... | |
621 | 602 |
filter.ItemType = "Relationship"; |
622 | 603 |
criterion.SourceAttributeName = "SP_DRAWINGID"; |
623 | 604 |
criterion.Operator = "="; |
624 |
criterion.set_ValueAttribute(drawingID);
|
|
625 |
filter.get_Criteria().Add(criterion);
|
|
605 |
criterion.ValueAttribute = drawingID;
|
|
606 |
filter.Criteria.Add(criterion);
|
|
626 | 607 |
|
627 | 608 |
LMRelationships relationships = new LMRelationships(); |
628 | 609 |
relationships.Collect(dataSource, Filter: filter); |
... | ... | |
635 | 616 |
{ |
636 | 617 |
foreach (LMInconsistency inconsistency in relationship.Inconsistencies) |
637 | 618 |
{ |
638 |
if (inconsistency.get_InconsistencyTypeIndex() == 1)
|
|
619 |
if (inconsistency.InconsistencyTypeIndex == 1)
|
|
639 | 620 |
{ |
640 | 621 |
LMModelItem modelItem1 = relationship.Item1RepresentationObject == null ? null : relationship.Item1RepresentationObject.ModelItemObject; |
641 | 622 |
LMModelItem modelItem2 = relationship.Item2RepresentationObject == null ? null : relationship.Item2RepresentationObject.ModelItemObject; |
642 |
string[] array = inconsistency.get_Name().ToString().Split(new char[] { '=' });
|
|
623 |
string[] array = inconsistency.Name.ToString().Split(new char[] { '=' });
|
|
643 | 624 |
if (modelItem1 != null) |
644 | 625 |
{ |
645 | 626 |
string attrName = array[0]; |
646 | 627 |
if (attrName.Contains("PipingPoint")) |
647 | 628 |
{ |
648 | 629 |
string originalAttr = attrName.Split(new char[] { '.' })[1]; |
649 |
int index = Convert.ToInt32(relationship.get_Item1Location());
|
|
630 |
int index = Convert.ToInt32(relationship.Item1Location);
|
|
650 | 631 |
LMAAttribute attribute1 = modelItem1.Attributes["PipingPoint" + index + "." + originalAttr]; |
651 |
if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value()))
|
|
632 |
if (attribute1 != null && !DBNull.Value.Equals(attribute1.Value))
|
|
652 | 633 |
{ |
653 | 634 |
loop = true; |
654 |
attribute1.set_Value(DBNull.Value);
|
|
635 |
attribute1.Value = DBNull.Value;
|
|
655 | 636 |
} |
656 | 637 |
attribute1 = null; |
657 | 638 |
} |
658 | 639 |
else |
659 | 640 |
{ |
660 | 641 |
LMAAttribute attribute1 = modelItem1.Attributes[attrName]; |
661 |
if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value()))
|
|
642 |
if (attribute1 != null && !DBNull.Value.Equals(attribute1.Value))
|
|
662 | 643 |
{ |
663 | 644 |
loop = true; |
664 |
attribute1.set_Value(DBNull.Value);
|
|
645 |
attribute1.Value = DBNull.Value;
|
|
665 | 646 |
} |
666 | 647 |
attribute1 = null; |
667 | 648 |
} |
... | ... | |
673 | 654 |
if (attrName.Contains("PipingPoint")) |
674 | 655 |
{ |
675 | 656 |
string originalAttr = attrName.Split(new char[] { '.' })[1]; |
676 |
int index = Convert.ToInt32(relationship.get_Item2Location());
|
|
657 |
int index = Convert.ToInt32(relationship.Item2Location);
|
|
677 | 658 |
LMAAttribute attribute2 = modelItem2.Attributes["PipingPoint" + index + "." + originalAttr]; |
678 |
if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value()))
|
|
659 |
if (attribute2 != null && !DBNull.Value.Equals(attribute2.Value))
|
|
679 | 660 |
{ |
680 |
attribute2.set_Value(DBNull.Value);
|
|
661 |
attribute2.Value = DBNull.Value;
|
|
681 | 662 |
loop = true; |
682 | 663 |
} |
683 | 664 |
attribute2 = null; |
... | ... | |
685 | 666 |
else |
686 | 667 |
{ |
687 | 668 |
LMAAttribute attribute2 = modelItem2.Attributes[attrName]; |
688 |
if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value()))
|
|
669 |
if (attribute2 != null && !DBNull.Value.Equals(attribute2.Value))
|
|
689 | 670 |
{ |
690 |
attribute2.set_Value(DBNull.Value);
|
|
671 |
attribute2.Value = DBNull.Value;
|
|
691 | 672 |
loop = true; |
692 | 673 |
} |
693 | 674 |
attribute2 = null; |
... | ... | |
823 | 804 |
foreach (var item in document.LINENUMBERS) |
824 | 805 |
{ |
825 | 806 |
LMLabelPersist label = dataSource.GetLabelPersist(item.SPPID.RepresentationId); |
826 |
if (label == null || (label != null && label.get_ItemStatus() != "Active"))
|
|
807 |
if (label == null || (label != null && label.ItemStatus.ToString() != "Active"))
|
|
827 | 808 |
{ |
828 | 809 |
ReleaseCOMObjects(label); |
829 | 810 |
item.SPPID.RepresentationId = null; |
... | ... | |
1061 | 1042 |
LMLabelPersist label = dataSource.GetLabelPersist(item); |
1062 | 1043 |
if (label != null) |
1063 | 1044 |
{ |
1064 |
label.get_GraphicOID(); |
|
1065 |
DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[label.get_GraphicOID().ToString()] as DependencyObject; |
|
1045 |
Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[label.GraphicOID.ToString()] as Ingr.RAD2D.Components.SmartLabel.SmartLabel; |
|
1066 | 1046 |
if (dependency != null) |
1067 | 1047 |
dependency.BringToFront(); |
1068 | 1048 |
} |
... | ... | |
1094 | 1074 |
Log.Write("Drawing name : " + drawingName); |
1095 | 1075 |
Log.Write("Drawing number : " + drawingNumber); |
1096 | 1076 |
Thread.Sleep(1000); |
1097 |
newDrawing = application.Drawings.Add(document.Unit, document.Template, drawingNumber, drawingName); |
|
1077 |
|
|
1078 |
string drawingTemplate = document.Template; |
|
1079 |
newDrawing = pidApp.Drawings.Add(document.Unit, ref drawingTemplate, drawingNumber, ref drawingName); |
|
1080 |
|
|
1098 | 1081 |
if (newDrawing != null) |
1099 | 1082 |
{ |
1100 | 1083 |
document.SPPID_DrawingNumber = drawingNumber; |
1101 | 1084 |
document.SPPID_DrawingName = drawingName; |
1102 | 1085 |
Thread.Sleep(1000); |
1103 |
radApp.ActiveWindow.Fit(); |
|
1086 |
// TODO : ZOOM FIT |
|
1087 |
//radApp.ActiveWindow.Fit(); |
|
1104 | 1088 |
Thread.Sleep(1000); |
1105 |
radApp.ActiveWindow.Zoom = 2000; |
|
1089 |
// TODO : ZOOM FIT |
|
1090 |
//radApp.ActiveWindow.Zoom = 2000; |
|
1106 | 1091 |
Thread.Sleep(2000); |
1107 | 1092 |
|
1108 | 1093 |
//current LMDrawing 가져오기 |
... | ... | |
1111 | 1096 |
filter.ItemType = "Drawing"; |
1112 | 1097 |
criterion.SourceAttributeName = "Name"; |
1113 | 1098 |
criterion.Operator = "="; |
1114 |
criterion.set_ValueAttribute(drawingName);
|
|
1115 |
filter.get_Criteria().Add(criterion);
|
|
1099 |
criterion.ValueAttribute = drawingName;
|
|
1100 |
filter.Criteria.Add(criterion);
|
|
1116 | 1101 |
|
1117 | 1102 |
LMDrawings drawings = new LMDrawings(); |
1118 | 1103 |
drawings.Collect(dataSource, Filter: filter); |
1119 | 1104 |
|
1120 | 1105 |
// Input Drawing Attribute |
1121 |
LMDrawing drawing = ((dynamic)drawings).Nth(1);
|
|
1106 |
LMDrawing drawing = drawings.Nth(1);
|
|
1122 | 1107 |
if (drawing != null) |
1123 | 1108 |
{ |
1124 | 1109 |
using (DataTable drawingAttributeDT = Project_DB.SelectDrawingProjectAttribute()) |
... | ... | |
1136 | 1121 |
string value = text.VALUE; |
1137 | 1122 |
LMAAttribute attribute = drawing.Attributes[mappingName]; |
1138 | 1123 |
if (attribute != null) |
1139 |
attribute.set_Value(value);
|
|
1124 |
attribute.Value = value;
|
|
1140 | 1125 |
ReleaseCOMObjects(attribute); |
1141 | 1126 |
document.TEXTINFOS.Remove(text); |
1142 | 1127 |
} |
... | ... | |
1202 | 1187 |
|
1203 | 1188 |
foreach (LMDrawing item in drawings) |
1204 | 1189 |
{ |
1205 |
drawingNameList.Add(item.Attributes["Name"].get_Value().ToString());
|
|
1206 |
drawingNumberList.Add(item.Attributes["DrawingNumber"].get_Value().ToString());
|
|
1190 |
drawingNameList.Add(item.Attributes["Name"].Value.ToString());
|
|
1191 |
drawingNumberList.Add(item.Attributes["DrawingNumber"].Value.ToString());
|
|
1207 | 1192 |
} |
1208 | 1193 |
|
1209 | 1194 |
int nameLength = drawingName.Length; |
... | ... | |
1318 | 1303 |
GetTargetSymbolConnectorPoint(connector, targetSymbol, ref x, ref y); |
1319 | 1304 |
|
1320 | 1305 |
LMConnector temp = LineModelingForSymbolZeroLength(symbol, _TargetItem, x, y); |
1321 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: _TargetItem);
|
|
1306 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, null, TargetItem: _TargetItem.AsLMRepresentation());
|
|
1322 | 1307 |
if (temp != null) |
1323 | 1308 |
_placement.PIDRemovePlacement(temp.AsLMRepresentation()); |
1324 | 1309 |
ReleaseCOMObjects(temp); |
... | ... | |
1340 | 1325 |
List<string> ids = new List<string>(); |
1341 | 1326 |
foreach (LMConnector item in _LMSymbol.Connect1Connectors) |
1342 | 1327 |
{ |
1343 |
if (item.get_ItemStatus() == "Active" && !ids.Contains(item.Id))
|
|
1328 |
if (item.ItemStatus.ToString() == "Active" && !ids.Contains(item.Id))
|
|
1344 | 1329 |
ids.Add(item.Id); |
1345 | 1330 |
ReleaseCOMObjects(item); |
1346 | 1331 |
} |
1347 | 1332 |
foreach (LMConnector item in _LMSymbol.Connect2Connectors) |
1348 | 1333 |
{ |
1349 |
if (item.get_ItemStatus() == "Active" && !ids.Contains(item.Id))
|
|
1334 |
if (item.ItemStatus.ToString() == "Active" && !ids.Contains(item.Id))
|
|
1350 | 1335 |
ids.Add(item.Id); |
1351 | 1336 |
ReleaseCOMObjects(item); |
1352 | 1337 |
} |
... | ... | |
1354 | 1339 |
int createdSymbolCount = document.SYMBOLS.FindAll(i => i.CONNECTORS.Find(j => j.CONNECTEDITEM == symbol.UID) != null && !string.IsNullOrEmpty(i.SPPID.RepresentationId)).Count; |
1355 | 1340 |
if (targetSymbol == null && ids.Count != createdSymbolCount) |
1356 | 1341 |
{ |
1357 |
double currentX = _LMSymbol.get_XCoordinate();
|
|
1358 |
double currentY = _LMSymbol.get_YCoordinate();
|
|
1342 |
double currentX = Convert.ToDouble(_LMSymbol.XCoordinate);
|
|
1343 |
double currentY = Convert.ToDouble(_LMSymbol.YCoordinate);
|
|
1359 | 1344 |
|
1360 | 1345 |
|
1361 | 1346 |
} |
1362 | 1347 |
|
1363 | 1348 |
symbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
1364 |
symbol.SPPID.ModelItemID = _LMSymbol.ModelItemID; |
|
1365 |
symbol.SPPID.GraphicOID = _LMSymbol.get_GraphicOID().ToString();
|
|
1349 |
symbol.SPPID.ModelItemID = _LMSymbol.ModelItemID.ToString();
|
|
1350 |
symbol.SPPID.GraphicOID = _LMSymbol.GraphicOID.ToString();
|
|
1366 | 1351 |
|
1367 | 1352 |
foreach (var item in symbol.ChildSymbols) |
1368 | 1353 |
CreateChildSymbol(item, _LMSymbol, symbol); |
1369 | 1354 |
|
1370 |
symbol.SPPID.SPPID_X = _LMSymbol.get_XCoordinate();
|
|
1371 |
symbol.SPPID.SPPID_Y = _LMSymbol.get_YCoordinate();
|
|
1355 |
symbol.SPPID.SPPID_X = Convert.ToDouble(_LMSymbol.XCoordinate);
|
|
1356 |
symbol.SPPID.SPPID_Y = Convert.ToDouble(_LMSymbol.YCoordinate);
|
|
1372 | 1357 |
|
1373 | 1358 |
double[] range = null; |
1374 | 1359 |
GetSPPIDSymbolRange(symbol, ref range); |
... | ... | |
1431 | 1416 |
} |
1432 | 1417 |
} |
1433 | 1418 |
|
1434 |
_LMAItem _LMAItem = _placement.PIDCreateItem(sppidLine);
|
|
1419 |
LMAItem _LMAItem = _placement.PIDCreateItem(sppidLine); |
|
1435 | 1420 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
1436 | 1421 |
placeRunInputs.AddPoint(-1, -1); |
1437 | 1422 |
placeRunInputs.AddSymbolTarget(_TargetItem, lineX, lineY); |
... | ... | |
1458 | 1443 |
{ |
1459 | 1444 |
LMModelItem modelItem = symbol.ModelItemObject; |
1460 | 1445 |
LMPipingPoints pipingPoints = null; |
1461 |
if (modelItem.get_ItemTypeName() == "PipingComp")
|
|
1446 |
if (modelItem.ItemTypeName.ToString() == "PipingComp")
|
|
1462 | 1447 |
{ |
1463 | 1448 |
LMPipingComp pipingComp = dataSource.GetPipingComp(modelItem.Id); |
1464 | 1449 |
pipingPoints = pipingComp.PipingPoints; |
1465 | 1450 |
ReleaseCOMObjects(pipingComp); |
1466 | 1451 |
pipingComp = null; |
1467 | 1452 |
} |
1468 |
else if (modelItem.get_ItemTypeName() == "Instrument")
|
|
1453 |
else if (modelItem.ItemTypeName.ToString() == "Instrument")
|
|
1469 | 1454 |
{ |
1470 | 1455 |
LMInstrument instrument = dataSource.GetInstrument(modelItem.Id); |
1471 | 1456 |
pipingPoints = instrument.PipingPoints; |
... | ... | |
1484 | 1469 |
{ |
1485 | 1470 |
if (attribute.Name == "PipingPointNumber") |
1486 | 1471 |
{ |
1487 |
int index = Convert.ToInt32(attribute.get_Value());
|
|
1472 |
int index = Convert.ToInt32(attribute.Value);
|
|
1488 | 1473 |
if (info.Find(loopX => loopX[0] == index) == null) |
1489 | 1474 |
{ |
1490 | 1475 |
double x = 0; |
... | ... | |
1593 | 1578 |
double SPPIDgapX = gapX * percentX; |
1594 | 1579 |
double SPPIDgapY = gapY * percentY; |
1595 | 1580 |
|
1596 |
double[] SPPIDOriginPoint = new double[] { _TargetItem.get_XCoordinate() - SPPIDgapX, _TargetItem.get_YCoordinate() + SPPIDgapY };
|
|
1581 |
double[] SPPIDOriginPoint = new double[] { Convert.ToDouble(_TargetItem.XCoordinate) - SPPIDgapX, Convert.ToDouble(_TargetItem.YCoordinate) + SPPIDgapY };
|
|
1597 | 1582 |
double distance = double.MaxValue; |
1598 | 1583 |
double[] resultPoint; |
1599 | 1584 |
foreach (var point in points) |
... | ... | |
1634 | 1619 |
private void GetSPPIDSymbolRangeAndConnectionPoints(Symbol symbol, ref double[] range, List<double[]> points) |
1635 | 1620 |
{ |
1636 | 1621 |
LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
1637 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()];
|
|
1622 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
1638 | 1623 |
double x1 = 0; |
1639 | 1624 |
double y1 = 0; |
1640 | 1625 |
double x2 = 0; |
... | ... | |
1661 | 1646 |
LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
1662 | 1647 |
if (_TargetItem != null) |
1663 | 1648 |
{ |
1664 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()];
|
|
1649 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
1665 | 1650 |
double x1 = 0; |
1666 | 1651 |
double y1 = 0; |
1667 | 1652 |
double x2 = 0; |
... | ... | |
1759 | 1744 |
double y2 = double.MinValue; |
1760 | 1745 |
range = new double[] { x1, y1, x2, y2 }; |
1761 | 1746 |
|
1762 |
Ingr.RAD2D.DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[labelPersist.get_GraphicOID().ToString()] as DependencyObject;
|
|
1747 |
Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[labelPersist.GraphicOID.ToString()] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
|
|
1763 | 1748 |
foreach (var item in dependency.DrawingObjects) |
1764 | 1749 |
{ |
1765 | 1750 |
Ingr.RAD2D.TextBox textBox = item as Ingr.RAD2D.TextBox; |
... | ... | |
1815 | 1800 |
LMSymbol _ChildSymbol = dataSource.GetSymbol(childSymbol.SPPID.RepresentationId); |
1816 | 1801 |
if (_ChildSymbol != null) |
1817 | 1802 |
{ |
1818 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.get_GraphicOID().ToString()];
|
|
1803 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
1819 | 1804 |
double x1 = 0; |
1820 | 1805 |
double y1 = 0; |
1821 | 1806 |
double x2 = 0; |
... | ... | |
1848 | 1833 |
LMSymbol _ChildSymbol = dataSource.GetSymbol(childSymbol.SPPID.RepresentationId); |
1849 | 1834 |
if (_ChildSymbol != null) |
1850 | 1835 |
{ |
1851 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.get_GraphicOID().ToString()];
|
|
1836 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
1852 | 1837 |
double x1 = 0; |
1853 | 1838 |
double y1 = 0; |
1854 | 1839 |
double x2 = 0; |
... | ... | |
1876 | 1861 |
BaseModel.Attribute itemAttribute = symbol.ATTRIBUTES.Find(x => x.ATTRIBUTE == "OWNERSYMBOL"); |
1877 | 1862 |
if (itemAttribute == null || string.IsNullOrEmpty(itemAttribute.VALUE) || itemAttribute.VALUE == "None") |
1878 | 1863 |
return; |
1879 |
Array points = new double[] { 0, symbol.SPPID.ORIGINAL_X, symbol.SPPID.ORIGINAL_Y };
|
|
1864 |
double[] points = new double[] { 0, symbol.SPPID.ORIGINAL_X, symbol.SPPID.ORIGINAL_Y };
|
|
1880 | 1865 |
|
1881 | 1866 |
string symbolUID = itemAttribute.VALUE; |
1882 | 1867 |
object targetItem = SPPIDUtil.FindObjectByUID(document, symbolUID); |
... | ... | |
1900 | 1885 |
|
1901 | 1886 |
// Target Symbol Item 가져오고 Label Modeling |
1902 | 1887 |
LMSymbol _TargetItem = dataSource.GetSymbol(sRep); |
1903 |
LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, ref points, Rotation: symbol.ANGLE, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: leaderLine);
|
|
1888 |
LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, points, null, Rotation: symbol.ANGLE, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: leaderLine);
|
|
1904 | 1889 |
|
1905 | 1890 |
//Leader 선 센터로 |
1906 | 1891 |
if (_LMLabelPresist != null) |
... | ... | |
1908 | 1893 |
// Target Item에 Label의 Attribute Input |
1909 | 1894 |
InputSymbolAttribute(targetItem, symbol.ATTRIBUTES); |
1910 | 1895 |
|
1911 |
string OID = _LMLabelPresist.get_GraphicOID().ToString();
|
|
1912 |
DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as DependencyObject;
|
|
1896 |
string OID = _LMLabelPresist.GraphicOID.ToString();
|
|
1897 |
Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
|
|
1913 | 1898 |
if (dependency != null) |
1914 | 1899 |
{ |
1915 | 1900 |
bool result = false; |
... | ... | |
1926 | 1911 |
if (drawingObject.Type == Ingr.RAD2D.ObjectType.igLineString2d) |
1927 | 1912 |
{ |
1928 | 1913 |
Ingr.RAD2D.LineString2d lineString2D = drawingObject as Ingr.RAD2D.LineString2d; |
1929 |
double prevX = _TargetItem.get_XCoordinate();
|
|
1930 |
double prevY = _TargetItem.get_YCoordinate();
|
|
1914 |
double prevX = Convert.ToDouble(_TargetItem.XCoordinate);
|
|
1915 |
double prevY = Convert.ToDouble(_TargetItem.YCoordinate);
|
|
1931 | 1916 |
lineString2D.InsertVertex(lineString2D.VertexCount, prevX, prevY); |
1932 | 1917 |
lineString2D.RemoveVertex(lineString2D.VertexCount); |
1933 | 1918 |
result = true; |
... | ... | |
1969 | 1954 |
if (symbolMapping != null) |
1970 | 1955 |
leaderLine = symbolMapping.LEADERLINE; |
1971 | 1956 |
|
1972 |
LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, ref points, Rotation: symbol.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
|
|
1957 |
LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(symbol.SPPID.MAPPINGNAME, points, null, Rotation: symbol.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
|
|
1973 | 1958 |
if (_LMLabelPresist != null) |
1974 | 1959 |
{ |
1975 | 1960 |
symbol.SPPID.RepresentationId = _LMLabelPresist.AsLMRepresentation().Id; |
... | ... | |
2031 | 2016 |
{ |
2032 | 2017 |
targetItem = dataSource.GetSymbol(connEquipment.SPPID.RepresentationId); |
2033 | 2018 |
if (targetItem != null) |
2034 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: targetItem);
|
|
2019 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, null, TargetItem: targetItem.AsLMRepresentation());
|
|
2035 | 2020 |
else |
2036 | 2021 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle); |
2037 | 2022 |
} |
... | ... | |
2046 | 2031 |
{ |
2047 | 2032 |
targetItem = dataSource.GetSymbol(connVendorPackage.SPPID.RepresentationId); |
2048 | 2033 |
if (targetItem != null) |
2049 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: targetItem);
|
|
2034 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, null, TargetItem: targetItem.AsLMRepresentation());
|
|
2050 | 2035 |
else |
2051 | 2036 |
_LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle); |
2052 | 2037 |
} |
... | ... | |
2065 | 2050 |
{ |
2066 | 2051 |
_LMSymbol.Commit(); |
2067 | 2052 |
equipment.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
2068 |
equipment.SPPID.GraphicOID = _LMSymbol.get_GraphicOID().ToString();
|
|
2053 |
equipment.SPPID.GraphicOID = _LMSymbol.GraphicOID.ToString();
|
|
2069 | 2054 |
ReleaseCOMObjects(_LMSymbol); |
2070 | 2055 |
} |
2071 | 2056 |
|
... | ... | |
2330 | 2315 |
/// <param name="parentSymbol"></param> |
2331 | 2316 |
private void CreateChildSymbol(ChildSymbol childSymbol, LMSymbol parentSymbol, Symbol parent) |
2332 | 2317 |
{ |
2333 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[parentSymbol.get_GraphicOID().ToString()];
|
|
2318 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[parentSymbol.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
2334 | 2319 |
double x1 = 0; |
2335 | 2320 |
double x2 = 0; |
2336 | 2321 |
double y1 = 0; |
2337 | 2322 |
double y2 = 0; |
2338 | 2323 |
symbol2d.Range(out x1, out y1, out x2, out y2); |
2339 | 2324 |
|
2340 |
LMSymbol _LMSymbol = _placement.PIDPlaceSymbol(childSymbol.SPPID.MAPPINGNAME, (x1 + x2) / 2, (y1 + y2) / 2, TargetItem: parentSymbol);
|
|
2325 |
LMSymbol _LMSymbol = _placement.PIDPlaceSymbol(childSymbol.SPPID.MAPPINGNAME, (x1 + x2) / 2, (y1 + y2) / 2, null, null, null, TargetItem: parentSymbol.AsLMRepresentation());
|
|
2341 | 2326 |
if (_LMSymbol != null) |
2342 | 2327 |
{ |
2343 | 2328 |
_LMSymbol.Commit(); |
... | ... | |
2370 | 2355 |
bool diagonal = false; |
2371 | 2356 |
if (groupLine.SlopeType != SlopeType.HORIZONTAL && groupLine.SlopeType != SlopeType.VERTICAL) |
2372 | 2357 |
diagonal = true; |
2373 |
_LMAItem _LMAItem = _placement.PIDCreateItem(groupLine.SPPID.MAPPINGNAME);
|
|
2358 |
LMAItem _LMAItem = _placement.PIDCreateItem(groupLine.SPPID.MAPPINGNAME); |
|
2374 | 2359 |
LMSymbol _LMSymbolStart = null; |
2375 | 2360 |
LMSymbol _LMSymbolEnd = null; |
2376 | 2361 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
... | ... | |
2466 | 2451 |
if (_lMConnector != null) |
2467 | 2452 |
{ |
2468 | 2453 |
_lMConnector.Commit(); |
2469 |
groupLine.SPPID.ModelItemId = _lMConnector.ModelItemID; |
|
2454 |
groupLine.SPPID.ModelItemId = _lMConnector.ModelItemID.ToString();
|
|
2470 | 2455 |
|
2471 | 2456 |
bool bRemodelingStart = false; |
2472 | 2457 |
if (_LMSymbolStart != null) |
... | ... | |
2487 | 2472 |
{ |
2488 | 2473 |
LMAAttribute attribute = modelItem.Attributes["FlowDirection"]; |
2489 | 2474 |
if (attribute != null) |
2490 |
attribute.set_Value("End 1 is upstream (Inlet)");
|
|
2475 |
attribute.Value = "End 1 is upstream (Inlet)";
|
|
2491 | 2476 |
modelItem.Commit(); |
2492 | 2477 |
} |
2493 | 2478 |
ReleaseCOMObjects(modelItem); |
... | ... | |
2527 | 2512 |
bool diagonal = false; |
2528 | 2513 |
if (line.SlopeType != SlopeType.HORIZONTAL && line.SlopeType != SlopeType.VERTICAL) |
2529 | 2514 |
diagonal = true; |
2530 |
_LMAItem _LMAItem = _placement.PIDCreateItem(line.SPPID.MAPPINGNAME);
|
|
2515 |
LMAItem _LMAItem = _placement.PIDCreateItem(line.SPPID.MAPPINGNAME); |
|
2531 | 2516 |
LMSymbol _LMSymbolStart = null; |
2532 | 2517 |
LMSymbol _LMSymbolEnd = null; |
2533 | 2518 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
... | ... | |
2606 | 2591 |
{ |
2607 | 2592 |
foreach (LMRepresentation rep in modelItem.Representations) |
2608 | 2593 |
{ |
2609 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
2594 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
2610 | 2595 |
{ |
2611 | 2596 |
LMConnector _LMConnector = dataSource.GetConnector(rep.Id); |
2612 |
dynamic OID = rep.get_GraphicOID().ToString();
|
|
2613 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
2597 |
dynamic OID = rep.GraphicOID.ToString();
|
|
2598 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
2614 | 2599 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
2615 | 2600 |
int verticesCount = lineStringGeometry.VertexCount; |
2616 | 2601 |
double[] vertices = null; |
... | ... | |
2638 | 2623 |
{ |
2639 | 2624 |
foreach (LMRepresentation rep in modelItem.Representations) |
2640 | 2625 |
{ |
2641 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
2626 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
2642 | 2627 |
_placement.PIDRemovePlacement(rep); |
2643 | 2628 |
} |
2644 | 2629 |
ReleaseCOMObjects(modelItem); |
... | ... | |
2865 | 2850 |
bool diagonal = false; |
2866 | 2851 |
if (line.SlopeType != SlopeType.HORIZONTAL && line.SlopeType != SlopeType.VERTICAL) |
2867 | 2852 |
diagonal = true; |
2868 |
_LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
|
|
2853 |
LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath); |
|
2869 | 2854 |
LMConnector newConnector = null; |
2870 |
dynamic OID = prevLMConnector.get_GraphicOID().ToString();
|
|
2871 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
2855 |
dynamic OID = prevLMConnector.GraphicOID.ToString();
|
|
2856 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
2872 | 2857 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
2873 | 2858 |
int verticesCount = lineStringGeometry.VertexCount; |
2874 | 2859 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
... | ... | |
2956 | 2941 |
{ |
2957 | 2942 |
_LMConnector.Commit(); |
2958 | 2943 |
RemoveConnectorForReModelingLine(newConnector); |
2959 |
ZeroLengthModelItemID.Add(_LMConnector.ModelItemID); |
|
2944 |
ZeroLengthModelItemID.Add(_LMConnector.ModelItemID.ToString());
|
|
2960 | 2945 |
ReleaseCOMObjects(_LMConnector); |
2961 | 2946 |
} |
2962 | 2947 |
ReleaseCOMObjects(placeRunInputs); |
... | ... | |
2967 | 2952 |
{ |
2968 | 2953 |
if (startSymbol != null) |
2969 | 2954 |
{ |
2970 |
Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(newConnector.ModelItemID); |
|
2955 |
Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(newConnector.ModelItemID.ToString());
|
|
2971 | 2956 |
newConnector = dicVertices.First().Key; |
2972 | 2957 |
} |
2973 | 2958 |
|
... | ... | |
2980 | 2965 |
{ |
2981 | 2966 |
_LMConnector.Commit(); |
2982 | 2967 |
RemoveConnectorForReModelingLine(newConnector); |
2983 |
ZeroLengthModelItemIDReverse.Add(_LMConnector.ModelItemID); |
|
2968 |
ZeroLengthModelItemIDReverse.Add(_LMConnector.ModelItemID.ToString());
|
|
2984 | 2969 |
ReleaseCOMObjects(_LMConnector); |
2985 | 2970 |
} |
2986 | 2971 |
ReleaseCOMObjects(placeRunInputs); |
2987 | 2972 |
ReleaseCOMObjects(_LMAItem); |
2988 | 2973 |
} |
2989 | 2974 |
|
2990 |
line.SPPID.ModelItemId = newConnector.ModelItemID; |
|
2975 |
line.SPPID.ModelItemId = newConnector.ModelItemID.ToString();
|
|
2991 | 2976 |
ReleaseCOMObjects(newConnector); |
2992 | 2977 |
} |
2993 | 2978 |
|
... | ... | |
3000 | 2985 |
/// <param name="connector"></param> |
3001 | 2986 |
private void RemoveConnectorForReModelingLine(LMConnector connector) |
3002 | 2987 |
{ |
3003 |
Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(connector.ModelItemID); |
|
2988 |
Dictionary<LMConnector, List<double[]>> dicVertices = GetPipeRunVertices(connector.ModelItemID.ToString());
|
|
3004 | 2989 |
foreach (var item in dicVertices) |
3005 | 2990 |
{ |
3006 | 2991 |
if (item.Value.Count == 2) |
... | ... | |
3106 | 3091 |
|
3107 | 3092 |
SegmentLocation location; |
3108 | 3093 |
double[] point = GetSegmentPoint(ownerObj, connectedItem, targetLMConnector, out location); |
3109 |
Array array = null;
|
|
3094 |
double[] array = null;
|
|
3110 | 3095 |
if (point != null) |
3111 | 3096 |
array = new double[] { 0, point[0], point[1] }; |
3112 | 3097 |
else |
3113 | 3098 |
array = new double[] { 0, endBreak.SPPID.ORIGINAL_X, endBreak.SPPID.ORIGINAL_Y }; |
3114 |
LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
|
|
3099 |
LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, array, null, null, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: leaderLine);
|
|
3115 | 3100 |
if (_LmLabelPersist != null) |
3116 | 3101 |
{ |
3117 | 3102 |
_LmLabelPersist.Commit(); |
3118 | 3103 |
endBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id; |
3119 | 3104 |
if (_LmLabelPersist.ModelItemObject != null) |
3120 |
endBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID; |
|
3121 |
endBreak.SPPID.GraphicOID = _LmLabelPersist.get_GraphicOID().ToString();
|
|
3105 |
endBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID.ToString();
|
|
3106 |
endBreak.SPPID.GraphicOID = _LmLabelPersist.GraphicOID.ToString();
|
|
3122 | 3107 |
|
3123 |
MoveDependencyObject(endBreak.SPPID.GraphicOID, location);
|
|
3108 |
MoveSmartLabelObject(endBreak.SPPID.GraphicOID, location);
|
|
3124 | 3109 |
|
3125 | 3110 |
ReleaseCOMObjects(_LmLabelPersist); |
3126 | 3111 |
} |
... | ... | |
3133 | 3118 |
} |
3134 | 3119 |
} |
3135 | 3120 |
|
3136 |
private void MoveDependencyObject(string graphicOID, SegmentLocation location)
|
|
3121 |
private void MoveSmartLabelObject(string graphicOID, SegmentLocation location)
|
|
3137 | 3122 |
{ |
3138 | 3123 |
double x = 0, y = 0; |
3139 | 3124 |
if (location.HasFlag(SegmentLocation.Up)) |
... | ... | |
3149 | 3134 |
if (x != 0 || y != 0) |
3150 | 3135 |
{ |
3151 | 3136 |
radApp.ActiveSelectSet.RemoveAll(); |
3152 |
DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID] as DependencyObject;
|
|
3137 |
Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
|
|
3153 | 3138 |
if (dependency != null) |
3154 | 3139 |
{ |
3155 | 3140 |
radApp.ActiveSelectSet.Add(dependency); |
... | ... | |
3177 | 3162 |
#endregion |
3178 | 3163 |
|
3179 | 3164 |
LMConnector newConnector = null; |
3180 |
dynamic OID = connector.get_GraphicOID().ToString();
|
|
3181 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
3165 |
dynamic OID = connector.GraphicOID.ToString();
|
|
3166 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
3182 | 3167 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
3183 | 3168 |
int verticesCount = lineStringGeometry.VertexCount; |
3184 | 3169 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
3185 |
_LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3170 |
LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath); |
|
3186 | 3171 |
|
3187 |
if (Convert.ToBoolean(connector.get_IsZeroLength()))
|
|
3172 |
if (Convert.ToBoolean(connector.IsZeroLength))
|
|
3188 | 3173 |
{ |
3189 | 3174 |
double[] vertices = null; |
3190 | 3175 |
lineStringGeometry.GetVertices(ref verticesCount, ref vertices); |
... | ... | |
3194 | 3179 |
|
3195 | 3180 |
string flowDirection = string.Empty; |
3196 | 3181 |
LMAAttribute flowAttribute = connector.ModelItemObject.Attributes["FlowDirection"]; |
3197 |
if (flowAttribute != null && !DBNull.Value.Equals(flowAttribute.get_Value()))
|
|
3198 |
flowDirection = flowAttribute.get_Value().ToString();
|
|
3182 |
if (flowAttribute != null && !DBNull.Value.Equals(flowAttribute.Value))
|
|
3183 |
flowDirection = flowAttribute.Value.ToString();
|
|
3199 | 3184 |
|
3200 | 3185 |
if (flowDirection == "End 1 is downstream (Outlet)") |
3201 | 3186 |
{ |
... | ... | |
3208 | 3193 |
placeRunInputs.AddSymbolTarget(connector.ConnectItem1SymbolObject, x, y); |
3209 | 3194 |
placeRunInputs.AddSymbolTarget(connector.ConnectItem2SymbolObject, x, y); |
3210 | 3195 |
} |
3211 |
string oldModelItemId = connector.ModelItemID; |
|
3196 |
string oldModelItemId = connector.ModelItemID.ToString();
|
|
3212 | 3197 |
_placement.PIDRemovePlacement(connector.AsLMRepresentation()); |
3213 | 3198 |
newConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs); |
3214 | 3199 |
newConnector.Commit(); |
3215 |
ZeroLengthSymbolToSymbolModelItemID.Add(newConnector.ModelItemID); |
|
3200 |
ZeroLengthSymbolToSymbolModelItemID.Add(newConnector.ModelItemID.ToString());
|
|
3216 | 3201 |
if (!string.IsNullOrEmpty(flowDirection)) |
3217 |
newConnector.ModelItemObject.Attributes["FlowDirection"].set_Value(flowDirection);
|
|
3202 |
newConnector.ModelItemObject.Attributes["FlowDirection"].Value = flowDirection;
|
|
3218 | 3203 |
ReleaseCOMObjects(connector); |
3219 | 3204 |
|
3220 | 3205 |
foreach (var line in document.LINES.FindAll(z => z.SPPID.ModelItemId == oldModelItemId)) |
... | ... | |
3222 | 3207 |
foreach (var repId in line.SPPID.Representations) |
3223 | 3208 |
{ |
3224 | 3209 |
LMConnector _connector = dataSource.GetConnector(repId); |
3225 |
if (_connector != null && _connector.get_ItemStatus() == "Active")
|
|
3210 |
if (_connector != null && _connector.ItemStatus.ToString() == "Active")
|
|
3226 | 3211 |
{ |
3227 |
if (line.SPPID.ModelItemId != _connector.ModelItemID) |
|
3212 |
if (line.SPPID.ModelItemId != _connector.ModelItemID.ToString())
|
|
3228 | 3213 |
{ |
3229 |
line.SPPID.ModelItemId = _connector.ModelItemID; |
|
3214 |
line.SPPID.ModelItemId = _connector.ModelItemID.ToString();
|
|
3230 | 3215 |
line.SPPID.Representations = GetRepresentations(line.SPPID.ModelItemId); |
3231 | 3216 |
} |
3232 | 3217 |
} |
... | ... | |
3267 | 3252 |
string MappingPath = mapping.SPPIDSYMBOLNAME; |
3268 | 3253 |
SegmentLocation location; |
3269 | 3254 |
double[] point = GetSegmentPoint(upStreamObj, downStreamObj, targetLMConnector, out location); |
3270 |
Array array = null;
|
|
3255 |
double[] array = null;
|
|
3271 | 3256 |
if (point != null) |
3272 | 3257 |
array = new double[] { 0, point[0], point[1] }; |
3273 | 3258 |
else |
3274 | 3259 |
array = new double[] { 0, specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y }; |
3275 |
LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(MappingPath, ref array, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine);
|
|
3260 |
LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(MappingPath, array, null, null, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine);
|
|
3276 | 3261 |
|
3277 | 3262 |
if (_LmLabelPersist != null) |
3278 | 3263 |
{ |
3279 | 3264 |
_LmLabelPersist.Commit(); |
3280 | 3265 |
specBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id; |
3281 | 3266 |
if (_LmLabelPersist.ModelItemObject != null) |
3282 |
specBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID; |
|
3283 |
specBreak.SPPID.GraphicOID = _LmLabelPersist.get_GraphicOID().ToString();
|
|
3267 |
specBreak.SPPID.ModelItemID = _LmLabelPersist.ModelItemID.ToString();
|
|
3268 |
specBreak.SPPID.GraphicOID = _LmLabelPersist.GraphicOID.ToString();
|
|
3284 | 3269 |
|
3285 |
MoveDependencyObject(specBreak.SPPID.GraphicOID, location);
|
|
3270 |
MoveSmartLabelObject(specBreak.SPPID.GraphicOID, location);
|
|
3286 | 3271 |
|
3287 | 3272 |
ReleaseCOMObjects(_LmLabelPersist); |
3288 | 3273 |
} |
... | ... | |
3293 | 3278 |
if (property != null && !string.IsNullOrEmpty(property.VALUE) && property.VALUE.Equals("True")) |
3294 | 3279 |
{ |
3295 | 3280 |
// temp |
3296 |
ReleaseCOMObjects(_placement.PIDPlaceSymbol(@"\Design\Annotation\Graphics\Break.sym", specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y, Rotation: specBreak.ANGLE)); |
|
3281 |
ReleaseCOMObjects(_placement.PIDPlaceSymbol(@"\Design\Annotation\Graphics\Break.sym", specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y, null, Rotation: specBreak.ANGLE));
|
|
3297 | 3282 |
} |
3298 | 3283 |
ReleaseCOMObjects(targetLMConnector); |
3299 | 3284 |
} |
... | ... | |
3319 | 3304 |
|
3320 | 3305 |
foreach (LMConnector connector in targetLMSymbol.Avoid1Connectors) |
3321 | 3306 |
{ |
3322 |
if (connector.get_ItemStatus() != "Active")
|
|
3307 |
if (connector.ItemStatus.ToString() != "Active")
|
|
3323 | 3308 |
continue; |
3324 | 3309 |
|
3325 | 3310 |
if (connector.ConnectItem1SymbolObject.Id == connectedLMSymbol.Id) |
... | ... | |
3336 | 3321 |
|
3337 | 3322 |
foreach (LMConnector connector in targetLMSymbol.Avoid2Connectors) |
3338 | 3323 |
{ |
3339 |
if (connector.get_ItemStatus() != "Active")
|
|
3324 |
if (connector.ItemStatus.ToString() != "Active")
|
|
3340 | 3325 |
continue; |
3341 | 3326 |
|
3342 | 3327 |
if (connector.ConnectItem1SymbolObject.Id == connectedLMSymbol.Id) |
... | ... | |
3359 | 3344 |
LMModelItem targetModelItem = dataSource.GetModelItem(targetLine.SPPID.ModelItemId); |
3360 | 3345 |
LMModelItem connectedModelItem = dataSource.GetModelItem(connectedLine.SPPID.ModelItemId); |
3361 | 3346 |
|
3362 |
if (targetModelItem != null && targetModelItem.get_ItemStatus() == "Active" && connectedModelItem != null && connectedModelItem.get_ItemStatus() == "Active")
|
|
3347 |
if (targetModelItem != null && targetModelItem.ItemStatus.ToString() == "Active" && connectedModelItem != null && connectedModelItem.ItemStatus.ToString() == "Active")
|
|
3363 | 3348 |
{ |
3364 | 3349 |
foreach (LMRepresentation rep in targetModelItem.Representations) |
3365 | 3350 |
{ |
3366 | 3351 |
if (targetConnector != null) |
3367 | 3352 |
break; |
3368 | 3353 |
|
3369 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
3354 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
3370 | 3355 |
{ |
3371 | 3356 |
LMConnector _LMConnector = dataSource.GetConnector(rep.Id); |
3372 | 3357 |
|
... | ... | |
3404 | 3389 |
{ |
3405 | 3390 |
foreach (LMConnector connector in connectedLMSymbol.Avoid1Connectors) |
3406 | 3391 |
{ |
3407 |
if (connector.get_ItemStatus() != "Active")
|
|
3392 |
if (connector.ItemStatus.ToString() != "Active")
|
|
3408 | 3393 |
continue; |
3409 | 3394 |
|
3410 | 3395 |
if (IsConnected(connector, targetModelItem)) |
... | ... | |
3418 | 3403 |
{ |
3419 | 3404 |
foreach (LMConnector connector in connectedLMSymbol.Avoid2Connectors) |
3420 | 3405 |
{ |
3421 |
if (connector.get_ItemStatus() != "Active")
|
|
3406 |
if (connector.ItemStatus.ToString() != "Active")
|
|
3422 | 3407 |
continue; |
3423 | 3408 |
|
3424 | 3409 |
if (IsConnected(connector, targetModelItem)) |
... | ... | |
3443 | 3428 |
Line connLine = connObj as Line; |
3444 | 3429 |
Symbol connSymbol = connObj as Symbol; |
3445 | 3430 |
location = SegmentLocation.None; |
3446 |
if (Convert.ToBoolean(targetConnector.get_IsZeroLength()))
|
|
3431 |
if (Convert.ToBoolean(targetConnector.IsZeroLength))
|
|
3447 | 3432 |
{ |
3448 | 3433 |
result = GetConnectorVertices(targetConnector)[0]; |
3449 | 3434 |
if (targetSymbol != null && connSymbol != null) |
... | ... | |
3541 | 3526 |
if (result) |
3542 | 3527 |
break; |
3543 | 3528 |
|
3544 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
3529 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
3545 | 3530 |
{ |
3546 | 3531 |
LMConnector _LMConnector = dataSource.GetConnector(rep.Id); |
3547 | 3532 |
|
... | ... | |
3593 | 3578 |
if (connectedConnector != null) |
3594 | 3579 |
break; |
3595 | 3580 |
|
3596 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
3581 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
3597 | 3582 |
{ |
3598 | 3583 |
LMConnector _LMConnector = dataSource.GetConnector(rep.Id); |
3599 | 3584 |
|
... | ... | |
3652 | 3637 |
if (connector1 != null) |
3653 | 3638 |
{ |
3654 | 3639 |
vertices1 = GetConnectorVertices(connector1); |
3655 |
graphicOID1 = connector1.get_GraphicOID();
|
|
3640 |
graphicOID1 = connector1.GraphicOID.ToString();
|
|
3656 | 3641 |
} |
3657 |
_LMAItem item1 = modelItem1.AsLMAItem();
|
|
3642 |
LMAItem item1 = modelItem1.AsLMAItem(); |
|
3658 | 3643 |
ReleaseCOMObjects(connector1); |
3659 | 3644 |
connector1 = null; |
3660 | 3645 |
|
... | ... | |
3665 | 3650 |
if (connector2 != null) |
3666 | 3651 |
{ |
3667 | 3652 |
vertices2 = GetConnectorVertices(connector2); |
3668 |
graphicOID2 = connector2.get_GraphicOID();
|
|
3653 |
graphicOID2 = connector2.GraphicOID.ToString();
|
|
3669 | 3654 |
} |
3670 |
_LMAItem item2 = modelItem2.AsLMAItem();
|
|
3655 |
LMAItem item2 = modelItem2.AsLMAItem(); |
|
3671 | 3656 |
ReleaseCOMObjects(connector2); |
3672 | 3657 |
connector2 = null; |
3673 | 3658 |
|
... | ... | |
3679 | 3664 |
string beforeID = string.Empty; |
3680 | 3665 |
string afterID = string.Empty; |
3681 | 3666 |
|
3682 |
if (modelItem1.get_ItemStatus() == "Active" && modelItem2.get_ItemStatus() != "Active")
|
|
3667 |
if (modelItem1.ItemStatus.ToString() == "Active" && modelItem2.ItemStatus.ToString() != "Active")
|
|
3683 | 3668 |
{ |
3684 | 3669 |
beforeID = modelItem2.Id; |
3685 | 3670 |
afterID = modelItem1.Id; |
3686 | 3671 |
survivorId = afterID; |
3687 | 3672 |
} |
3688 |
else if (modelItem1.get_ItemStatus() != "Active" && modelItem2.get_ItemStatus() == "Active")
|
|
3673 |
else if (modelItem1.ItemStatus.ToString() != "Active" && modelItem2.ItemStatus.ToString() == "Active")
|
|
3689 | 3674 |
{ |
3690 | 3675 |
beforeID = modelItem1.Id; |
3691 | 3676 |
afterID = modelItem2.Id; |
3692 | 3677 |
survivorId = afterID; |
3693 | 3678 |
} |
3694 |
else if (modelItem1.get_ItemStatus() == "Active" && modelItem2.get_ItemStatus() == "Active")
|
|
3679 |
else if (modelItem1.ItemStatus.ToString() == "Active" && modelItem2.ItemStatus.ToString() == "Active")
|
|
3695 | 3680 |
{ |
3696 | 3681 |
int model1Cnt = GetConnectorCount(modelId1); |
3697 | 3682 |
int model2Cnt = GetConnectorCount(modelId2); |
... | ... | |
3759 | 3744 |
List<LMConnector> connectors = new List<LMConnector>(); |
3760 | 3745 |
foreach (LMConnector connector in symbol.Avoid1Connectors) |
3761 | 3746 |
{ |
3762 |
if (connector.get_ItemStatus() != "Active")
|
|
3747 |
if (connector.ItemStatus.ToString() != "Active")
|
|
3763 | 3748 |
continue; |
3764 | 3749 |
|
3765 | 3750 |
LMModelItem modelItem = connector.ModelItemObject; |
3766 | 3751 |
LMSymbol connOtherSymbol = FindOtherConnectedSymbol(connector); |
3767 |
if (modelItem.get_ItemStatus() == "Active" && modelItem.get_ItemTypeName().ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
|
|
3752 |
if (modelItem.ItemStatus.ToString() == "Active" && modelItem.ItemTypeName.ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
|
|
3768 | 3753 |
temp.Add(modelItem.Id); |
3769 | 3754 |
|
3770 | 3755 |
if (temp.Contains(modelItem.Id) && |
3771 | 3756 |
connOtherSymbol != null && |
3772 |
connOtherSymbol.get_RepresentationType() == "Branch" &&
|
|
3773 |
Convert.ToBoolean(connector.get_IsZeroLength()))
|
|
3757 |
connOtherSymbol.RepresentationType.ToString() == "Branch" &&
|
|
3758 |
Convert.ToBoolean(connector.IsZeroLength))
|
|
3774 | 3759 |
temp.Remove(modelItem.Id); |
3775 | 3760 |
|
3776 | 3761 |
|
... | ... | |
3784 | 3769 |
|
3785 | 3770 |
foreach (LMConnector connector in symbol.Avoid2Connectors) |
3786 | 3771 |
{ |
3787 |
if (connector.get_ItemStatus() != "Active")
|
|
3772 |
if (connector.ItemStatus.ToString() != "Active")
|
|
3788 | 3773 |
continue; |
3789 | 3774 |
|
3790 | 3775 |
LMModelItem modelItem = connector.ModelItemObject; |
3791 | 3776 |
LMSymbol connOtherSymbol = FindOtherConnectedSymbol(connector); |
3792 |
if (modelItem.get_ItemStatus() == "Active" && modelItem.get_ItemTypeName().ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
|
|
3777 |
if (modelItem.ItemStatus.ToString() == "Active" && modelItem.ItemTypeName.ToString() == "PipeRun" && modelItem.Id != modelId && !temp.Contains(modelItem.Id))
|
|
3793 | 3778 |
temp.Add(modelItem.Id); |
3794 | 3779 |
|
3795 | 3780 |
if (temp.Contains(modelItem.Id) && |
3796 | 3781 |
connOtherSymbol != null && |
3797 |
connOtherSymbol.get_RepresentationType() == "Branch" &&
|
|
3798 |
Convert.ToBoolean(connector.get_IsZeroLength()))
|
|
3782 |
connOtherSymbol.RepresentationType.ToString() == "Branch" &&
|
|
3783 |
Convert.ToBoolean(connector.IsZeroLength))
|
|
3799 | 3784 |
temp.Remove(modelItem.Id); |
3800 | 3785 |
|
3801 | 3786 |
if (temp.Contains(modelItem.Id)) |
... | ... | |
3811 | 3796 |
string originalName = GetSPPIDFileName(modelId); |
3812 | 3797 |
foreach (var connector in connectors) |
3813 | 3798 |
{ |
3814 |
string fileName = GetSPPIDFileName(connector.ModelItemID); |
|
3799 |
string fileName = GetSPPIDFileName(connector.ModelItemID.ToString());
|
|
3815 | 3800 |
if (originalName == fileName) |
3816 |
result.Add(connector.ModelItemID); |
|
3801 |
result.Add(connector.ModelItemID.ToString());
|
|
3817 | 3802 |
else |
3818 | 3803 |
{ |
3819 |
if (document.LINES.Find(x => x.SPPID.ModelItemId == connector.ModelItemID) == null && Convert.ToBoolean(connector.get_IsZeroLength()))
|
|
3820 |
result.Add(connector.ModelItemID); |
|
3804 |
if (document.LINES.Find(x => x.SPPID.ModelItemId == connector.ModelItemID.ToString()) == null && Convert.ToBoolean(connector.IsZeroLength))
|
|
3805 |
result.Add(connector.ModelItemID.ToString());
|
|
3821 | 3806 |
else |
3822 | 3807 |
{ |
3823 | 3808 |
Line line1 = document.LINES.Find(x => x.SPPID.ModelItemId == modelId); |
3824 | 3809 |
Line line2 = document.LINES.Find(x => x.SPPID.ModelItemId == connector.ModelItemID.ToString()); |
3825 | 3810 |
if (line1 != null && line2 != null && line1.TYPE == line2.TYPE) |
3826 |
result.Add(connector.ModelItemID); |
|
3811 |
result.Add(connector.ModelItemID.ToString());
|
|
3827 | 3812 |
} |
3828 | 3813 |
} |
3829 | 3814 |
} |
... | ... | |
3837 | 3822 |
LMSymbol FindOtherConnectedSymbol(LMConnector connector) |
3838 | 3823 |
{ |
3839 | 3824 |
LMSymbol findResult = null; |
3840 |
if (connector.ConnectItem1SymbolObject != null && connector.ConnectItem1SymbolObject.Id != symbol.Id && connector.ConnectItem1SymbolObject.get_ItemStatus() == "Active")
|
|
3825 |
if (connector.ConnectItem1SymbolObject != null && connector.ConnectItem1SymbolObject.Id != symbol.Id && connector.ConnectItem1SymbolObject.ItemStatus.ToString() == "Active")
|
|
3841 | 3826 |
findResult = connector.ConnectItem1SymbolObject; |
3842 |
else if (connector.ConnectItem2SymbolObject != null && connector.ConnectItem2SymbolObject.Id != symbol.Id && connector.ConnectItem2SymbolObject.get_ItemStatus() == "Active")
|
|
3827 |
else if (connector.ConnectItem2SymbolObject != null && connector.ConnectItem2SymbolObject.Id != symbol.Id && connector.ConnectItem2SymbolObject.ItemStatus.ToString() == "Active")
|
|
3843 | 3828 |
findResult = connector.ConnectItem2SymbolObject; |
3844 | 3829 |
|
3845 | 3830 |
return findResult; |
... | ... | |
3860 | 3845 |
{ |
3861 | 3846 |
foreach (LMRepresentation rep in modelItem.Representations) |
3862 | 3847 |
{ |
3863 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
3848 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
3864 | 3849 |
{ |
3865 | 3850 |
LMConnector _LMConnector = dataSource.GetConnector(rep.Id); |
3866 |
if (!ContainZeroLength && Convert.ToBoolean(_LMConnector.get_IsZeroLength()))
|
|
3851 |
if (!ContainZeroLength && Convert.ToBoolean(_LMConnector.IsZeroLength))
|
|
3867 | 3852 |
{ |
3868 | 3853 |
ReleaseCOMObjects(_LMConnector); |
3869 | 3854 |
_LMConnector = null; |
3870 | 3855 |
continue; |
3871 | 3856 |
} |
3872 | 3857 |
connectorVertices.Add(_LMConnector, new List<double[]>()); |
3873 |
dynamic OID = rep.get_GraphicOID().ToString();
|
|
3874 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
3858 |
dynamic OID = rep.GraphicOID.ToString();
|
|
3859 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
3875 | 3860 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
3876 | 3861 |
int verticesCount = lineStringGeometry.VertexCount; |
3877 | 3862 |
double[] vertices = null; |
... | ... | |
3880 | 3865 |
{ |
3881 | 3866 |
double x = 0; |
3882 | 3867 |
double y = 0; |
3883 |
lineStringGeometry.GetVertex(i + 1, ref x, ref y); |
|
3868 |
//TODO : ddd |
|
3869 |
lineStringGeometry.GetVertex(i, ref x, ref y); |
|
3884 | 3870 |
connectorVertices[_LMConnector].Add(new double[] { x, y }); |
3885 | 3871 |
} |
3886 | 3872 |
} |
... | ... | |
3897 | 3883 |
List<double[]> vertices = new List<double[]>(); |
3898 | 3884 |
if (connector != null) |
3899 | 3885 |
{ |
3900 |
dynamic OID = connector.get_GraphicOID().ToString();
|
|
3901 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
3886 |
dynamic OID = connector.GraphicOID.ToString();
|
|
3887 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
3902 | 3888 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
3903 | 3889 |
int verticesCount = lineStringGeometry.VertexCount; |
3904 | 3890 |
double[] value = null; |
... | ... | |
3920 | 3906 |
List<double[]> vertices = new List<double[]>(); |
3921 | 3907 |
if (connector != null) |
3922 | 3908 |
{ |
3923 |
dynamic OID = connector.get_GraphicOID().ToString();
|
|
3924 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
3909 |
dynamic OID = connector.GraphicOID.ToString();
|
|
3910 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
3925 | 3911 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
3926 | 3912 |
int verticesCount = lineStringGeometry.VertexCount; |
3927 | 3913 |
double[] value = null; |
... | ... | |
3946 | 3932 |
List<double[]> vertices = new List<double[]>(); |
3947 | 3933 |
if (connector != null) |
3948 | 3934 |
{ |
3949 |
dynamic OID = connector.get_GraphicOID().ToString();
|
|
3950 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
|
|
3935 |
dynamic OID = connector.GraphicOID.ToString();
|
|
3936 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
3951 | 3937 |
double minX = 0; |
3952 | 3938 |
double minY = 0; |
3953 | 3939 |
double maxX = 0; |
... | ... | |
3961 | 3947 |
private List<double[]> GetConnectorVertices(dynamic graphicOID) |
3962 | 3948 |
{ |
3963 | 3949 |
List<double[]> vertices = null; |
3964 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID];
|
|
3950 |
Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID] as Ingr.RAD2D.Components.Connector.Connector;
|
|
3965 | 3951 |
if (drawingObject != null) |
3966 | 3952 |
{ |
3967 | 3953 |
vertices = new List<double[]>(); |
... | ... | |
4157 | 4143 |
{ |
4158 | 4144 |
foreach (LMConnector connector in connSymbol.Connect1Connectors) |
4159 | 4145 |
{ |
4160 |
if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
|
|
4146 |
if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
|
|
4161 | 4147 |
containZeroLength = true; |
4162 | 4148 |
} |
4163 | 4149 |
foreach (LMConnector connector in connSymbol.Connect2Connectors) |
4164 | 4150 |
{ |
4165 |
if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
|
|
4151 |
if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
|
|
4166 | 4152 |
containZeroLength = true; |
4167 | 4153 |
} |
4168 | 4154 |
} |
4169 | 4155 |
|
4170 | 4156 |
if (connSymbol == null || |
4171 |
(connSymbol != null && connSymbol.get_ItemStatus() == "Active" && connSymbol.get_RepresentationType() != "Branch") ||
|
|
4157 |
(connSymbol != null && connSymbol.ItemStatus.ToString() == "Active" && connSymbol.RepresentationType.ToString() != "Branch") ||
|
|
4172 | 4158 |
containZeroLength) |
4173 | 4159 |
{ |
4174 | 4160 |
bool bCalcX = false; |
... | ... | |
4230 | 4216 |
{ |
4231 | 4217 |
foreach (LMConnector connector in connSymbol.Connect1Connectors) |
4232 | 4218 |
{ |
4233 |
if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
|
|
4219 |
if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
|
|
4234 | 4220 |
containZeroLength = true; |
4235 | 4221 |
} |
4236 | 4222 |
foreach (LMConnector connector in connSymbol.Connect2Connectors) |
4237 | 4223 |
{ |
4238 |
if (connector.get_ItemStatus() == "Active" && Convert.ToBoolean(connector.get_IsZeroLength()) == true)
|
|
4224 |
if (connector.ItemStatus.ToString() == "Active" && Convert.ToBoolean(connector.IsZeroLength) == true)
|
|
4239 | 4225 |
containZeroLength = true; |
4240 | 4226 |
} |
4241 | 4227 |
} |
4242 | 4228 |
|
4243 | 4229 |
if (connSymbol == null || |
4244 |
(connSymbol != null && connSymbol.get_ItemStatus() == "Active" && connSymbol.get_RepresentationType() != "Branch") ||
|
|
4230 |
(connSymbol != null && connSymbol.ItemStatus.ToString() == "Active" && connSymbol.RepresentationType.ToString() != "Branch") ||
|
|
4245 | 4231 |
containZeroLength) |
4246 | 4232 |
{ |
4247 | 4233 |
bool bCalcX = false; |
... | ... | |
4316 | 4302 |
{ |
4317 | 4303 |
foreach (LMRepresentation rep in modelItem.Representations) |
4318 | 4304 |
{ |
4319 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
4305 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
4320 | 4306 |
connectors.Add(dataSource.GetConnector(rep.Id)); |
4321 | 4307 |
} |
4322 | 4308 |
|
... | ... | |
4341 | 4327 |
{ |
4342 | 4328 |
foreach (LMRepresentation rep in modelItem.Representations) |
4343 | 4329 |
{ |
4344 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" &&
|
|
4345 |
rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
4330 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" &&
|
|
4331 |
rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
4346 | 4332 |
{ |
4347 | 4333 |
LMConnector connector = dataSource.GetConnector(rep.Id); |
4348 |
if (!Convert.ToBoolean(connector.get_IsZeroLength()))
|
|
4334 |
if (!Convert.ToBoolean(connector.IsZeroLength))
|
|
4349 | 4335 |
{ |
4350 | 4336 |
result = connector; |
4351 | 4337 |
break; |
... | ... | |
4372 | 4358 |
{ |
4373 | 4359 |
foreach (LMRepresentation rep in modelItem.Representations) |
4374 | 4360 |
{ |
4375 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
4361 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
4376 | 4362 |
result++; |
4377 | 4363 |
ReleaseCOMObjects(rep); |
4378 | 4364 |
} |
... | ... | |
4390 | 4376 |
{ |
4391 | 4377 |
foreach (LMRepresentation rep in modelItem.Representations) |
4392 | 4378 |
{ |
4393 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active")
|
|
4379 |
if (rep.Attributes["RepresentationType"].Value.ToString() == "Connector" && rep.Attributes["ItemStatus"].Value.ToString() == "Active")
|
|
4394 | 4380 |
result.Add(rep.Id); |
4395 | 4381 |
} |
4396 | 4382 |
ReleaseCOMObjects(modelItem); |
... | ... | |
4412 | 4398 |
LMConnector connectedLMConnector = FindTargetLMConnectorForLabel(connectorVertices, x, y); |
4413 | 4399 |
if (connectedLMConnector != null) |
4414 | 4400 |
{ |
4415 |
Array points = new double[] { 0, x, y };
|
|
4401 |
double[] points = new double[] { 0, x, y };
|
|
4416 | 4402 |
lineNumber.SPPID.SPPID_X = x; |
4417 | 4403 |
lineNumber.SPPID.SPPID_Y = y; |
4418 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false);
|
|
4404 |
LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, points, null, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false);
|
|
4419 | 4405 |
|
4420 | 4406 |
if (_LmLabelPresist != null) |
4421 | 4407 |
{ |
... | ... | |
4440 | 4426 |
LMLabelPersist removeLabel = dataSource.GetLabelPersist(lineNumber.SPPID.RepresentationId); |
4441 | 4427 |
if (removeLabel != null) |
4442 | 4428 |
{ |
4443 |
lineNumber.SPPID.SPPID_X = removeLabel.get_XCoordinate();
|
|
4444 |
lineNumber.SPPID.SPPID_Y = removeLabel.get_YCoordinate();
|
|
4429 |
lineNumber.SPPID.SPPID_X = Convert.ToDouble(removeLabel.XCoordinate);
|
|
4430 |
lineNumber.SPPID.SPPID_Y = Convert.ToDouble(removeLabel.YCoordinate);
|
|
4445 | 4431 |
|
4446 | 4432 |
GridSetting gridSetting = GridSetting.GetInstance(); |
4447 | 4433 |
LMConnector connector = dataSource.GetConnector(removeLabel.RepresentationID); |
... | ... | |
4543 | 4529 |
if (offsetY != 0 || offsetY != 0) |
4544 | 4530 |
{ |
4545 | 4531 |
if (connector.ConnectItem1SymbolObject != null && |
4546 |
connector.ConnectItem1SymbolObject.get_RepresentationType() == "OPC")
|
|
4532 |
connector.ConnectItem1SymbolObject.RepresentationType.ToString() == "OPC")
|
|
4547 | 4533 |
{ |
4548 |
Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem1SymbolObject.get_GraphicOID().ToString()];
|
|
4534 |
Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem1SymbolObject.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
4549 | 4535 |
|
4550 | 4536 |
double x1, y1, x2, y2, originX, originY; |
4551 | 4537 |
symbol.Range(out x1, out y1, out x2, out y2); |
... | ... | |
4556 | 4542 |
offsetX = -1 * (originX - gridSetting.Length * 30 - labelCenterX); |
4557 | 4543 |
} |
4558 | 4544 |
else if (connector.ConnectItem2SymbolObject != null && |
4559 |
connector.ConnectItem2SymbolObject.get_RepresentationType() == "OPC")
|
|
4545 |
connector.ConnectItem2SymbolObject.RepresentationType.ToString() == "OPC")
|
|
4560 | 4546 |
{ |
4561 |
Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem2SymbolObject.get_GraphicOID().ToString()];
|
|
4547 |
Ingr.RAD2D.Symbol2d symbol = radApp.ActiveDocument.ActiveSheet.DrawingObjects[connector.ConnectItem2SymbolObject.GraphicOID.ToString()] as Ingr.RAD2D.Symbol2d;
|
|
4562 | 4548 |
|
4563 | 4549 |
double x1, y1, x2, y2, originX, originY; |
4564 | 4550 |
symbol.Range(out x1, out y1, out x2, out y2); |
... | ... | |
4570 | 4556 |
} |
4571 | 4557 |
|
4572 | 4558 |
radApp.ActiveSelectSet.RemoveAll(); |
4573 |
DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[removeLabel.get_GraphicOID().ToString()] as DependencyObject;
|
|
4559 |
Ingr.RAD2D.Components.SmartLabel.SmartLabel dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[removeLabel.GraphicOID.ToString()] as Ingr.RAD2D.Components.SmartLabel.SmartLabel;
|
|
4574 | 4560 |
if (dependency != null) |
4575 | 4561 |
{ |
4576 | 4562 |
radApp.ActiveSelectSet.Add(dependency); |
... | ... | |
4612 | 4598 |
List<double[]> vertices = GetConnectorVertices(connector); |
4613 | 4599 |
vertices = vertices.FindAll(x => x[0] > 0 && x[1] > 0); |
4614 | 4600 |
double[] point = vertices[vertices.Count - 1]; |
4615 |
Array array = new double[] { 0, point[0], point[1] };
|
|
4616 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mappingPath, ref array, LabeledItem: connector.AsLMRepresentation());
|
|
4601 |
double[] array = new double[] { 0, point[0], point[1] };
|
|
4602 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mappingPath, array, null, null, LabeledItem: connector.AsLMRepresentation());
|
|
4617 | 4603 |
if (_LMLabelPersist != null) |
4618 | 4604 |
{ |
4619 | 4605 |
_LMLabelPersist.Commit(); |
... | ... | |
4651 | 4637 |
if (line != null && !endLine.Contains(line.SPPID.ModelItemId)) |
4652 | 4638 |
{ |
4653 | 4639 |
LMModelItem _LMModelItem = dataSource.GetModelItem(line.SPPID.ModelItemId); |
4654 |
if (_LMModelItem != null && _LMModelItem.get_ItemStatus() == "Active")
|
|
4640 |
if (_LMModelItem != null && _LMModelItem.ItemStatus.ToString() == "Active")
|
|
4655 | 4641 |
{ |
4656 | 4642 |
foreach (var attribute in lineNumber.ATTRIBUTES) |
4657 | 4643 |
{ |
... | ... | |
4668 | 4654 |
if (dt.Rows.Count == 1) |
4669 | 4655 |
{ |
4670 | 4656 |
string fluidSystem = dt.Rows[0]["CODELIST_TEXT"].ToString(); |
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);
|
|
4657 |
if (DBNull.Value.Equals(_FluidSystemAttribute.Value))
|
|
4658 |
_FluidSystemAttribute.Value = fluidSystem;
|
|
4659 |
else if (_FluidSystemAttribute.Value.ToString() != fluidSystem)
|
|
4660 |
_FluidSystemAttribute.Value = fluidSystem;
|
|
4675 | 4661 |
|
4676 | 4662 |
if (_LMAAttribute != null) |
4677 | 4663 |
{ |
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);
|
|
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;
|
|
4682 | 4668 |
} |
4683 | 4669 |
} |
4684 | 4670 |
if (dt != null) |
... | ... | |
4696 | 4682 |
else |
4697 | 4683 |
attribute.VALUE = rows[0]["InchStr"].ToString(); |
4698 | 4684 |
|
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);
|
|
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;
|
|
4703 | 4689 |
} |
4704 | 4690 |
} |
4705 | 4691 |
else if (_LMAAttribute != null) |
4706 | 4692 |
{ |
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); |
내보내기 Unified diff