[VBA]三维实体干涉检查
三维实体干涉检查:试着编了下断代码,为何检测不出?那句有错?Private Sub CommandButton1_Click()<BR>On Error Resume Next<BR>Me.Hide<BR>Dim returnobj(2) As AcadEntity<BR>Dim objnumber As Integer<BR>Dim basepnt As Variant<BR>objnumber = objnumber + 1<BR>ThisDrawing.Utility.GetEntity returnobj(objnumber), basepnt, "选择实体"
returnobj(objnumber).Highlight (True)<BR>Me.Show<BR>If Err.Number <> 0 Then<BR> Err.Clear<BR> objnumber = objnumber - 1<BR> MsgBox ("未选中实体,重选")<BR> Exit Sub<BR>End If
Dim interferenceobj As Acad3DSolid<BR>If objnumber = 2 Then<BR> Set interferenceobj = returnobj(1).CheckInterference(returnobj(2), True)<BR> interferenceobj.Delete<BR> If Err.Number = 0 Then<BR> MsgBox ("两三维实体干涉")<BR> interference = True<BR> objnumber = 0<BR> Else<BR> MsgBox ("两三维实体不干涉")<BR> interference = False<BR> objnumber = 0<BR> Err.Clear<BR> End If<BR> End If<BR> <BR> <BR>End Sub<BR> 差For循环,只能选择一次,你怎么判断
页:
[1]