Public Class Myform1
Private Sub Myform1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
'TODO: 这行代码将数据加载到表“MytestDataSet.KK”中。您可以根据需要移动或移除它。 Me.KKTableAdapter.Fill(Me.MytestDataSet.KK) End Sub
Public Function Max(ByVal X As Double, ByVal Y As Double) As Double If X >= Y Then Max = X Else Max = Y End If End Function
Public Function Min(ByVal x As Double, ByVal y As Double) As Double If x >= y Then Min = y Else Min = x End If End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim TestStr As String = ""
Dim i As Integer = MytestDataSet.Tables(0).Rows.Count Dim j As Integer = 0 Dim XHao As String = "" Dim Sn As String = "" Dim Un As String = ""
Dim XBeiP As New Point3d(0, 0, 0) '记下一个矿用设备插入位置 Dim XBei() As Point3d '矿用设备电缆动态数组 Dim C As Integer = 0 矿用设备数 Dim KguanP() As Point3d '矿用开关电缆动态数组 Dim KC As Integer = 0 '矿用开关数目 Dim Area As String 电缆截面积 Dim Chang As String '电缆长度 Dim K As Integer 用于接线循环 Dim KP1 As New Point3d(0, 0, 0) '用于开关与设备电缆接线,可作为随机点处理 Dim BP1 As New Point3d(0, 0, 0) '接线用 Dim BP2 As New Point3d(0, 0, 0) Dim BC As Integer = 0 '变压器数目
Dim BP() As Point3d
Dim GP As New Point3d(0, 0, 0) 高开的位置 Dim GPS() As Point3d
Dim GC As Integer = 0 '高开的数目 Dim IC As Double = 0 Dim Ij As Double = 0 Dim W As Integer = 0 Dim Xhao2 As String = "" Dim TestStr2 As String = ""
Dim Lin As String = "" 临时指针 Dim Head As String = "" '头指针 Dim Tail As String = "" '尾指针 Dim Pm() As Point3d : Dim Cm As Integer = 0 Dim Pk() As Point3d : Dim Ck As Integer = 0 Dim PB() As Point3d : Dim CB As Integer = 0 Dim LPk As New Point3d(0, 0, 0) Dim LPm As New Point3d(0, 0, 0) Dim MaxY As Double = 0 Dim MinX As Double = 0
Dim NPm As New Point3d(0, 0, 0) Dim LPb As New Point3d(0, 0, 0) Dim Lj As Integer = 0
For j = 0 To i - 1
TestStr = MytestDataSet.Tables(0).Rows(j).Item("类别") Select Case TestStr Case "矿用设备"
TestStr2 = MytestDataSet.Tables(0).Rows(j).Item("设备名称") XHao = MytestDataSet.Tables(0).Rows(j).Item("设备型号").ToString Sn = MytestDataSet.Tables(0).Rows(j).Item("Sn").ToString Un = MytestDataSet.Tables(0).Rows(j).Item("Un").ToString
Xhao2 = MytestDataSet.Tables(0).Rows(j).Item("电缆型号").ToString
Area = MytestDataSet.Tables(0).Rows(j).Item("电缆截面").ToString Chang = MytestDataSet.Tables(0).Rows(j).Item("电缆长度").ToString
IC = MytestDataSet.Tables(0).Rows(j).Item("电缆允许长时电流")
Head = MytestDataSet.Tables(0).Rows(j).Item("HeadPoint") 'If TestStr2 = "皮带机
' ModelSpace.Insert5("皮带机", XBeiP, New Scale3d(1), 0, ' ModelSpace.Equipment("矿用设备", XBeiP, New Scale3d(1), 0, Ij = Sn / Un / Sqrt(3)
XHao = XHao &; "-" &; Area &; "-" &; Chang
ModelSpace.Cable("矿用电缆", LPm, New Scale3d(1), 0, XHao, IC.ToString, Ij)
Select Case Lin Case "M" Cm = Cm + 1
ReDim Preserve Pm(Cm)
Pm(Cm - 1) = ModelSpace.PolarPoint(LPm, Atan(1) * 2, 50) NPm = ModelSpace.PolarPoint(NPm, 0, 30) '下一个设备插入位置(间距 Case "K" Ck = Ck = 1
ReDim Preserve Pk(Ck)
Pk(Ck - 1) = ModelSpace.PolarPoint(LPk, PI / 2, 28 / 2 + 50)
Case "B" CB = CB + 1
ReDim Preserve PB(CB)
PB(CB - 1) = ModelSpace.PolarPoint(LPk, PI / 2, 28 / 2 + 50)
Case "G" End Select
Lin = Head 将头指针赋给临时指针 Case "矿用开关"
Head = MytestDataSet.Tables(0).Rows(j).Item("HeadPoint") Tail = MytestDataSet.Tables(0).Rows(j).Item("Tai