개정판 77d6e710
dev issue #000 : 심볼 대칭이동 수정
Change-Id: I03a0161badffe9be554155b1b96902c00ec80f82
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
392 | 392 |
moveSymbol2d.GetOrigin(out x2, out y2); |
393 | 393 |
double distance = SPPIDUtil.CalcPointToPointdDistance(x, y, x1, y1); |
394 | 394 |
|
395 |
string symbol1RepID; |
|
396 |
string symbol2RepID; |
|
395 | 397 |
List<Point2d> point2ds; |
396 | 398 |
if (i == 0) |
397 |
point2ds = FindAllPoint2d(dataSource, centerRepID, item.Value[i]); |
|
399 |
{ |
|
400 |
symbol1RepID = centerRepID; |
|
401 |
symbol2RepID = item.Value[i]; |
|
402 |
} |
|
398 | 403 |
else |
399 |
point2ds = FindAllPoint2d(dataSource, item.Value[i - 1], item.Value[i]); |
|
404 |
{ |
|
405 |
symbol1RepID = item.Value[i - 1]; |
|
406 |
symbol2RepID = item.Value[i]; |
|
407 |
} |
|
408 |
point2ds = FindAllPoint2d(dataSource, symbol1RepID, symbol2RepID); |
|
400 | 409 |
double moveX = 0; |
401 | 410 |
double moveY = 0; |
402 | 411 |
|
... | ... | |
412 | 421 |
moveSymbol2d.Move(0, 0, moveX, moveY); |
413 | 422 |
MovePoint2d(dataSource, item.Value[i], arrow, moveX, moveY); |
414 | 423 |
foreach (var point in point2ds) |
424 |
{ |
|
425 |
LMSymbol branch = dataSource.GetSymbol(GetRepresentationId(point)); |
|
426 |
LMSymbol connSymbol = GetFirstSymbolBySlope(dataSource, branch, symbol1RepID, symbol2RepID); |
|
415 | 427 |
point.Move(0, 0, moveX, moveY); |
428 |
if (connSymbol != null) |
|
429 |
{ |
|
430 |
Symbol2d connSymbol2d = GetSymbol2DByRepID(dataSource, connSymbol.AsLMRepresentation().Id); |
|
431 |
connSymbol2d.Move(0, 0, moveX, moveY); |
|
432 |
ReleaseCOMObjects(connSymbol); |
|
433 |
} |
|
434 |
ReleaseCOMObjects(branch); |
|
435 |
} |
|
436 |
|
|
416 | 437 |
} |
417 | 438 |
} |
418 | 439 |
} |
419 | 440 |
} |
441 |
|
|
442 |
private LMSymbol GetFirstSymbolBySlope(LMADataSource dataSource, LMSymbol branch, string symbol1RepID, string symbol2RepID) |
|
443 |
{ |
|
444 |
LMSymbol result = null; |
|
445 |
foreach (LMConnector connector in branch.Connect1Connectors) |
|
446 |
{ |
|
447 |
if (connector.ConnectItem1SymbolObject != null && |
|
448 |
connector.ConnectItem1SymbolObject.get_ItemStatus() == "Active" && |
|
449 |
connector.ConnectItem1SymbolObject.get_RepresentationType() != "Branch") |
|
450 |
{ |
|
451 |
string repID = connector.ConnectItem1SymbolObject.AsLMRepresentation().Id; |
|
452 |
if (repID != symbol1RepID && repID != symbol2RepID) |
|
453 |
result = connector.ConnectItem1SymbolObject; |
|
454 |
} |
|
455 |
|
|
456 |
if (connector.ConnectItem2SymbolObject != null && |
|
457 |
connector.ConnectItem2SymbolObject.get_ItemStatus() == "Active" && |
|
458 |
connector.ConnectItem2SymbolObject.get_RepresentationType() != "Branch") |
|
459 |
{ |
|
460 |
string repID = connector.ConnectItem2SymbolObject.AsLMRepresentation().Id; |
|
461 |
if (repID != symbol1RepID && repID != symbol2RepID) |
|
462 |
result = connector.ConnectItem2SymbolObject; |
|
463 |
} |
|
464 |
} |
|
465 |
|
|
466 |
foreach (LMConnector connector in branch.Connect2Connectors) |
|
467 |
{ |
|
468 |
if (connector.ConnectItem1SymbolObject != null && |
|
469 |
connector.ConnectItem1SymbolObject.get_ItemStatus() == "Active" && |
|
470 |
connector.ConnectItem1SymbolObject.get_RepresentationType() != "Branch") |
|
471 |
{ |
|
472 |
string repID = connector.ConnectItem1SymbolObject.AsLMRepresentation().Id; |
|
473 |
if (repID != symbol1RepID && repID != symbol2RepID) |
|
474 |
result = connector.ConnectItem1SymbolObject; |
|
475 |
} |
|
476 |
|
|
477 |
if (connector.ConnectItem2SymbolObject != null && |
|
478 |
connector.ConnectItem2SymbolObject.get_ItemStatus() == "Active" && |
|
479 |
connector.ConnectItem2SymbolObject.get_RepresentationType() != "Branch") |
|
480 |
{ |
|
481 |
string repID = connector.ConnectItem2SymbolObject.AsLMRepresentation().Id; |
|
482 |
if (repID != symbol1RepID && repID != symbol2RepID) |
|
483 |
result = connector.ConnectItem2SymbolObject; |
|
484 |
} |
|
485 |
} |
|
486 |
|
|
487 |
|
|
488 |
return result; |
|
489 |
} |
|
420 | 490 |
private string GetRepresentationId(Symbol2d symbol) |
421 | 491 |
{ |
422 | 492 |
foreach (var attributes in symbol.AttributeSets) |
... | ... | |
433 | 503 |
} |
434 | 504 |
return null; |
435 | 505 |
} |
506 |
private string GetRepresentationId(Point2d point2d) |
|
507 |
{ |
|
508 |
foreach (var attributes in point2d.AttributeSets) |
|
509 |
{ |
|
510 |
foreach (var attribute in attributes) |
|
511 |
{ |
|
512 |
string name = attribute.Name; |
|
513 |
object value = attribute.GetValue(); |
|
514 |
if (name == "DrawingID") |
|
515 |
{ |
|
516 |
return value.ToString(); |
|
517 |
} |
|
518 |
} |
|
519 |
} |
|
520 |
return null; |
|
521 |
} |
|
436 | 522 |
private List<List<string>> SetSymbol(LMADataSource dataSource, string rep, double x, double y, int count) |
437 | 523 |
{ |
438 | 524 |
LMSymbol _LMSymbol = dataSource.GetSymbol(rep); |
내보내기 Unified diff