개정판 7e4a64a3
dev issue #000 : fix bug
Change-Id: Ic0067f9d1e61122a42702392e2bddc79659dad45
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
422 | 422 |
!SPPIDUtil.IsBranchLine(line, connector.ConnectedObject as Line)) |
423 | 423 |
{ |
424 | 424 |
Line connLine = connector.ConnectedObject as Line; |
425 |
if (line.SPPID.ModelItemId != connLine.SPPID.ModelItemId) |
|
425 |
if (line.SPPID.ModelItemId != connLine.SPPID.ModelItemId && !string.IsNullOrEmpty(line.SPPID.ModelItemId) && !string.IsNullOrEmpty(connLine.SPPID.ModelItemId))
|
|
426 | 426 |
JoinPipeRun(connLine.SPPID.ModelItemId, line.SPPID.ModelItemId); |
427 | 427 |
} |
428 | 428 |
} |
... | ... | |
847 | 847 |
symbol.SPPID.GraphicOID = _LMSymbol.get_GraphicOID().ToString(); |
848 | 848 |
|
849 | 849 |
foreach (var item in symbol.ChildSymbols) |
850 |
CreateChildSymbol(item, _LMSymbol); |
|
850 |
CreateChildSymbol(item, _LMSymbol, symbol);
|
|
851 | 851 |
|
852 | 852 |
symbol.SPPID.SPPID_X = _LMSymbol.get_XCoordinate(); |
853 | 853 |
symbol.SPPID.SPPID_Y = _LMSymbol.get_YCoordinate(); |
... | ... | |
1025 | 1025 |
private void GetSPPIDSymbolRange(Symbol symbol, ref double[] range) |
1026 | 1026 |
{ |
1027 | 1027 |
LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
1028 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()]; |
|
1029 |
double x1 = 0; |
|
1030 |
double y1 = 0; |
|
1031 |
double x2 = 0; |
|
1032 |
double y2 = 0; |
|
1033 |
symbol2d.Range(out x1, out y1, out x2, out y2); |
|
1034 |
range = new double[] { x1, y1, x2, y2 }; |
|
1028 |
if (_TargetItem != null) |
|
1029 |
{ |
|
1030 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()]; |
|
1031 |
double x1 = 0; |
|
1032 |
double y1 = 0; |
|
1033 |
double x2 = 0; |
|
1034 |
double y2 = 0; |
|
1035 |
symbol2d.Range(out x1, out y1, out x2, out y2); |
|
1036 |
range = new double[] { x1, y1, x2, y2 }; |
|
1035 | 1037 |
|
1036 |
foreach (var childSymbol in symbol.ChildSymbols) |
|
1037 |
GetSPPIDChildSymbolRange(childSymbol, ref range); |
|
1038 |
foreach (var childSymbol in symbol.ChildSymbols)
|
|
1039 |
GetSPPIDChildSymbolRange(childSymbol, ref range);
|
|
1038 | 1040 |
|
1039 |
ReleaseCOMObjects(_TargetItem); |
|
1041 |
ReleaseCOMObjects(_TargetItem); |
|
1042 |
} |
|
1040 | 1043 |
} |
1041 | 1044 |
|
1042 | 1045 |
private void GetSPPIDSymbolRange(List<Symbol> symbols, ref double[] range) |
... | ... | |
1104 | 1107 |
private void GetSPPIDChildSymbolRange(ChildSymbol childSymbol, ref double[] range) |
1105 | 1108 |
{ |
1106 | 1109 |
LMSymbol _ChildSymbol = dataSource.GetSymbol(childSymbol.SPPID.RepresentationId); |
1107 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.get_GraphicOID().ToString()]; |
|
1108 |
double x1 = 0; |
|
1109 |
double y1 = 0; |
|
1110 |
double x2 = 0; |
|
1111 |
double y2 = 0; |
|
1112 |
symbol2d.Range(out x1, out y1, out x2, out y2); |
|
1113 |
range[0] = Math.Min(range[0], x1); |
|
1114 |
range[1] = Math.Min(range[1], y1); |
|
1115 |
range[2] = Math.Max(range[2], x2); |
|
1116 |
range[3] = Math.Max(range[3], y2); |
|
1117 |
|
|
1118 |
foreach (var loopChildSymbol in childSymbol.ChildSymbols) |
|
1119 |
GetSPPIDChildSymbolRange(loopChildSymbol, ref range); |
|
1110 |
if (_ChildSymbol != null) |
|
1111 |
{ |
|
1112 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_ChildSymbol.get_GraphicOID().ToString()]; |
|
1113 |
double x1 = 0; |
|
1114 |
double y1 = 0; |
|
1115 |
double x2 = 0; |
|
1116 |
double y2 = 0; |
|
1117 |
symbol2d.Range(out x1, out y1, out x2, out y2); |
|
1118 |
range[0] = Math.Min(range[0], x1); |
|
1119 |
range[1] = Math.Min(range[1], y1); |
|
1120 |
range[2] = Math.Max(range[2], x2); |
|
1121 |
range[3] = Math.Max(range[3], y2); |
|
1120 | 1122 |
|
1121 |
ReleaseCOMObjects(_ChildSymbol); |
|
1123 |
foreach (var loopChildSymbol in childSymbol.ChildSymbols) |
|
1124 |
GetSPPIDChildSymbolRange(loopChildSymbol, ref range); |
|
1125 |
ReleaseCOMObjects(_ChildSymbol); |
|
1126 |
} |
|
1122 | 1127 |
} |
1123 | 1128 |
|
1124 | 1129 |
/// <summary> |
... | ... | |
1488 | 1493 |
/// </summary> |
1489 | 1494 |
/// <param name="childSymbol"></param> |
1490 | 1495 |
/// <param name="parentSymbol"></param> |
1491 |
private void CreateChildSymbol(ChildSymbol childSymbol, LMSymbol parentSymbol) |
|
1496 |
private void CreateChildSymbol(ChildSymbol childSymbol, LMSymbol parentSymbol, Symbol parent)
|
|
1492 | 1497 |
{ |
1493 | 1498 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[parentSymbol.get_GraphicOID().ToString()]; |
1494 | 1499 |
double x1 = 0; |
... | ... | |
1502 | 1507 |
{ |
1503 | 1508 |
childSymbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
1504 | 1509 |
foreach (var item in childSymbol.ChildSymbols) |
1505 |
CreateChildSymbol(item, _LMSymbol); |
|
1510 |
CreateChildSymbol(item, _LMSymbol, parent);
|
|
1506 | 1511 |
} |
1512 |
else |
|
1513 |
Log.Write("Fail Child Symbol Modeling UID : " + parent.UID); |
|
1507 | 1514 |
|
1508 | 1515 |
|
1509 | 1516 |
ReleaseCOMObjects(_LMSymbol); |
... | ... | |
2444 | 2451 |
/// <param name="modelItemID2"></param> |
2445 | 2452 |
private void JoinPipeRun(string modelItemID1, string modelItemID2) |
2446 | 2453 |
{ |
2447 |
LMModelItem modelItem1 = dataSource.GetModelItem(modelItemID2);
|
|
2454 |
LMModelItem modelItem1 = dataSource.GetModelItem(modelItemID1);
|
|
2448 | 2455 |
_LMAItem item1 = modelItem1.AsLMAItem(); |
2449 |
LMModelItem modelItem2 = dataSource.GetModelItem(modelItemID1);
|
|
2456 |
LMModelItem modelItem2 = dataSource.GetModelItem(modelItemID2);
|
|
2450 | 2457 |
_LMAItem item2 = modelItem2.AsLMAItem(); |
2451 | 2458 |
|
2452 | 2459 |
// item2가 item1으로 조인 |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
186 | 186 |
else |
187 | 187 |
MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
188 | 188 |
} |
189 |
|
|
190 |
#region TEST |
|
189 | 191 |
bool first = true; |
190 | 192 |
LMDrawing currentDrawing; |
191 | 193 |
private void simpleButton1_Click(object sender, EventArgs e) |
... | ... | |
220 | 222 |
} |
221 | 223 |
} |
222 | 224 |
} |
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
|
225 | 227 |
//LMConnector connector = GetLMConnectorOnlyOne("E12B6DC30C224B51911F2AFFEFB8ED14"); |
226 | 228 |
//if (connector != null) |
227 | 229 |
//{ |
... | ... | |
282 | 284 |
// return vertices; |
283 | 285 |
//} |
284 | 286 |
} |
287 |
private void TESTLine() |
|
288 |
{ |
|
289 |
Placement _placement = new Placement(); |
|
290 |
LMADataSource dataSource = _placement.PIDDataSource;//placement.PIDDataSource; |
|
291 |
|
|
292 |
foreach (var attributes in radApp.ActiveSelectSet[0].AttributeSets) |
|
293 |
{ |
|
294 |
foreach (var attribute in attributes) |
|
295 |
{ |
|
296 |
if (attribute.Name == "ModelID") |
|
297 |
{ |
|
298 |
LMModelItem modelItem = dataSource.GetModelItem(attribute.GetValue().ToString()); |
|
299 |
foreach (LMRepresentation representation in modelItem.Representations) |
|
300 |
{ |
|
301 |
//representa |
|
302 |
} |
|
303 |
} |
|
304 |
} |
|
305 |
} |
|
306 |
} |
|
307 |
#endregion |
|
308 |
|
|
285 | 309 |
|
286 | 310 |
[DllImport("user32.dll")] |
287 | 311 |
public static extern int FindWindow(string lpClassName, string lpWindowName); |
내보내기 Unified diff