如下声明一个选择集及过滤器:2 ^" m- b( W3 S" r, B
Dim SZ As AcadSelectionSet, FT(0) As Integer, FD(0) As Variant
8 N$ G1 N% D6 R+ K. g- T3 Q/ t再如下声明一个直线临时变量并声明一个直线动态数组,用于存放所选择的直线:
% f6 k* Y0 K: b: C Dim L As AcadLine, L1() As AcadLine
( K3 g6 d: i5 I& n' `7 S) r4 O: Q8 O0 [
With ThisDrawing
# \" t* J* m* U/ k) E& W 定义选择的对象为直线对象,创建选择集并由用户在屏幕上选择
) R+ C2 m) ?3 N; I, p' S FT(0) = 0
6 O+ Y5 O2 s/ @% ^( p( A FD(0) = "line"
; X% ^7 V% {. D% g* t Set SS = .SelectionSets.Add("SS")
) x D5 l+ O [8 Y( M5 k8 m& @ SS.SelectOnScreen FT, FD7 ^5 K1 S( ^' x0 H" C! H2 ?* ]
- d3 B4 k- j% K9 G5 ^* x7 H 在CAD 模型空间选取几条直线后,在以下的遍历选择集中,如何将所选直线分别存入动态数组L1中' ?5 { o" F0 R& _' p
For Each L In SS6 r( H0 B$ b9 U% \( ~/ U
, ^( R, v5 k$ S2 `/ t6 i
???????????
+ X* m* q# k; _" ^5 J; ?3 A4 N: ? ????????????? n( L. b2 S4 f2 H# E, s J* ]$ \& B
- w- B$ M4 W2 G$ \' k3 u
Next3 Y1 [/ m, o7 m7 M' b- Y; }, E
End with
$ }: c0 `) Q$ ]! E5 j9 g求高手帮助,谢谢 |