개정판 4ba01591
dev issue #000 : clear insconsistancy ( 값이 다른 경우만 초기화)
Change-Id: Ib8c5059457be5dfe198622cf4154c91863bcc5ef
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
100 | 100 |
RunBranchLineModeling(); |
101 | 101 |
|
102 | 102 |
// Clear Attribute |
103 |
RunClearAttribute();
|
|
103 |
RunClearInconsistancy();
|
|
104 | 104 |
|
105 | 105 |
// EndBreak Modeling |
106 | 106 |
RunEndBreakModeling(); |
... | ... | |
108 | 108 |
// SpecBreak Modeling |
109 | 109 |
RunSpecBreakModeling(); |
110 | 110 |
|
111 |
// LineNumber Modeling |
|
112 |
RunLineNumberModeling(); |
|
113 |
|
|
114 |
// FlowMark Modeling |
|
115 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Flow Mark Modeling"); |
|
116 |
foreach (var item in document.LINES) |
|
117 |
try |
|
118 |
{ |
|
119 |
FlowMarkModeling(item); |
|
120 |
} |
|
121 |
catch (Exception ex) |
|
122 |
{ |
|
123 |
Log.Write("Error in FlowMarkModeling"); |
|
124 |
Log.Write("UID : " + item.UID); |
|
125 |
Log.Write(ex.Message); |
|
126 |
Log.Write(ex.StackTrace); |
|
127 |
} |
|
128 |
|
|
129 |
|
|
130 |
// Note Symbol Modeling |
|
131 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Note Symbol Modeling"); |
|
132 |
foreach (var item in document.SYMBOLS) |
|
133 |
try |
|
134 |
{ |
|
135 |
NoteSymbolModeling(item); |
|
136 |
} |
|
137 |
catch (Exception ex) |
|
138 |
{ |
|
139 |
Log.Write("Error in NoteSymbolModeling"); |
|
140 |
Log.Write("UID : " + item.UID); |
|
141 |
Log.Write(ex.Message); |
|
142 |
Log.Write(ex.StackTrace); |
|
143 |
} |
|
144 |
|
|
145 |
|
|
146 |
// Note Modeling |
|
147 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Notes Modeling"); |
|
148 |
foreach (var item in document.NOTES) |
|
149 |
try |
|
150 |
{ |
|
151 |
NoteModeling(item); |
|
152 |
} |
|
153 |
catch (Exception ex) |
|
154 |
{ |
|
155 |
Log.Write("Error in NoteModeling"); |
|
156 |
Log.Write("UID : " + item.UID); |
|
157 |
Log.Write(ex.Message); |
|
158 |
Log.Write(ex.StackTrace); |
|
159 |
} |
|
160 |
|
|
161 |
// Text Modeling |
|
162 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Texts Modeling"); |
|
163 |
foreach (var item in document.TEXTINFOS) |
|
164 |
try |
|
165 |
{ |
|
166 |
TextModeling(item); |
|
167 |
} |
|
168 |
catch (Exception ex) |
|
169 |
{ |
|
170 |
Log.Write("Error in TextModeling"); |
|
171 |
Log.Write("UID : " + item.UID); |
|
172 |
Log.Write(ex.Message); |
|
173 |
Log.Write(ex.StackTrace); |
|
174 |
} |
|
175 |
|
|
176 |
// Input LineNumber Attribute |
|
177 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set LineNumbers Attribute"); |
|
178 |
foreach (var item in document.LINENUMBERS) |
|
179 |
try |
|
180 |
{ |
|
181 |
InputLineNumberAttribute(item); |
|
182 |
} |
|
183 |
catch (Exception ex) |
|
184 |
{ |
|
185 |
Log.Write("Error in InputLineNumberAttribute"); |
|
186 |
Log.Write("UID : " + item.UID); |
|
187 |
Log.Write(ex.Message); |
|
188 |
Log.Write(ex.StackTrace); |
|
189 |
} |
|
190 |
|
|
191 |
// Input Symbol Attribute |
|
192 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set Symbols Attribute"); |
|
193 |
foreach (var item in document.SYMBOLS) |
|
194 |
try |
|
195 |
{ |
|
196 |
InputSymbolAttribute(item, item.ATTRIBUTES); |
|
197 |
} |
|
198 |
catch (Exception ex) |
|
199 |
{ |
|
200 |
Log.Write("Error in InputSymbolAttribute"); |
|
201 |
Log.Write("UID : " + item.UID); |
|
202 |
Log.Write(ex.Message); |
|
203 |
Log.Write(ex.StackTrace); |
|
204 |
} |
|
205 |
|
|
206 |
// Input SpecBreak Attribute |
|
207 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set Symbols Attribute"); |
|
208 |
foreach (var item in document.SpecBreaks) |
|
209 |
try |
|
210 |
{ |
|
211 |
InputSpecBreakAttribute(item); |
|
212 |
} |
|
213 |
catch (Exception ex) |
|
214 |
{ |
|
215 |
Log.Write("Error in InputSpecBreakAttribute"); |
|
216 |
Log.Write("UID : " + item.UID); |
|
217 |
Log.Write(ex.Message); |
|
218 |
Log.Write(ex.StackTrace); |
|
219 |
} |
|
220 |
|
|
221 |
// Label Symbol Modeling |
|
222 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Labels Modeling"); |
|
223 |
foreach (var item in document.SYMBOLS) |
|
224 |
try |
|
225 |
{ |
|
226 |
LabelSymbolModeling(item); |
|
227 |
} |
|
228 |
catch (Exception ex) |
|
229 |
{ |
|
230 |
Log.Write("Error in LabelSymbolModeling"); |
|
231 |
Log.Write("UID : " + item.UID); |
|
232 |
Log.Write(ex.Message); |
|
233 |
Log.Write(ex.StackTrace); |
|
234 |
} |
|
235 |
|
|
236 |
// LineRun Line Join |
|
237 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Join LineRuns"); |
|
238 |
foreach (LineNumber lineNumber in document.LINENUMBERS) |
|
239 |
try |
|
240 |
{ |
|
241 |
foreach (LineRun run in lineNumber.RUNS) |
|
242 |
JoinRunLine(run); |
|
243 |
} |
|
244 |
catch (Exception ex) |
|
245 |
{ |
|
246 |
Log.Write("Error in JoinRunLine"); |
|
247 |
Log.Write("UID : " + lineNumber.UID); |
|
248 |
Log.Write(ex.Message); |
|
249 |
Log.Write(ex.StackTrace); |
|
250 |
} |
|
251 |
|
|
252 |
// TrimLineRun Line Join |
|
253 |
foreach (TrimLine trimLine in document.TRIMLINES) |
|
254 |
try |
|
255 |
{ |
|
256 |
foreach (LineRun run in trimLine.RUNS) |
|
257 |
JoinRunLine(run); |
|
258 |
} |
|
259 |
catch (Exception ex) |
|
260 |
{ |
|
261 |
Log.Write("Error in JoinRunLine"); |
|
262 |
Log.Write("UID : " + trimLine.UID); |
|
263 |
Log.Write(ex.Message); |
|
264 |
Log.Write(ex.StackTrace); |
|
265 |
} |
|
111 |
//// LineNumber Modeling
|
|
112 |
//RunLineNumberModeling();
|
|
113 |
|
|
114 |
//// FlowMark Modeling
|
|
115 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Flow Mark Modeling");
|
|
116 |
//foreach (var item in document.LINES)
|
|
117 |
// try
|
|
118 |
// {
|
|
119 |
// FlowMarkModeling(item);
|
|
120 |
// }
|
|
121 |
// catch (Exception ex)
|
|
122 |
// {
|
|
123 |
// Log.Write("Error in FlowMarkModeling");
|
|
124 |
// Log.Write("UID : " + item.UID);
|
|
125 |
// Log.Write(ex.Message);
|
|
126 |
// Log.Write(ex.StackTrace);
|
|
127 |
// }
|
|
128 |
|
|
129 |
|
|
130 |
//// Note Symbol Modeling
|
|
131 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Note Symbol Modeling");
|
|
132 |
//foreach (var item in document.SYMBOLS)
|
|
133 |
// try
|
|
134 |
// {
|
|
135 |
// NoteSymbolModeling(item);
|
|
136 |
// }
|
|
137 |
// catch (Exception ex)
|
|
138 |
// {
|
|
139 |
// Log.Write("Error in NoteSymbolModeling");
|
|
140 |
// Log.Write("UID : " + item.UID);
|
|
141 |
// Log.Write(ex.Message);
|
|
142 |
// Log.Write(ex.StackTrace);
|
|
143 |
// }
|
|
144 |
|
|
145 |
|
|
146 |
//// Note Modeling
|
|
147 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Notes Modeling");
|
|
148 |
//foreach (var item in document.NOTES)
|
|
149 |
// try
|
|
150 |
// {
|
|
151 |
// NoteModeling(item);
|
|
152 |
// }
|
|
153 |
// catch (Exception ex)
|
|
154 |
// {
|
|
155 |
// Log.Write("Error in NoteModeling");
|
|
156 |
// Log.Write("UID : " + item.UID);
|
|
157 |
// Log.Write(ex.Message);
|
|
158 |
// Log.Write(ex.StackTrace);
|
|
159 |
// }
|
|
160 |
|
|
161 |
//// Text Modeling
|
|
162 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Texts Modeling");
|
|
163 |
//foreach (var item in document.TEXTINFOS)
|
|
164 |
// try
|
|
165 |
// {
|
|
166 |
// TextModeling(item);
|
|
167 |
// }
|
|
168 |
// catch (Exception ex)
|
|
169 |
// {
|
|
170 |
// Log.Write("Error in TextModeling");
|
|
171 |
// Log.Write("UID : " + item.UID);
|
|
172 |
// Log.Write(ex.Message);
|
|
173 |
// Log.Write(ex.StackTrace);
|
|
174 |
// }
|
|
175 |
|
|
176 |
//// Input LineNumber Attribute
|
|
177 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set LineNumbers Attribute");
|
|
178 |
//foreach (var item in document.LINENUMBERS)
|
|
179 |
// try
|
|
180 |
// {
|
|
181 |
// InputLineNumberAttribute(item);
|
|
182 |
// }
|
|
183 |
// catch (Exception ex)
|
|
184 |
// {
|
|
185 |
// Log.Write("Error in InputLineNumberAttribute");
|
|
186 |
// Log.Write("UID : " + item.UID);
|
|
187 |
// Log.Write(ex.Message);
|
|
188 |
// Log.Write(ex.StackTrace);
|
|
189 |
// }
|
|
190 |
|
|
191 |
//// Input Symbol Attribute
|
|
192 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set Symbols Attribute");
|
|
193 |
//foreach (var item in document.SYMBOLS)
|
|
194 |
// try
|
|
195 |
// {
|
|
196 |
// InputSymbolAttribute(item, item.ATTRIBUTES);
|
|
197 |
// }
|
|
198 |
// catch (Exception ex)
|
|
199 |
// {
|
|
200 |
// Log.Write("Error in InputSymbolAttribute");
|
|
201 |
// Log.Write("UID : " + item.UID);
|
|
202 |
// Log.Write(ex.Message);
|
|
203 |
// Log.Write(ex.StackTrace);
|
|
204 |
// }
|
|
205 |
|
|
206 |
//// Input SpecBreak Attribute
|
|
207 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set Symbols Attribute");
|
|
208 |
//foreach (var item in document.SpecBreaks)
|
|
209 |
// try
|
|
210 |
// {
|
|
211 |
// InputSpecBreakAttribute(item);
|
|
212 |
// }
|
|
213 |
// catch (Exception ex)
|
|
214 |
// {
|
|
215 |
// Log.Write("Error in InputSpecBreakAttribute");
|
|
216 |
// Log.Write("UID : " + item.UID);
|
|
217 |
// Log.Write(ex.Message);
|
|
218 |
// Log.Write(ex.StackTrace);
|
|
219 |
// }
|
|
220 |
|
|
221 |
//// Label Symbol Modeling
|
|
222 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Labels Modeling");
|
|
223 |
//foreach (var item in document.SYMBOLS)
|
|
224 |
// try
|
|
225 |
// {
|
|
226 |
// LabelSymbolModeling(item);
|
|
227 |
// }
|
|
228 |
// catch (Exception ex)
|
|
229 |
// {
|
|
230 |
// Log.Write("Error in LabelSymbolModeling");
|
|
231 |
// Log.Write("UID : " + item.UID);
|
|
232 |
// Log.Write(ex.Message);
|
|
233 |
// Log.Write(ex.StackTrace);
|
|
234 |
// }
|
|
235 |
|
|
236 |
//// LineRun Line Join
|
|
237 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Join LineRuns");
|
|
238 |
//foreach (LineNumber lineNumber in document.LINENUMBERS)
|
|
239 |
// try
|
|
240 |
// {
|
|
241 |
// foreach (LineRun run in lineNumber.RUNS)
|
|
242 |
// JoinRunLine(run);
|
|
243 |
// }
|
|
244 |
// catch (Exception ex)
|
|
245 |
// {
|
|
246 |
// Log.Write("Error in JoinRunLine");
|
|
247 |
// Log.Write("UID : " + lineNumber.UID);
|
|
248 |
// Log.Write(ex.Message);
|
|
249 |
// Log.Write(ex.StackTrace);
|
|
250 |
// }
|
|
251 |
|
|
252 |
//// TrimLineRun Line Join
|
|
253 |
//foreach (TrimLine trimLine in document.TRIMLINES)
|
|
254 |
// try
|
|
255 |
// {
|
|
256 |
// foreach (LineRun run in trimLine.RUNS)
|
|
257 |
// JoinRunLine(run);
|
|
258 |
// }
|
|
259 |
// catch (Exception ex)
|
|
260 |
// {
|
|
261 |
// Log.Write("Error in JoinRunLine");
|
|
262 |
// Log.Write("UID : " + trimLine.UID);
|
|
263 |
// Log.Write(ex.Message);
|
|
264 |
// Log.Write(ex.StackTrace);
|
|
265 |
// }
|
|
266 | 266 |
} |
267 | 267 |
} |
268 | 268 |
catch (Exception ex) |
... | ... | |
381 | 381 |
} |
382 | 382 |
} |
383 | 383 |
} |
384 |
private void RunClearAttribute()
|
|
384 |
private void RunClearInconsistancy()
|
|
385 | 385 |
{ |
386 | 386 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count + document.LINES.Count); |
387 | 387 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Clear Attribute"); |
388 | 388 |
SetSystemEditingCommand(false); |
389 |
List<string> endClearModelItemID = new List<string>(); |
|
390 |
for (int i = 0; i < document.LINES.Count; i++) |
|
391 |
{ |
|
392 |
Line item = document.LINES[i]; |
|
393 |
string modelItemID = item.SPPID.ModelItemId; |
|
394 |
if (!string.IsNullOrEmpty(modelItemID)) |
|
395 |
{ |
|
396 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemID); |
|
397 |
if (modelItem != null) |
|
398 |
{ |
|
399 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
400 |
if (attribute != null) |
|
401 |
attribute.set_Value(DBNull.Value); |
|
402 |
|
|
403 |
modelItem.Commit(); |
|
404 |
ReleaseCOMObjects(modelItem); |
|
405 |
} |
|
406 |
} |
|
407 |
if (!endClearModelItemID.Contains(modelItemID)) |
|
408 |
endClearModelItemID.Add(modelItemID); |
|
409 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
410 |
} |
|
411 |
for (int i = 0; i < document.SYMBOLS.Count; i++) |
|
412 |
{ |
|
413 |
Symbol item = document.SYMBOLS[i]; |
|
414 |
string repID = item.SPPID.RepresentationId; |
|
415 |
string modelItemID = item.SPPID.ModelItemID; |
|
416 |
if (!string.IsNullOrEmpty(modelItemID)) |
|
417 |
{ |
|
418 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemID); |
|
419 |
if (modelItem != null) |
|
420 |
{ |
|
421 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
422 |
if (attribute != null) |
|
423 |
attribute.set_Value(DBNull.Value); |
|
424 |
attribute = modelItem.Attributes["PipingPoint1.NominalDiameter"]; |
|
425 |
if (attribute != null) |
|
426 |
attribute.set_Value(DBNull.Value); |
|
427 |
attribute = modelItem.Attributes["PipingPoint2.NominalDiameter"]; |
|
428 |
if (attribute != null) |
|
429 |
attribute.set_Value(DBNull.Value); |
|
430 |
modelItem.Commit(); |
|
431 | 389 |
|
432 |
modelItem.Commit(); |
|
433 |
ReleaseCOMObjects(modelItem); |
|
434 |
} |
|
435 |
} |
|
436 |
if (!string.IsNullOrEmpty(repID)) |
|
437 |
{ |
|
438 |
LMSymbol symbol = dataSource.GetSymbol(repID); |
|
439 |
if (symbol != null) |
|
440 |
{ |
|
441 |
foreach (LMConnector connector in symbol.Connect1Connectors) |
|
442 |
{ |
|
443 |
if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID)) |
|
444 |
{ |
|
445 |
endClearModelItemID.Add(connector.ModelItemID); |
|
446 |
LMModelItem modelItem = connector.ModelItemObject; |
|
447 |
if (modelItem != null) |
|
448 |
{ |
|
449 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
450 |
if (attribute != null) |
|
451 |
attribute.set_Value(DBNull.Value); |
|
452 |
|
|
453 |
modelItem.Commit(); |
|
454 |
ReleaseCOMObjects(modelItem); |
|
455 |
} |
|
456 |
} |
|
457 |
} |
|
458 |
foreach (LMConnector connector in symbol.Connect2Connectors) |
|
459 |
{ |
|
460 |
if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID)) |
|
461 |
{ |
|
462 |
endClearModelItemID.Add(connector.ModelItemID); |
|
463 |
LMModelItem modelItem = connector.ModelItemObject; |
|
464 |
if (modelItem != null) |
|
465 |
{ |
|
466 |
LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
467 |
if (attribute != null) |
|
468 |
attribute.set_Value(DBNull.Value); |
|
469 |
|
|
470 |
modelItem.Commit(); |
|
471 |
ReleaseCOMObjects(modelItem); |
|
472 |
} |
|
473 |
} |
|
474 |
} |
|
475 |
ReleaseCOMObjects(symbol); |
|
476 |
} |
|
477 |
} |
|
478 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
479 |
} |
|
390 |
foreach (LMRelationship relationship in currentDrawing.Relationships) |
|
391 |
{ |
|
392 |
foreach (LMInconsistency inconsistency in relationship.Inconsistencies) |
|
393 |
{ |
|
394 |
if (inconsistency.get_InconsistencyTypeIndex() == 1) |
|
395 |
{ |
|
396 |
LMAAttribute attribute1 = ((dynamic)relationship.Item1RepresentationObject).ModelItemObject.Attributes[inconsistency.get_PropNameItem1()]; |
|
397 |
LMAAttribute attribute2 = ((dynamic)relationship.Item2RepresentationObject).ModelItemObject.Attributes[inconsistency.get_PropNameItem2()]; |
|
398 |
if (attribute1 != null && !DBNull.Value.Equals(attribute1.get_Value())) |
|
399 |
attribute1.set_Value(DBNull.Value); |
|
400 |
if (attribute2 != null && !DBNull.Value.Equals(attribute2.get_Value())) |
|
401 |
attribute2.set_Value(DBNull.Value); |
|
402 |
inconsistency.Commit(); |
|
403 |
} |
|
404 |
} |
|
405 |
} |
|
406 |
|
|
407 |
//List<string> endClearModelItemID = new List<string>(); |
|
408 |
//for (int i = 0; i < document.LINES.Count; i++) |
|
409 |
//{ |
|
410 |
// Line item = document.LINES[i]; |
|
411 |
// string modelItemID = item.SPPID.ModelItemId; |
|
412 |
// if (!string.IsNullOrEmpty(modelItemID)) |
|
413 |
// { |
|
414 |
// LMModelItem modelItem = dataSource.GetModelItem(modelItemID); |
|
415 |
// if (modelItem != null) |
|
416 |
// { |
|
417 |
// LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
418 |
// if (attribute != null) |
|
419 |
// attribute.set_Value(DBNull.Value); |
|
420 |
|
|
421 |
// modelItem.Commit(); |
|
422 |
// ReleaseCOMObjects(modelItem); |
|
423 |
// } |
|
424 |
// } |
|
425 |
// if (!endClearModelItemID.Contains(modelItemID)) |
|
426 |
// endClearModelItemID.Add(modelItemID); |
|
427 |
// SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
428 |
//} |
|
429 |
//for (int i = 0; i < document.SYMBOLS.Count; i++) |
|
430 |
//{ |
|
431 |
// Symbol item = document.SYMBOLS[i]; |
|
432 |
// string repID = item.SPPID.RepresentationId; |
|
433 |
// string modelItemID = item.SPPID.ModelItemID; |
|
434 |
// if (!string.IsNullOrEmpty(modelItemID)) |
|
435 |
// { |
|
436 |
// LMModelItem modelItem = dataSource.GetModelItem(modelItemID); |
|
437 |
// if (modelItem != null) |
|
438 |
// { |
|
439 |
// LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
440 |
// if (attribute != null) |
|
441 |
// attribute.set_Value(DBNull.Value); |
|
442 |
// attribute = modelItem.Attributes["PipingPoint1.NominalDiameter"]; |
|
443 |
// if (attribute != null) |
|
444 |
// attribute.set_Value(DBNull.Value); |
|
445 |
// attribute = modelItem.Attributes["PipingPoint2.NominalDiameter"]; |
|
446 |
// if (attribute != null) |
|
447 |
// attribute.set_Value(DBNull.Value); |
|
448 |
// modelItem.Commit(); |
|
449 |
|
|
450 |
// modelItem.Commit(); |
|
451 |
// ReleaseCOMObjects(modelItem); |
|
452 |
// } |
|
453 |
// } |
|
454 |
// if (!string.IsNullOrEmpty(repID)) |
|
455 |
// { |
|
456 |
// LMSymbol symbol = dataSource.GetSymbol(repID); |
|
457 |
// if (symbol != null) |
|
458 |
// { |
|
459 |
// foreach (LMConnector connector in symbol.Connect1Connectors) |
|
460 |
// { |
|
461 |
// if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID)) |
|
462 |
// { |
|
463 |
// endClearModelItemID.Add(connector.ModelItemID); |
|
464 |
// LMModelItem modelItem = connector.ModelItemObject; |
|
465 |
// if (modelItem != null) |
|
466 |
// { |
|
467 |
// LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
468 |
// if (attribute != null) |
|
469 |
// attribute.set_Value(DBNull.Value); |
|
470 |
|
|
471 |
// modelItem.Commit(); |
|
472 |
// ReleaseCOMObjects(modelItem); |
|
473 |
// } |
|
474 |
// } |
|
475 |
// } |
|
476 |
// foreach (LMConnector connector in symbol.Connect2Connectors) |
|
477 |
// { |
|
478 |
// if (connector.get_ItemStatus() == "Active" && !endClearModelItemID.Contains(connector.ModelItemID)) |
|
479 |
// { |
|
480 |
// endClearModelItemID.Add(connector.ModelItemID); |
|
481 |
// LMModelItem modelItem = connector.ModelItemObject; |
|
482 |
// if (modelItem != null) |
|
483 |
// { |
|
484 |
// LMAAttribute attribute = modelItem.Attributes["NominalDiameter"]; |
|
485 |
// if (attribute != null) |
|
486 |
// attribute.set_Value(DBNull.Value); |
|
487 |
|
|
488 |
// modelItem.Commit(); |
|
489 |
// ReleaseCOMObjects(modelItem); |
|
490 |
// } |
|
491 |
// } |
|
492 |
// } |
|
493 |
// ReleaseCOMObjects(symbol); |
|
494 |
// } |
|
495 |
// } |
|
496 |
// SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
497 |
//} |
|
480 | 498 |
SetSystemEditingCommand(true); |
481 | 499 |
} |
482 | 500 |
private void RunEndBreakModeling() |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
206 | 206 |
|
207 | 207 |
LMDrawing currentDrawing = ((dynamic)drawings).Nth(1); |
208 | 208 |
|
209 |
|
|
209 |
foreach (LMRelationship relationship in currentDrawing.Relationships) |
|
210 |
{ |
|
211 |
foreach (LMInconsistency inconsistency in relationship.Inconsistencies) |
|
212 |
{ |
|
213 |
if (inconsistency.get_InconsistencyTypeIndex() == 1) |
|
214 |
{ |
|
215 |
LMAAttribute attribute1 = ((dynamic)relationship.Item1RepresentationObject).ModelItemObject.Attributes[inconsistency.get_PropNameItem1()]; |
|
216 |
LMAAttribute attribute2 = ((dynamic)relationship.Item2RepresentationObject).ModelItemObject.Attributes[inconsistency.get_PropNameItem2()]; |
|
217 |
if (!DBNull.Value.Equals(attribute1.get_Value())) |
|
218 |
attribute1.set_Value(DBNull.Value); |
|
219 |
if (!DBNull.Value.Equals(attribute2.get_Value())) |
|
220 |
attribute2.set_Value(DBNull.Value); |
|
221 |
inconsistency.Commit(); |
|
222 |
} |
|
223 |
} |
|
224 |
} |
|
210 | 225 |
|
211 | 226 |
//_LMAItem item = _placement.PIDCreateItem(@"\Piping\Routing\Process Lines\Primary Piping.sym"); |
212 | 227 |
//PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
내보내기 Unified diff