Sub tt()
Do While 1 If (flgPickNested = True) Then Debug.Print "错误" Exit Sub Else Dim pt As Variant ThisDrawing.Utility.GetEntity ent, pt End If
var = ent.Coordinates retCoord = ent.Coordinates k = (UBound(retCoord) + 1) / 3 ReDim px(k - 1) As Double ReDim py(k - 1) As Double
For i = 0 To UBound(retCoord) Step 3 px(i / 3) = retCoord(i) py(i / 3) = retCoord(i + 1)
Next i Dim m As Integer Dim n As Integer m = 0 n = 0 ReDim Center(3 * (k - 1) + 2) As Double For i = 0 To k - 1
Center(i * 3) = px(i) Center(i * 3 + 1) = py(i) Center(i * 3 + 2) = 0
Next i
Dim lwp As AcadMLine ThisDrawing.SendCommand "_mline" & vbCr & "j" & vbCr & "z" & vbCr & "s" & vbCr & "20" & vbCr Set lwp = ThisDrawing.ModelSpace.AddMLine(Center)
picked = True
Loop
ErrHandle:
End Sub
以上是提取pline坐标后,用mline重新绘制的源代码
请大家帮忙怎么处理pline弯曲处,我考虑让程序自动增加一些点,来贴合原来比较大的弧线。(因为原来pline是用很粗的线绘制的,这个pline线本生不包括arc段,由于线很粗,所以绘制出来的线,弧度很好,如果用mline描下来,自然就在曲度大的地方一下子就看出来pline和mline就不贴合在一起了)
或者是用一个工具,只要在 mline线上点击一下就在点击的位置增加一个点。多加几个点再编辑一个,但是如何再mline线上增加点,翻扁了怎个网络就只有lisp做的一个,我对lisp一无所知。所以盼望能有vba版本的。谢谢
或者有什么其他好办法,
一直思路顿塞,痛苦中
盼指教。谢谢