明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1459|回复: 2

[求助]关于Select?

[复制链接]
发表于 2003-12-10 15:54:00 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2003-12-10 16:42:00 | 显示全部楼层
看看对象模型http://www.mjtd.com/object/acad2004/

下面是个具体的例子
  1. Sub Example_SelectByPolygon()
  2.     ' This example adds entities to a selection set by defining a polygon.
  3.    
  4.     Dim ssetObj As AcadSelectionSet
  5.     Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET2")
  6.      
  7.     ' Add all the entities that lie within a fence to the selection set
  8.     Dim mode As Integer
  9.     Dim pointsArray(0 To 11) As Double
  10.     mode = acSelectionSetFence

  11.     pointsArray(0) = 28.2: pointsArray(1) = 17.2: pointsArray(2) = 0
  12.     pointsArray(3) = -5: pointsArray(4) = 13: pointsArray(5) = 0
  13.     pointsArray(6) = -3.3: pointsArray(7) = -3.6: pointsArray(8) = 0
  14.     pointsArray(9) = 28: pointsArray(10) = -3: pointsArray(11) = 0
  15.    
  16.     ssetObj.SelectByPolygon mode, pointsArray
  17.    
  18.     ' Add all the Circles that lie within fence to the selection set

  19.     ReDim gpCode(0 To 1) As Integer
  20.     gpCode(0) = 0
  21.     gpCode(1) = 10
  22.    
  23.     Dim pnt(0 To 2) As Double
  24.     pnt(0) = 3: pnt(1) = 6: pnt(2) = 0
  25.    
  26.     ReDim dataValue(0 To 1) As Variant
  27.     dataValue(0) = "Circle"
  28.     dataValue(1) = pnt
  29.    
  30.     Dim groupCode As Variant, dataCode As Variant

  31.     groupCode = gpCode
  32.     dataCode = dataValue
  33.    
  34.     ssetObj.SelectByPolygon mode, pointsArray, groupCode, dataCode
  35.    
  36. End Sub
 楼主| 发表于 2003-12-10 16:51:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 12:39 , Processed in 0.185550 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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