'运行到offset这一步就直接跳出entrimf子过程返回enttrim
- Sub entTrim()
- On Error Resume Next
- Dim ent As AcadEntity
- Dim pnt1 As Variant
-
- ThisDrawing.Utility.GetEntity ent, pnt1, "选择多义线:"
- If Err Then Exit Sub
- entTrimF ent
- End Sub
- Sub entTrimF(plineObj As AcadEntity)
- Dim offplineObj As AcadEntity
- Dim Coors As Variant
- Dim coorString, cmdString As String
- Dim i As Integer
-
- offplineObj = plineObj.Offset(-0.1) '运行到这一步就直接跳出entrimf子过程返回enttrim
-
- offplineObj.Update
- Coors = offplineObj.Coordinates
- offplineObj.Delete
-
- coorString = ""
- For i = UBound(Coors) To UBound(Coors) Step 3
- coorString = coorString & Coors(i) & "," & Coors(i + 1) & "," & Coors(i + 2) & "," & vbCr
- Next i
- 'coorString = Left(coorString, Len(coorString) - 1)
- cmdString = "trim" & vbCr & "(handent """ & plineObj.Handle & """)" & vbCr & _
- "f" & vbCr & coorString
- ThisDrawing.SendCommand cmdString
-
- End Sub
|