wuxin20642 发表于 2019-8-19 13:38:29

找極點

根據選擇的List得到所選圖形中的最高點和最低點,返回一條線段
Private Function GetMaxAndMinPoint(List As VISIList, Blist As VISIList) As VISISegment
Dim el As New VISIElement
Dim el1 As New VISIElement
Dim geo As New VISIGeo
Dim db As New VISIDatabase
Dim Elist As New VISIList
Dim SegmAs New VISISegment
Dim count As Long

    count = List.count
   
    Elist.Init 10, LTYPE_ELEM
   
    For i = 1 To count
      db.WorkDBKey = List.Item(i)
      db.GetElement
      Elist.AddItem db.WorkElement
    Next i
   
    el.Type = DB_POINT
    el1.Type = DB_POINT
   
    geo.OperationCode = VGEO_BOUNDINGBOX
   
    geo.elementlist = Elist
    geo.BodyList = Blist
    geo.Execute
   
    If (geo.LastError = V_NOERROR) Then
      Set el = geo.result.Item(1)
      Segm.P1.Put el.Data.x, el.Data.y, el.Data.z
      
      Set el1 = geo.result.Item(2)
      Segm.P2.Put el1.Data.x, el1.Data.y, el1.Data.z
      
    End If
    Set GetMaxAndMinPoint = Segm
End Function

zzyong00 发表于 2019-10-28 13:20:20

VISIElement,VISIList是什么?
页: [1]
查看完整版本: 找極點