개정판 81c6b53c
Add Solution File. Change name.
Change-Id: Idea2bf4c9b3ac39a6519bb26f7e5e9bbb456b9f1
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
1632 | 1632 |
} |
1633 | 1633 |
} |
1634 | 1634 |
|
1635 |
_LMAItem _LMAItem = _placement.PIDCreateItem(sppidLine);
|
|
1635 |
_LMAItem lMAItem = _placement.PIDCreateItem(sppidLine);
|
|
1636 | 1636 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
1637 | 1637 |
placeRunInputs.AddPoint(-1, -1); |
1638 | 1638 |
placeRunInputs.AddSymbolTarget(_TargetItem, lineX, lineY); |
1639 |
tempConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
1639 |
tempConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
1640 | 1640 |
if (tempConnector != null) |
1641 | 1641 |
tempConnector.Commit(); |
1642 |
ReleaseCOMObjects(_LMAItem);
|
|
1643 |
_LMAItem = null;
|
|
1642 |
ReleaseCOMObjects(lMAItem);
|
|
1643 |
lMAItem = null;
|
|
1644 | 1644 |
ReleaseCOMObjects(placeRunInputs); |
1645 | 1645 |
placeRunInputs = null; |
1646 | 1646 |
} |
... | ... | |
2615 | 2615 |
bool diagonal = false; |
2616 | 2616 |
if (currentLine.SlopeType != SlopeType.HORIZONTAL && currentLine.SlopeType != SlopeType.VERTICAL) |
2617 | 2617 |
diagonal = true; |
2618 |
_LMAItem _LMAItem = _placement.PIDCreateItem(currentLine.SPPID.MAPPINGNAME);
|
|
2618 |
_LMAItem lMAItem = _placement.PIDCreateItem(currentLine.SPPID.MAPPINGNAME);
|
|
2619 | 2619 |
if (currentLine.SPPID.MAPPINGNAME != @"\Piping\Routing\Process Lines\Secondary Piping.sym") |
2620 | 2620 |
{ |
2621 | 2621 |
currentLine.SPPID.MAPPINGNAME = currentLine.SPPID.MAPPINGNAME; |
2622 | 2622 |
} |
2623 |
LMSymbol _LMSymbolStart = null;
|
|
2624 |
LMSymbol _LMSymbolEnd = null;
|
|
2623 |
LMSymbol lMSymbolStart = null;
|
|
2624 |
LMSymbol lMSymbolEnd = null;
|
|
2625 | 2625 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
2626 | 2626 |
foreach (var connector in currentLine.CONNECTORS) |
2627 | 2627 |
{ |
... | ... | |
2636 | 2636 |
GetTargetSymbolConnectorPoint(targetSymbol.CONNECTORS.Find(z => z.ConnectedObject == currentLine), targetSymbol, ref x, ref y); |
2637 | 2637 |
if (currentLine.CONNECTORS.IndexOf(connector) == 0) |
2638 | 2638 |
{ |
2639 |
_LMSymbolStart = GetTargetSymbol(targetSymbol, currentLine);
|
|
2640 |
if (_LMSymbolStart != null)
|
|
2641 |
placeRunInputs.AddSymbolTarget(_LMSymbolStart, x, y, diagonal);
|
|
2639 |
lMSymbolStart = GetTargetSymbol(targetSymbol, currentLine);
|
|
2640 |
if (lMSymbolStart != null)
|
|
2641 |
placeRunInputs.AddSymbolTarget(lMSymbolStart, x, y, diagonal);
|
|
2642 | 2642 |
else |
2643 | 2643 |
placeRunInputs.AddPoint(x, y); |
2644 | 2644 |
} |
2645 | 2645 |
else |
2646 | 2646 |
{ |
2647 |
_LMSymbolEnd = GetTargetSymbol(targetSymbol, currentLine);
|
|
2648 |
if (_LMSymbolEnd != null)
|
|
2649 |
placeRunInputs.AddSymbolTarget(_LMSymbolEnd, x, y, diagonal);
|
|
2647 |
lMSymbolEnd = GetTargetSymbol(targetSymbol, currentLine);
|
|
2648 |
if (lMSymbolEnd != null)
|
|
2649 |
placeRunInputs.AddSymbolTarget(lMSymbolEnd, x, y, diagonal);
|
|
2650 | 2650 |
else |
2651 | 2651 |
placeRunInputs.AddPoint(x, y); |
2652 | 2652 |
} |
... | ... | |
2714 | 2714 |
placeRunInputs.AddPoint(x, y); |
2715 | 2715 |
} |
2716 | 2716 |
|
2717 |
LMConnector _lMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
2718 |
if (_lMConnector != null)
|
|
2717 |
LMConnector lMConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
2718 |
if (lMConnector != null) |
|
2719 | 2719 |
{ |
2720 |
_lMConnector.Commit();
|
|
2721 |
currentLine.SPPID.ModelItemId = _lMConnector.ModelItemID;
|
|
2720 |
lMConnector.Commit(); |
|
2721 |
currentLine.SPPID.ModelItemId = lMConnector.ModelItemID; |
|
2722 | 2722 |
|
2723 | 2723 |
bool bRemodelingStart = false; |
2724 |
if (_LMSymbolStart != null)
|
|
2725 |
NeedReModeling(currentLine, _LMSymbolStart, ref bRemodelingStart);
|
|
2724 |
if (lMSymbolStart != null)
|
|
2725 |
NeedReModeling(currentLine, lMSymbolStart, ref bRemodelingStart);
|
|
2726 | 2726 |
bool bRemodelingEnd = false; |
2727 |
if (_LMSymbolEnd != null)
|
|
2728 |
NeedReModeling(currentLine, _LMSymbolEnd, ref bRemodelingEnd);
|
|
2727 |
if (lMSymbolEnd != null)
|
|
2728 |
NeedReModeling(currentLine, lMSymbolEnd, ref bRemodelingEnd);
|
|
2729 | 2729 |
|
2730 | 2730 |
if (bRemodelingStart || bRemodelingEnd) |
2731 |
ReModelingLine(currentLine, _lMConnector, _LMSymbolStart, _LMSymbolEnd, bRemodelingStart, bRemodelingEnd);
|
|
2731 |
ReModelingLine(currentLine, lMConnector, lMSymbolStart, lMSymbolEnd, bRemodelingStart, bRemodelingEnd);
|
|
2732 | 2732 |
|
2733 | 2733 |
FlowMarkModeling(currentLine); |
2734 | 2734 |
|
2735 |
ReleaseCOMObjects(_lMConnector);
|
|
2735 |
ReleaseCOMObjects(lMConnector); |
|
2736 | 2736 |
|
2737 | 2737 |
LMModelItem modelItem = dataSource.GetModelItem(currentLine.SPPID.ModelItemId); |
2738 | 2738 |
if (modelItem != null) |
... | ... | |
2760 | 2760 |
foreach (var item in removeLines) |
2761 | 2761 |
RemoveLineForModeling(item as Line); |
2762 | 2762 |
|
2763 |
ReleaseCOMObjects(_LMAItem);
|
|
2764 |
_LMAItem = null;
|
|
2763 |
ReleaseCOMObjects(lMAItem);
|
|
2764 |
lMAItem = null;
|
|
2765 | 2765 |
ReleaseCOMObjects(placeRunInputs); |
2766 | 2766 |
placeRunInputs = null; |
2767 |
ReleaseCOMObjects(_LMSymbolStart);
|
|
2768 |
_LMSymbolStart = null;
|
|
2769 |
ReleaseCOMObjects(_LMSymbolEnd);
|
|
2770 |
_LMSymbolEnd = null;
|
|
2767 |
ReleaseCOMObjects(lMSymbolStart);
|
|
2768 |
lMSymbolStart = null;
|
|
2769 |
ReleaseCOMObjects(lMSymbolEnd);
|
|
2770 |
lMSymbolEnd = null;
|
|
2771 | 2771 |
} |
2772 | 2772 |
} |
2773 | 2773 |
|
... | ... | |
2776 | 2776 |
bool diagonal = false; |
2777 | 2777 |
if (line.SlopeType != SlopeType.HORIZONTAL && line.SlopeType != SlopeType.VERTICAL) |
2778 | 2778 |
diagonal = true; |
2779 |
_LMAItem _LMAItem = _placement.PIDCreateItem(line.SPPID.MAPPINGNAME);
|
|
2780 |
LMSymbol _LMSymbolStart = null;
|
|
2781 |
LMSymbol _LMSymbolEnd = null;
|
|
2779 |
_LMAItem lMAItem = _placement.PIDCreateItem(line.SPPID.MAPPINGNAME);
|
|
2780 |
LMSymbol lMSymbolStart = null;
|
|
2781 |
LMSymbol lMSymbolEnd = null;
|
|
2782 | 2782 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
2783 | 2783 |
foreach (var connector in line.CONNECTORS) |
2784 | 2784 |
{ |
... | ... | |
2795 | 2795 |
GetTargetSymbolConnectorPoint(targetSymbol.CONNECTORS.Find(z => z.ConnectedObject == line), targetSymbol, ref x, ref y); |
2796 | 2796 |
if (line.CONNECTORS.IndexOf(connector) == 0) |
2797 | 2797 |
{ |
2798 |
_LMSymbolStart = GetTargetSymbol(targetSymbol, line);
|
|
2799 |
if (_LMSymbolStart != null)
|
|
2800 |
placeRunInputs.AddSymbolTarget(_LMSymbolStart, x, y, diagonal);
|
|
2798 |
lMSymbolStart = GetTargetSymbol(targetSymbol, line);
|
|
2799 |
if (lMSymbolStart != null)
|
|
2800 |
placeRunInputs.AddSymbolTarget(lMSymbolStart, x, y, diagonal);
|
|
2801 | 2801 |
else |
2802 | 2802 |
placeRunInputs.AddPoint(x, y); |
2803 | 2803 |
} |
2804 | 2804 |
else |
2805 | 2805 |
{ |
2806 |
_LMSymbolEnd = GetTargetSymbol(targetSymbol, line);
|
|
2807 |
if (_LMSymbolEnd != null)
|
|
2808 |
placeRunInputs.AddSymbolTarget(_LMSymbolEnd, x, y, diagonal);
|
|
2806 |
lMSymbolEnd = GetTargetSymbol(targetSymbol, line);
|
|
2807 |
if (lMSymbolEnd != null)
|
|
2808 |
placeRunInputs.AddSymbolTarget(lMSymbolEnd, x, y, diagonal);
|
|
2809 | 2809 |
else |
2810 | 2810 |
placeRunInputs.AddPoint(x, y); |
2811 | 2811 |
} |
... | ... | |
2832 | 2832 |
} |
2833 | 2833 |
} |
2834 | 2834 |
|
2835 |
LMConnector _lMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
2836 |
if (_lMConnector != null)
|
|
2837 |
_lMConnector.Commit();
|
|
2835 |
LMConnector lMConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
2836 |
if (lMConnector != null) |
|
2837 |
lMConnector.Commit(); |
|
2838 | 2838 |
|
2839 |
ReleaseCOMObjects(_LMAItem);
|
|
2840 |
_LMAItem = null;
|
|
2839 |
ReleaseCOMObjects(lMAItem);
|
|
2840 |
lMAItem = null;
|
|
2841 | 2841 |
ReleaseCOMObjects(placeRunInputs); |
2842 | 2842 |
placeRunInputs = null; |
2843 |
ReleaseCOMObjects(_LMSymbolStart);
|
|
2844 |
_LMSymbolStart = null;
|
|
2845 |
ReleaseCOMObjects(_LMSymbolEnd);
|
|
2846 |
_LMSymbolEnd = null;
|
|
2843 |
ReleaseCOMObjects(lMSymbolStart);
|
|
2844 |
lMSymbolStart = null;
|
|
2845 |
ReleaseCOMObjects(lMSymbolEnd);
|
|
2846 |
lMSymbolEnd = null;
|
|
2847 | 2847 |
|
2848 |
return _lMConnector;
|
|
2848 |
return lMConnector; |
|
2849 | 2849 |
} |
2850 | 2850 |
|
2851 | 2851 |
private void RemoveLineForModeling(Line line) |
... | ... | |
3121 | 3121 |
bool diagonal = false; |
3122 | 3122 |
if (line.SlopeType != SlopeType.HORIZONTAL && line.SlopeType != SlopeType.VERTICAL) |
3123 | 3123 |
diagonal = true; |
3124 |
_LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3124 |
_LMAItem lMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3125 | 3125 |
LMConnector newConnector = null; |
3126 | 3126 |
dynamic OID = prevLMConnector.get_GraphicOID().ToString(); |
3127 | 3127 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID]; |
... | ... | |
3192 | 3192 |
} |
3193 | 3193 |
|
3194 | 3194 |
_placement.PIDRemovePlacement(prevLMConnector.AsLMRepresentation()); |
3195 |
newConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
3195 |
newConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
3196 | 3196 |
|
3197 | 3197 |
ReleaseCOMObjects(placeRunInputs); |
3198 |
ReleaseCOMObjects(_LMAItem);
|
|
3198 |
ReleaseCOMObjects(lMAItem);
|
|
3199 | 3199 |
ReleaseCOMObjects(modelItem); |
3200 | 3200 |
|
3201 | 3201 |
if (newConnector != null) |
... | ... | |
3203 | 3203 |
newConnector.Commit(); |
3204 | 3204 |
if (startSymbol != null && bStart) |
3205 | 3205 |
{ |
3206 |
_LMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3206 |
lMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3207 | 3207 |
placeRunInputs = new PlaceRunInputs(); |
3208 | 3208 |
placeRunInputs.AddSymbolTarget(startSymbol, vertices[0][0], vertices[0][1]); |
3209 | 3209 |
placeRunInputs.AddConnectorTarget(newConnector, vertices[0][0], vertices[0][1]); |
3210 |
LMConnector _LMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
3211 |
if (_LMConnector != null)
|
|
3210 |
LMConnector lMConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
3211 |
if (lMConnector != null)
|
|
3212 | 3212 |
{ |
3213 |
_LMConnector.Commit();
|
|
3213 |
lMConnector.Commit();
|
|
3214 | 3214 |
RemoveConnectorForReModelingLine(newConnector); |
3215 |
ZeroLengthModelItemID.Add(_LMConnector.ModelItemID);
|
|
3216 |
ReleaseCOMObjects(_LMConnector);
|
|
3215 |
ZeroLengthModelItemID.Add(lMConnector.ModelItemID);
|
|
3216 |
ReleaseCOMObjects(lMConnector);
|
|
3217 | 3217 |
} |
3218 | 3218 |
ReleaseCOMObjects(placeRunInputs); |
3219 |
ReleaseCOMObjects(_LMAItem);
|
|
3219 |
ReleaseCOMObjects(lMAItem);
|
|
3220 | 3220 |
} |
3221 | 3221 |
|
3222 | 3222 |
if (endSymbol != null && bEnd) |
... | ... | |
3227 | 3227 |
newConnector = dicVertices.First().Key; |
3228 | 3228 |
} |
3229 | 3229 |
|
3230 |
_LMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3230 |
lMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3231 | 3231 |
placeRunInputs = new PlaceRunInputs(); |
3232 | 3232 |
placeRunInputs.AddSymbolTarget(endSymbol, vertices[vertices.Count - 1][0], vertices[vertices.Count - 1][1]); |
3233 | 3233 |
placeRunInputs.AddConnectorTarget(newConnector, vertices[vertices.Count - 1][0], vertices[vertices.Count - 1][1]); |
3234 |
LMConnector _LMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
3235 |
if (_LMConnector != null)
|
|
3234 |
LMConnector lMConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
3235 |
if (lMConnector != null)
|
|
3236 | 3236 |
{ |
3237 |
_LMConnector.Commit();
|
|
3237 |
lMConnector.Commit();
|
|
3238 | 3238 |
RemoveConnectorForReModelingLine(newConnector); |
3239 |
ZeroLengthModelItemIDReverse.Add(_LMConnector.ModelItemID);
|
|
3240 |
ReleaseCOMObjects(_LMConnector);
|
|
3239 |
ZeroLengthModelItemIDReverse.Add(lMConnector.ModelItemID);
|
|
3240 |
ReleaseCOMObjects(lMConnector);
|
|
3241 | 3241 |
} |
3242 | 3242 |
ReleaseCOMObjects(placeRunInputs); |
3243 |
ReleaseCOMObjects(_LMAItem);
|
|
3243 |
ReleaseCOMObjects(lMAItem);
|
|
3244 | 3244 |
} |
3245 | 3245 |
|
3246 | 3246 |
line.SPPID.ModelItemId = newConnector.ModelItemID; |
... | ... | |
3456 | 3456 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
3457 | 3457 |
int verticesCount = lineStringGeometry.VertexCount; |
3458 | 3458 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
3459 |
_LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3459 |
_LMAItem lMAItem = _placement.PIDCreateItem(symbolPath);
|
|
3460 | 3460 |
|
3461 | 3461 |
if (Convert.ToBoolean(connector.get_IsZeroLength())) |
3462 | 3462 |
{ |
... | ... | |
3484 | 3484 |
} |
3485 | 3485 |
string oldModelItemId = connector.ModelItemID; |
3486 | 3486 |
_placement.PIDRemovePlacement(connector.AsLMRepresentation()); |
3487 |
newConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
|
|
3487 |
newConnector = _placement.PIDPlaceRun(lMAItem, placeRunInputs);
|
|
3488 | 3488 |
newConnector.Commit(); |
3489 | 3489 |
ZeroLengthSymbolToSymbolModelItemID.Add(newConnector.ModelItemID); |
3490 | 3490 |
if (!string.IsNullOrEmpty(flowDirection)) |
DTI_PID/SPPIDConverter/SPPIDConverter.sln | ||
---|---|---|
1 |
|
|
2 |
Microsoft Visual Studio Solution File, Format Version 12.00 |
|
3 |
# Visual Studio Version 16 |
|
4 |
VisualStudioVersion = 16.0.33027.164 |
|
5 |
MinimumVisualStudioVersion = 10.0.40219.1 |
|
6 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPPIDConverter", "SPPIDConverter.csproj", "{81BFB56B-05FE-4674-93C5-DDB2D3437F77}" |
|
7 |
EndProject |
|
8 |
Global |
|
9 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|
10 |
Debug|Any CPU = Debug|Any CPU |
|
11 |
Debug|x86 = Debug|x86 |
|
12 |
Release|Any CPU = Release|Any CPU |
|
13 |
Release|x86 = Release|x86 |
|
14 |
EndGlobalSection |
|
15 |
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|
16 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
17 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
18 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Debug|x86.ActiveCfg = Debug|x86 |
|
19 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Debug|x86.Build.0 = Debug|x86 |
|
20 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
21 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Release|Any CPU.Build.0 = Release|Any CPU |
|
22 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Release|x86.ActiveCfg = Release|x86 |
|
23 |
{81BFB56B-05FE-4674-93C5-DDB2D3437F77}.Release|x86.Build.0 = Release|x86 |
|
24 |
EndGlobalSection |
|
25 |
GlobalSection(SolutionProperties) = preSolution |
|
26 |
HideSolutionNode = FALSE |
|
27 |
EndGlobalSection |
|
28 |
GlobalSection(ExtensibilityGlobals) = postSolution |
|
29 |
SolutionGuid = {A5599D08-1282-443E-8849-9C468F2431A9} |
|
30 |
EndGlobalSection |
|
31 |
EndGlobal |
내보내기 Unified diff