vbyu1987 发表于 2013-4-28 16:01:00

VBA保存图形文件的问题(已解决)

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
运行时候可以新建图形,画直线,但是没法正确保存,请问上面程序有什么错误吗?
谢谢

vbyu1987 发表于 2013-4-28 16:19:00

郁闷死了,公司的电脑,原来没有权限保存在C盘根目录
页: [1]
查看完整版本: VBA保存图形文件的问题(已解决)