pmq 发表于 2010-4-10 18:27:00

[求助] SelectAtPoint 选择不到"点"

<p>Private Sub CommandButton1_Click()<br/>&nbsp;&nbsp;&nbsp; '在CAD中绘两个点,用直线将两个点连接<br/>&nbsp;&nbsp;&nbsp; '选择直线,然后将直线起点处的"点"移动到直线的中间。<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Me.Hide<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim Seel As AcadSelectionSet&nbsp;&nbsp;&nbsp; '选择集<br/>&nbsp;&nbsp;&nbsp; Set Seel = CreateSelectionSet&nbsp;&nbsp; '创建选择集<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim StartPoint As Variant<br/>&nbsp;&nbsp;&nbsp; Dim EndPoint As Variant<br/>&nbsp;&nbsp;&nbsp; Dim TemPoint As Variant<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim FType(0) As Integer<br/>&nbsp;&nbsp;&nbsp; Dim FData(0) As Variant<br/>&nbsp;&nbsp;&nbsp; FType(0) = 0<br/>&nbsp;&nbsp;&nbsp; FData(0) = "Line"<br/>&nbsp;&nbsp;&nbsp; FilterType = FType<br/>&nbsp;&nbsp;&nbsp; FilterData = FData<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Seel.SelectOnScreen FilterType, FilterData<br/>&nbsp;&nbsp;&nbsp; TemPoint = Seel.Item(0).StartPoint<br/>&nbsp;&nbsp;&nbsp; Seel.Delete<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; FType(0) = 0<br/>&nbsp;&nbsp;&nbsp; FData(0) = "Point"<br/>&nbsp;&nbsp;&nbsp; FilterType = FType<br/>&nbsp;&nbsp;&nbsp; FilterData = FData<br/>&nbsp;&nbsp;&nbsp; Set Seel = CreateSelectionSet&nbsp;<font color="#22dd48"> '创建选择集<br/></font>&nbsp;&nbsp;&nbsp; Seel.SelectAtPoint TemPoint, FilterType, FilterData<br/>&nbsp;&nbsp;&nbsp; <font color="#ff0000">ObjNum = Seel.Count </font><font color="#11ee11">'这里&nbsp; 选择集为空 没有选择到"点"<br/></font>End Sub<br/></p>

zuehuo 发表于 2010-7-1 10:59:00

不懂

wwswwswws 发表于 2010-8-23 14:27:00

TemPoint这个位置根本就没有点对象,当然选择集为空了。
页: [1]
查看完整版本: [求助] SelectAtPoint 选择不到"点"