CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

SelectAtPoint Method (ActiveX)

2023-1-4 03:55| 发布者: admin| 查看: 746| 评论: 0|来自: AutoCAD

摘要: 选择穿过给定点的对象,并将其放入选择集中。

选择穿过给定点的对象,并将其放入选择集中。

支持的平台:仅窗口

签名

工 务 局:

object.SelectAtPoint Point, FilterType, FilterData
对象

类型:选择集

此方法适用的对象。

访问:仅输入

类型:变体(双精度的三元素数组)

指定用于选择的点的 3D UCS 坐标。

过滤器类型

访问:仅输入;自选

类型:变体

指定要使用的筛选器类型的 DXF 组代码。

过滤数据

访问:仅输入;自选

类型:变体

要筛选的值。

返回值(RetVal)

无返回值。

言论

此方法支持筛选机制。

PICKBOX 系统变量会影响对象选择。

有关更多选择模式选项,请参阅、和方法。SelectSelectByPolygonSelectOnScreen

例子

工 务 局:

Sub Example_SelectAtPoint()
    ' This example adds objects to a selection set by identifying a point.
    ' At first all objects at the point are added to the selection set. Then
    ' only circle objects at the point are added to the selection set.
    
    ' Create the selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET1")
   
    ' Add to the selection set all the objects that lie at point(6.8,9.4,0) 
    Dim point(0 To 2) As Double
    point(0) = 6.8: point(1) = 9.4: point(2) = 0
    ssetObj.SelectAtPoint point
    
    ' Add to the selection set all the Circles that lie at point (6.8,9.4,0) 
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    gpCode(0) = 0
    dataValue(0) = "Circle"
    
    Dim groupCode As Variant, dataCode As Variant
    groupCode = gpCode
    dataCode = dataValue
    
    ssetObj.SelectAtPoint point, groupCode, dataCode
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_SelectAtPoint()
    ;; This example adds objects to a selection set by identifying a point.
    ;; At first all objects at the point are added to the selection set. Then
    ;; only circle objects at the point are added to the selection set.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Create the selection set
    (setq ssetObj (vla-Add (vla-get-SelectionSets doc) "TEST_SSET1"))
   
    ;; Add to the selection set all the objects that lie at point(6.8,9.4,0)
    (setq point (vlax-3d-point 6.8 9.4 0))
    (vla-SelectAtPoint ssetObj point)
  
    (alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj))))
    (vla-Clear ssetObj)
    
    ;; Add to the selection set all the Circles that lie at point (6.8,9.4,0)
    (setq gpCode (vlax-make-safearray vlax-vbInteger '(0 . 0)))
    (vlax-safearray-put-element gpCode 0 0)
    (setq dataValue (vlax-make-safearray vlax-vbVariant '(0 . 0)))
    (vlax-safearray-put-element dataValue 0 "Circle")
    
    (vla-SelectAtPoint ssetObj point gpCode dataValue)
    (alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj))))

    (vla-Delete ssetObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 12:11

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部