请mccad在cad2000下随意绘制几条稍微复杂的互相相交的多义线
程序代码如下:
Private Sub CommandButton3_Click()
Dim GpCode(0 To 1) As Integer '选择集过滤
Dim DataValue(0 To 1) As Variant '选择集过滤
Dim n As Integer, m As Integer '选择集中实体的个数
Dim i As Integer, j As Integer, k As Integer, l As Integer '四层循环控制
Dim Startime As Date '起始运行时间
Startime = Time()
Dim En As Variant '第一层循环实体名
Dim En1 As Variant '第二层循环实体名
Dim Minext As Variant '实体的外界多边形左下角点(二维点)
Dim Maxext As Variant '实体的外界多边形右上角点(二维点)
Dim Vert1(0 To 2) As Double '实体的外界多边形左下角点(三维点)
Dim Vert2(0 To 2) As Double '实体的外界多边形右上角点(三维点)
Dim Intpoints As Variant '返回的交点集
Dim Cir As AcadCircle '增加的标志,圆
Dim Pt(0 To 2) As Double '交点坐标
Dim Pts As Variant '实体的端点坐标集
Dim Pts1 As Variant '实体的端点坐标集
Dim isxj As Boolean '是否端点的标志
Dim Myss As AcadSelectionSet '定义第一层循环选择集"myss"
Dim Myss1 As AcadSelectionSet '定义第二层循环选择集"myss1"
Dim Myss2 As AcadSelectionSet '定义第三层循环选择集"myss2"
Dim ThisCoord() As coord
Dim lspPnt As String
Dim det As String
Dim LastArray(0) As Variant
Dim inti As Integer
Dim intj As Integer
For Each Myss In ThisDrawing.SelectionSets '如选择集"myss"存在则删除
If Myss.Name = "sset" Then
Myss.Delete
Exit For
End If
Next
For Each Myss1 In ThisDrawing.SelectionSets '如选择集"myss1"存在则删除
If Myss1.Name = "sset1" Then
Myss1.Delete
Exit For
End If
Next
Set Myss = ThisDrawing.SelectionSets.Add("sset") '添加选择集myss
Set Myss1 = ThisDrawing.SelectionSets.Add("sset1") '添加选择集myss1
ThisDrawing.SetVariable "clayer", ComboBox5.Text '设置当前的图层