选择对象并将其放入选择集中,或选择表格中的单元格。 支持的平台:仅窗口 签名 - 选择集工 务 局: object.Select Mode [, Point1] [, Point2] [, FilterType, FilterData]
签名 - 表工 务 局: object.Select wpt, wvwVec, wvwxvec, wxaper, wyaper, allowOutside, resultRowIndex, resultColumnIndex
Return Value (RetVal)No return value. Remarks - SelectionSetThis method supports the filtering mechanism. The following selection modes are available:
For more selection mode options, see the , , and methods. SelectByPolygonSelectAtPointSelectOnScreen Remarks - TableThis function selects a cell in the table by specifying a point, viewing direction, and orientation. The row and column index of the selected cell are returned in resultRowIndex and resultColumnIndex. ExamplesVBA: Sub Example_Select() ' This example adds members to a selection set, first by crossing and ' then by filtering for circles. ' Create the selection set Dim ssetObj As AcadSelectionSet Set ssetObj = ThisDrawing.SelectionSets.Add("SSET") ' Add all object to the selection set that lie within a crossing of (28,17,0) and ' (-3.3, -3.6,0) Dim mode As Integer Dim corner1(0 To 2) As Double Dim corner2(0 To 2) As Double mode = acSelectionSetCrossing corner1(0) = 28: corner1(1) = 17: corner1(2) = 0 corner2(0) = -3.3: corner2(1) = -3.6: corner2(2) = 0 ssetObj.Select mode, corner1, corner2 ' Add all the Circles to the selection set that lie within the crossing of (28,17,0) and ' (-3.3, -3.6,0) by filtering from the current drawing 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.Select mode, corner1, corner2, groupCode, dataCode End Sub Visual LISP: (vl-load-com) (defun c:Example_Select() ;; This example adds members to a selection set, first by crossing and ;; then by filtering for circles. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Create the selection set (setq ssetObj (vla-Add (vla-get-SelectionSets doc) "SSET")) ;; Add all object to the selection set that lie within a crossing of (28,17,0) and ;; (-3.3, -3.6,0) (setq mode acSelectionSetCrossing corner1 (vlax-3d-point 28 17 0) corner2 (vlax-3d-point -3.3 -3.6 0)) (vla-Select ssetObj mode corner1 corner2) (alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj)))) (vla-Clear ssetObj) ;; Add all the Circles to the selection set that lie within the crossing of (28,17,0) and ;; (-3.3, -3.6,0) by filtering from the current drawing (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-Select ssetObj mode corner1 corner2 gpCode dataValue) (alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj)))) (vla-Delete ssetObj) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:38
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.