[求助]如何生成闭合多段线?
类似CAD自带的边界图案填充命令,拾取点或选择对象时生成闭合多段线,但是源对象不要删除,遇到圆弧时自动用一定数量的线段来代替,线段的长度由用户输入。应该如何编写,或者提供一下思路。 Just for your reference...It's a reply from Joe Parker<b>Re: Create Boundary<BR></b>counting the modelspace objects before and after a call to this sub will<BR>tell you if there are any new polylines created- messy but it works<BR>Private Sub Bound()<BR>Dim Pt As Variant, gotpt As Boolean<BR>gotpt = False<BR><BR>Do<BR>On Error Resume Next<BR>Pt = ThisDrawing.Utility.GetPoint(, "Select an Internal Point")<BR>If Err Then<BR>If GetAsyncKeyState(VK_ESCAPE) And &H8000& Then<BR>Exit Function<BR>End If<BR>Err.Clear<BR>gotpt = False<BR>Else<BR>gotpt = True<BR>End If<BR>Loop While Not gotpt<BR>On Error GoTo 0<BR>ThisDrawing.SendCommand Chr(3) & Chr(3) & "-boundary" & vbCr & Pt(0) & "," &<BR>Pt(1) & vbCr & vbCr<BR>End Sub GetAsyncKeyState这个函数没有定义 Option Explicit<BR>Private Const VK_ESCAPE = &H1B<BR>Private Declare Function GetAsyncKeyState Lib "user32" _<BR>(ByVal vKey As Long) As Integer
Private Sub Bound()<BR>Dim Pt As Variant, gotpt As Boolean<BR>gotpt = False
Do<BR>On Error Resume Next<BR>Pt = ThisDrawing.Utility.GetPoint(, "Select an Internal Point")<BR>If Err Then<BR>If GetAsyncKeyState(VK_ESCAPE) And &H8000& Then<BR>Exit Sub<BR>End If<BR>Err.Clear<BR>gotpt = False<BR>Else<BR>gotpt = True<BR>End If<BR>Loop While Not gotpt<BR>On Error GoTo 0<BR>ThisDrawing.SendCommand Chr(3) & Chr(3) & "-boundary" & vbCr & Pt(0) & "," & _<BR>Pt(1) & vbCr & vbCr<BR>End Sub 多谢版主的回复,但是程序只相当于正常的边界命令,还达不到我的要求,能否改进一下?谢谢! 怎么没人知道吗? 再顶一次。 NNWS神速神速
页:
[1]