개정판 f23488ca
Set to change TypicalMode for Find function (temporary code until the right code is found)
Change-Id: I27d06ced9f132ad423c4063f527f0f4d3a9dfbfc
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
200 | 200 |
{ |
201 | 201 |
if (!passTypicalMode) |
202 | 202 |
{ |
203 |
string dummyRepID = string.Empty; |
|
204 |
string dummyModelItemId = string.Empty; |
|
205 |
LMSymbol lMSymbol = _placement.PIDPlaceSymbol(@"\Piping\Fittings\Flanges and Unions\Flange.sym", 0, 0); |
|
206 |
if (lMSymbol != null) |
|
203 |
try |
|
207 | 204 |
{ |
208 |
lMSymbol.Commit(); |
|
209 |
dummyRepID = lMSymbol.AsLMRepresentation().Id; |
|
210 |
|
|
211 |
_LMAItem lMAItem = _placement.PIDCreateItem(@"\Piping\Routing\Process Lines\Secondary Piping.sym"); |
|
212 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
|
213 |
placeRunInputs.AddSymbolTarget(lMSymbol, 0, 0); |
|
214 |
placeRunInputs.AddPoint(-1, -1); |
|
215 |
LMConnector conn = _placement.PIDPlaceRun(lMAItem, placeRunInputs); |
|
216 |
if (conn != null) |
|
217 |
{ |
|
218 |
conn.Commit(); |
|
219 |
dummyModelItemId = conn.ModelItemID; |
|
220 |
} |
|
221 |
ReleaseCOMObjects(lMSymbol); |
|
222 |
ReleaseCOMObjects(conn); |
|
223 |
} |
|
224 |
|
|
225 |
if (!string.IsNullOrWhiteSpace(dummyRepID)) |
|
226 |
{ |
|
227 |
lMSymbol = dataSource.GetSymbol(dummyRepID); |
|
205 |
string dummyRepID = string.Empty; |
|
206 |
string dummyModelItemId = string.Empty; |
|
207 |
LMSymbol lMSymbol = _placement.PIDPlaceSymbol(@"\Piping\Fittings\Flanges and Unions\Flange.sym", 0, 0); |
|
228 | 208 |
if (lMSymbol != null) |
229 | 209 |
{ |
230 |
_placement.PIDRemovePlacement(lMSymbol.AsLMRepresentation()); |
|
231 | 210 |
lMSymbol.Commit(); |
211 |
dummyRepID = lMSymbol.AsLMRepresentation().Id; |
|
212 |
|
|
213 |
_LMAItem lMAItem = _placement.PIDCreateItem(@"\Piping\Routing\Process Lines\Secondary Piping.sym"); |
|
214 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
|
215 |
placeRunInputs.AddSymbolTarget(lMSymbol, 0, 0); |
|
216 |
placeRunInputs.AddPoint(-1, -1); |
|
217 |
LMConnector conn = _placement.PIDPlaceRun(lMAItem, placeRunInputs); |
|
218 |
if (conn != null) |
|
219 |
{ |
|
220 |
conn.Commit(); |
|
221 |
dummyModelItemId = conn.ModelItemID; |
|
222 |
} |
|
232 | 223 |
ReleaseCOMObjects(lMSymbol); |
224 |
ReleaseCOMObjects(conn); |
|
233 | 225 |
} |
234 |
} |
|
235 |
if (!string.IsNullOrWhiteSpace(dummyModelItemId)) |
|
236 |
{ |
|
237 |
LMModelItem modelItem = dataSource.GetModelItem(dummyModelItemId); |
|
238 |
if (modelItem != null) |
|
226 |
|
|
227 |
if (!string.IsNullOrWhiteSpace(dummyRepID)) |
|
239 | 228 |
{ |
240 |
foreach (LMRepresentation rep in modelItem.Representations) |
|
229 |
lMSymbol = dataSource.GetSymbol(dummyRepID); |
|
230 |
if (lMSymbol != null) |
|
241 | 231 |
{ |
242 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
|
243 |
_placement.PIDRemovePlacement(rep); |
|
232 |
_placement.PIDRemovePlacement(lMSymbol.AsLMRepresentation()); |
|
233 |
lMSymbol.Commit(); |
|
234 |
ReleaseCOMObjects(lMSymbol); |
|
244 | 235 |
} |
245 |
ReleaseCOMObjects(modelItem); |
|
246 | 236 |
} |
237 |
if (!string.IsNullOrWhiteSpace(dummyModelItemId)) |
|
238 |
{ |
|
239 |
LMModelItem modelItem = dataSource.GetModelItem(dummyModelItemId); |
|
240 |
if (modelItem != null) |
|
241 |
{ |
|
242 |
foreach (LMRepresentation rep in modelItem.Representations) |
|
243 |
{ |
|
244 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
|
245 |
_placement.PIDRemovePlacement(rep); |
|
246 |
} |
|
247 |
ReleaseCOMObjects(modelItem); |
|
248 |
} |
|
249 |
} |
|
250 |
} |
|
251 |
catch |
|
252 |
{ |
|
247 | 253 |
} |
248 | 254 |
} |
249 | 255 |
|
내보내기 Unified diff