개정판 02480ac1
dev issue #000 : SPPID Command 켜기/끄기 메서드, LineRemodeling Method 추가
Change-Id: I0c10e8d13ff462e487f06b17e80679f521b19490
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
83 | 83 |
return EquipCount + SymbolCount + LineCount + NoteCount + TextCount + EndBreakCount; |
84 | 84 |
} |
85 | 85 |
|
86 |
private void SetSystemEditingCommand(bool value) |
|
87 |
{ |
|
88 |
foreach (var item in radApp.Commands) |
|
89 |
{ |
|
90 |
if (item.Argument == "SystemEditingCmd.SystemEditing") |
|
91 |
{ |
|
92 |
if (item.Checked != value) |
|
93 |
{ |
|
94 |
radApp.RunMacro("systemeditingcmd.dll"); |
|
95 |
break; |
|
96 |
} |
|
97 |
|
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
|
|
86 | 102 |
/// <summary> |
87 | 103 |
/// 도면 단위당 실행되는 메서드 |
88 | 104 |
/// </summary> |
... | ... | |
103 | 119 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStep, AllCount); |
104 | 120 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText); |
105 | 121 |
|
106 |
//SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Group Symbol Modeling"); |
|
107 |
//List<List<Symbol>> symbolGroups = SPPIDUtil.GetThreeConnectedSymbolGroup(document); |
|
108 |
//foreach (List<Symbol> symbolGroup in symbolGroups) |
|
109 |
// SymbolModelingByThreeSymbolGroup(symbolGroup); |
|
122 |
SetSystemEditingCommand(false); |
|
110 | 123 |
|
111 | 124 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Priority Symbol Modeling"); |
112 | 125 |
List<Symbol> prioritySymbols = GetPrioritySymbol(); |
... | ... | |
173 | 186 |
foreach (var item in document.TEXTINFOS) |
174 | 187 |
TextModeling(item); |
175 | 188 |
|
189 |
SetSystemEditingCommand(true); |
|
190 |
|
|
176 | 191 |
// LineRun Line Join |
177 | 192 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Join LineRuns"); |
178 | 193 |
foreach (LineNumber lineNumber in document.LINENUMBERS) |
... | ... | |
244 | 259 |
|
245 | 260 |
} |
246 | 261 |
|
262 |
/// <summary> |
|
263 |
/// DrawingName, DrawingNumber를 확인하여 중복이 있으면 _1을 붙이고 +1씩 한다. |
|
264 |
/// </summary> |
|
265 |
/// <param name="drawingName"></param> |
|
266 |
/// <param name="drawingNumber"></param> |
|
247 | 267 |
private void GetDrawingNameAndNumber(ref string drawingName, ref string drawingNumber) |
248 | 268 |
{ |
249 | 269 |
LMDrawings drawings = new LMDrawings(); |
... | ... | |
1648 | 1668 |
ReleaseCOMObjects(_LMAItem); |
1649 | 1669 |
} |
1650 | 1670 |
|
1671 |
private LMConnector ReModelingLMConnector(LMConnector connector) |
|
1672 |
{ |
|
1673 |
LMConnector newConnector = null; |
|
1674 |
dynamic OID = connector.get_GraphicOID(); |
|
1675 |
DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID]; |
|
1676 |
Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d; |
|
1677 |
int verticesCount = lineStringGeometry.VertexCount; |
|
1678 |
PlaceRunInputs placeRunInputs = new PlaceRunInputs(); |
|
1679 |
_LMAItem _LMAItem = _placement.PIDCreateItem(@"\Piping\Routing\Process Lines\Primary Piping.sym"); |
|
1680 |
|
|
1681 |
if (Convert.ToBoolean(connector.get_IsZeroLength())) |
|
1682 |
{ |
|
1683 |
double[] vertices = null; |
|
1684 |
lineStringGeometry.GetVertices(ref verticesCount, ref vertices); |
|
1685 |
double x = 0; |
|
1686 |
double y = 0; |
|
1687 |
lineStringGeometry.GetVertex(1, ref x, ref y); |
|
1688 |
|
|
1689 |
placeRunInputs.AddSymbolTarget(connector.ConnectItem1SymbolObject, x, y); |
|
1690 |
placeRunInputs.AddSymbolTarget(connector.ConnectItem2SymbolObject, x, y); |
|
1691 |
|
|
1692 |
_placement.PIDRemovePlacement(connector.AsLMRepresentation()); |
|
1693 |
newConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs); |
|
1694 |
} |
|
1695 |
else |
|
1696 |
{ |
|
1697 |
List<double[]> vertices = new List<double[]>(); |
|
1698 |
for (int i = 1; i <= verticesCount; i++) |
|
1699 |
{ |
|
1700 |
double x = 0; |
|
1701 |
double y = 0; |
|
1702 |
lineStringGeometry.GetVertex(i, ref x, ref y); |
|
1703 |
vertices.Add(new double[] { x, y }); |
|
1704 |
} |
|
1705 |
|
|
1706 |
for (int i = 0; i < vertices.Count; i++) |
|
1707 |
{ |
|
1708 |
double[] points = vertices[i]; |
|
1709 |
if (i == 0) |
|
1710 |
{ |
|
1711 |
if (connector.ConnectItem1SymbolObject != null) |
|
1712 |
placeRunInputs.AddSymbolTarget(connector.ConnectItem1SymbolObject, points[0], points[1]); |
|
1713 |
else |
|
1714 |
placeRunInputs.AddPoint(points[0], points[1]); |
|
1715 |
} |
|
1716 |
else if (i == vertices.Count - 1) |
|
1717 |
{ |
|
1718 |
if (connector.ConnectItem2SymbolObject != null) |
|
1719 |
placeRunInputs.AddSymbolTarget(connector.ConnectItem2SymbolObject, points[0], points[1]); |
|
1720 |
else |
|
1721 |
placeRunInputs.AddPoint(points[0], points[1]); |
|
1722 |
} |
|
1723 |
else |
|
1724 |
placeRunInputs.AddPoint(points[0], points[1]); |
|
1725 |
} |
|
1726 |
|
|
1727 |
List<Line> lines = SPPIDUtil.FindLinesByModelId(document, connector.ModelItemID); |
|
1728 |
|
|
1729 |
_placement.PIDRemovePlacement(connector.AsLMRepresentation()); |
|
1730 |
newConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs); |
|
1731 |
|
|
1732 |
foreach (var line in lines) |
|
1733 |
line.SPPID.ModelItemId = newConnector.ModelItemID; |
|
1734 |
} |
|
1735 |
|
|
1736 |
|
|
1737 |
return newConnector; |
|
1738 |
} |
|
1739 |
|
|
1651 | 1740 |
/// <summary> |
1652 | 1741 |
/// SpecBreak Modeling 메서드 |
1653 | 1742 |
/// </summary> |
... | ... | |
1804 | 1893 |
|
1805 | 1894 |
if (targetLMConnector != null) |
1806 | 1895 |
{ |
1896 |
targetLMConnector = ReModelingLMConnector(targetLMConnector); |
|
1897 |
|
|
1807 | 1898 |
string MappingPath = specBreak.SPPID.MAPPINGNAME; |
1808 | 1899 |
Array array = new double[] { 0, specBreak.SPPID.ORIGINAL_X, specBreak.SPPID.ORIGINAL_Y }; |
1809 | 1900 |
LMLabelPersist _LmLabelPersist = _placement.PIDPlaceLabel(MappingPath, ref array, Rotation: specBreak.ANGLE, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: true); |
1810 | 1901 |
|
1811 | 1902 |
if (_LmLabelPersist != null) |
1812 | 1903 |
{ |
1904 |
specBreak.SPPID.RepresentationId = _LmLabelPersist.AsLMRepresentation().Id; |
|
1813 | 1905 |
ReleaseCOMObjects(_LmLabelPersist); |
1814 | 1906 |
} |
1815 | 1907 |
} |
내보내기 Unified diff