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