개정판 42c0013c
Flowdirection Update
DTI_PID/SPPIDConverter/Main.vb | ||
---|---|---|
1738 | 1738 |
Dim oSettings As Settings = New Settings() |
1739 | 1739 |
oSettings.ShowDialog() |
1740 | 1740 |
End Sub |
1741 | ||
1742 |
Private Sub Btn_TestNozzle_Click(sender As Object, e As EventArgs) Handles Btn_TestNozzle.Click |
|
1743 | ||
1744 |
Dim sVessel_ID As String = "841D5E640AE5421B9A017DDC2E87FF11" |
|
1745 |
Dim objVessel As LMVessel |
|
1746 |
objVessel = _Placement.PIDDataSource.GetVessel(sVessel_ID) |
|
1747 |
Dim oVesselLocation As LMLocations = objVessel.Locations |
|
1748 |
Dim symVessel As LMSymbol = _Placement.PIDDataSource.GetSymbol(objVessel.Representations.Nth(1).Id) |
|
1749 |
Dim XCoordinate As String = symVessel.Attributes("XCoordinate").Value |
|
1750 |
Dim YCoordinate As String = symVessel.Attributes("YCoordinate").Value |
|
1751 |
symVessel.Attributes("XCoordinate").Value = XCoordinate + 0.01 |
|
1752 |
symVessel.Attributes("YCoordinate").Value = YCoordinate + 0.01 |
|
1753 |
symVessel.Commit() |
|
1754 |
Dim sValve_ID As String = "DB7B0CA8A2664A6BA7A9615764BA62B0" |
|
1755 |
Dim objValve As LMSymbol |
|
1756 |
Dim objValves As LMPipingComp = _Placement.PIDDataSource.GetPipingComp(sValve_ID) |
|
1757 | ||
1758 |
objValve = _Placement.PIDDataSource.GetSymbol(objValves.Representations.Nth(1).Id) |
|
1759 |
objValve.Commit() |
|
1760 |
Dim dVesselX As Double = XCoordinate |
|
1761 |
Dim dVesselY As Double = YCoordinate |
|
1762 |
Dim X1 As Double, Y1 As Double, X2 As Double, Y2 As Double |
|
1763 | ||
1764 |
_Placement.PIDConnectPointLocation(objValve, 1, X1, Y1) |
|
1765 | ||
1766 |
_Placement.PIDConnectPointLocation(objValve, 2, X2, Y2) |
|
1767 | ||
1768 |
Dim nozzlename As String = "\Equipment Components\Nozzles\Flanged Nozzle.sym" |
|
1769 |
Dim dCalc_x As Double = 0 |
|
1770 |
Dim dCalc_y As Double = 0 |
|
1771 | ||
1772 |
If dVesselX - X2 > 0 Then |
|
1773 |
dCalc_x = dVesselX - (dVesselX - X2) |
|
1774 |
Else |
|
1775 |
dCalc_x = dVesselX + (X2 - dVesselX) |
|
1776 |
End If |
|
1777 |
If dVesselY - Y2 > 0 Then |
|
1778 |
dCalc_y = dVesselY - (dVesselY - Y2) |
|
1779 |
Else |
|
1780 |
dCalc_y = dVesselY + (Y2 - dVesselY) |
|
1781 |
End If |
|
1782 | ||
1783 | ||
1784 | ||
1785 | ||
1786 | ||
1787 |
Dim objNozzle As LMSymbol = _Placement.PIDPlaceSymbol(nozzlename, dCalc_x, dCalc_y, |
|
1788 |
TargetItem:=symVessel.AsLMRepresentation) |
|
1789 | ||
1790 |
Dim blnSuccess As Boolean = _Placement.PIDConnectPointLocation(objNozzle, 1, X1, Y1) |
|
1791 |
blnSuccess = _Placement.PIDConnectPointLocation(objNozzle, 2, X1, Y1) |
|
1792 | ||
1793 |
objValve = _Placement.PIDPlaceSymbol(objValve.FileName, X1, Y1, ExistingItem:=objValve.AsLMAItem, |
|
1794 |
TargetItem:=objNozzle.AsLMRepresentation) |
|
1795 | ||
1796 | ||
1797 | ||
1798 |
End Sub |
|
1741 | 1799 |
End Class |
1742 | 1800 | |
1743 | 1801 |
내보내기 Unified diff