- 积分
- 38498
- 明经币
- 个
- 注册时间
- 2013-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
这个脚本的内容如下:
Public Sub Setup()
On Error Resume Next
Set objCAD = GetObject(, "AutoCAD.Application")
Set fs = CreateObject("Scripting.FileSystemObject")
Set ws = CreateObject("WScript.Shell")
path = fs.GetParentFolderName(wsh.ScriptFullName) + "\Sys"
menuPath = path + "\zhl.mns"
ws.RegWrite "HKEY_LOCAL_MACHINE\Software\ZHL_SOFT\" _
& "zhlpath", path
Err.Clear
Set app = GetObject(, "autocad.Application")
If app.Documents.Count = 0 Then
app.Documents.Add
End If
If Err.Number <> 0 Then
MsgBox "没有发现正在运行中的AutoCAD,请先启动AutoCAD软件!", vbInformation, "请先启动AutoCAD软件!"
wsh.quit
End If
Set mgrp = app.MenuGroups
Err.Clear
Set ThisDrawing = objCAD.activedocument
path = replace (path , "\" ,"/")
ThisDrawing.SendCommand ("(load """ & path & "/setup.fas"")" & vbCr)
End Sub
Setup
好像是要安装一个字体自动替换程序。
dwg中调用vbs是如何实现的呢?用反应器? |
|