VBA保存图形文件的问题(已解决)
本帖最后由 vbyu1987 于 2013-4-28 16:18 编辑Public Sub saveDocument()
Dim doc As GcadDocument
Set doc = thisDrawing.Application.Documents.Add()
Dim ptStart(0 To 2) As Double
Dim ptEnd(0 To 2) As Double
ptStart(0) = 0
ptStart(1) = 0
ptStart(2) = 0
ptEnd(0) = 100
ptEnd(1) = 100
ptEnd(2) = 0
Dim line As GcadLine
Set line = thisDrawing.ModelSpace.AddLine(ptStart, ptEnd)
doc.SaveAs "c:\test.dwg", ac2004_dwg
End Sub
因为是用的浩辰CAD,所以acadDocument 改为了GcadDocument
运行时候可以新建图形,画直线,但是没法正确保存,请问上面程序有什么错误吗?
谢谢
郁闷死了,公司的电脑,原来没有权限保存在C盘根目录
页:
[1]