Sub main() Dim selectObj As AcadSelectionSet Set selectObj = ThisDrawing.ActiveSelectionSet Save_Spline selectObj.Item(i) End Sub
Private Sub Save_Spline(SplineObj As AcadSpline) Dim fitPoints As Variant Dim iCount As Long fitPoints = SplineObj.fitPoints Open "D:\10.txt" For Append As #1 'Open后面为数据的保存路径,每读取一条线要改一次名 For iCount = 0 To UBound(fitPoints) Step 3 X_scale = fitPoints(iCount) Y_scale = fitPoints(iCount + 1) X_scale = Format(X_scale, "##0.0000") '格式化数据,确定保留几位小数 Y_scale = Format(Y_scale, "##0.0000") '同上 Print #1, X_scale & " " & Y_scale '数据的输出格式 Next iCount Close #1 End Sub 上面的代码就是提取控制点的小程序,可是每提取一条线的值我都得改一下名,效率太低! 哪位大侠能给我把这代码优化一下,我想每一次运行时能出现一个窗体来提示我改文件名。 谢谢了! |