- 积分
- 466
- 明经币
- 个
- 注册时间
- 2005-3-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2005-4-7 19:41:00
|
显示全部楼层
本帖最后由 作者 于 2005-4-7 21:37:05 编辑
Public Sub BreakHide()
Dim Pnt1 As Variant Dim det1 As String,det2 As String Dim EntObj1 As AcadEntity, EntObj2 As AcadEntity AcadDoc.Utility.GetEntity EntObj1, Pnt1, "选择图元:" Dim SS As AcadSelectionSet Set SS = AcadDoc.ActiveSelectionSet SS.SelectOnScreen
'获得相交实体交点,即打断点 Dim lspPnt As String Dim IntPnt As Variant Dim IntPnt1(0 To 2) As Double Dim n As Integer For Each EntObj2 In SS On Error Resume Next IntPnt = EntObj2.IntersectWith(EntObj1, acExtendNone)
If IsArray(IntPnt) Then For n = 0 To UBound(IntPnt) Step 3 IntPnt1(0) = IntPnt(n + 0) IntPnt1(1) = IntPnt(n + 1) IntPnt1(2) = IntPnt(n + 2) lspPnt = axPoint2lspPoint(IntPnt1) det2 = lspPnt AcadDoc.SendCommand "_break" & vbCr & det2 & vbCr & lspPnt & vbCr Next End If Next
End Sub
此法可以打断和一条直线相交的直线,但是好像断得没啥规律,交点是断了,断的不一定都是直线上的 |
|