明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1011|回复: 1

找極點

[复制链接]
发表于 2019-8-19 13:38 | 显示全部楼层 |阅读模式
根據選擇的List得到所選圖形中的最高點和最低點,返回一條線段
  1. Private Function GetMaxAndMinPoint(List As VISIList, Blist As VISIList) As VISISegment
  2. Dim el As New VISIElement
  3. Dim el1 As New VISIElement
  4. Dim geo As New VISIGeo
  5. Dim db As New VISIDatabase
  6. Dim Elist As New VISIList
  7. Dim Segm  As New VISISegment
  8. Dim count As Long

  9.     count = List.count
  10.    
  11.     Elist.Init 10, LTYPE_ELEM
  12.    
  13.     For i = 1 To count
  14.         db.WorkDBKey = List.Item(i)
  15.         db.GetElement
  16.         Elist.AddItem db.WorkElement
  17.     Next i
  18.    
  19.     el.Type = DB_POINT
  20.     el1.Type = DB_POINT
  21.    
  22.     geo.OperationCode = VGEO_BOUNDINGBOX
  23.    
  24.     geo.elementlist = Elist
  25.     geo.BodyList = Blist
  26.     geo.Execute
  27.    
  28.     If (geo.LastError = V_NOERROR) Then
  29.         Set el = geo.result.Item(1)
  30.         Segm.P1.Put el.Data.x, el.Data.y, el.Data.z
  31.         
  32.         Set el1 = geo.result.Item(2)
  33.         Segm.P2.Put el1.Data.x, el1.Data.y, el1.Data.z
  34.         
  35.     End If
  36.     Set GetMaxAndMinPoint = Segm
  37. End Function

发表于 2019-10-28 13:20 | 显示全部楼层
VISIElement,VISIList是什么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-26 12:55 , Processed in 0.398990 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表