关于存储文件的一个小例子(高手指点一下)
<P>源代码</P><P> Dim NewObject As AcadDocument<BR> Dim FileName As String<BR> Dim Number As Double<BR> Dim i As Integer<BR> Dim Point1(0 To 2) As Double<BR> Dim Point2(0 To 2) As Double<BR> Dim Line As AcadLine<BR> Number = 10<BR> i = 1<BR> Do While i <= Number<BR> Point1(0) = 0: Point1(1) = 0: Point1(2) = 0<BR> Point2(0) = i * 100: Point2(1) = 0: Point2(2) = 0<BR> Set NewObject = ThisDrawing.Application.Documents.Add<BR> Set Line = ThisDrawing.ModelSpace.AddLine(Point1, Point2)<BR> ThisDrawing.Application.ZoomExtents<BR> FileName = "D:\" & i & ".dwg"<BR> NewObject.SaveAs FileName<BR> NewObject.Close False<BR> i = i + 1<BR> Loop<BR>End Sub</P>
<P>我的目的是画一条直线保存一个DWG文件,一共循环10次。为什么运行的时候老是会卡住,就是循环不能真确的完成,请高手指点一下。</P>
reply
<P>什么时候会卡?我试了一次,运行正常.</P> <P>是不是 autocad2004版本的?</P>reply
我用的是AutoCAD2004
页:
[1]