0
运行AutoCAD脚本文件,我使用下面的代码打开AutoCAD文件:编程方式使用VB6
Dim DwgName As String
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Set acadApp = CreateObject("AutoCAD .Application")
Err.Clear
End If
Set acadDoc = acadApp.ActiveDocument
If acadDoc.FullName <> DwgName Then
acadDoc.Open DwgName
End If
Dim str As String, str1 As String
str1 = "_-insert" & vbLf & """" & "C:\AZ665.dwg" & """" & vbLf & "0,0,0" & vbLf & vbLf & vbLf & vbLf & "z" & vbLf & "a" & vbLf
acadDoc.SendCommand str1
acadApp.Visible = True
以上代码的工作fine.But每次我都以做任何更改,打造“STR1”字符串。因此,我在“.scr”文件中写入scipt,但无法调用此文件。 请帮忙。
你可以发表你的.scr的文件吗? – rags
什么版本的autocad? –