如何用VB编程,在注册表中增加CAD的文件支持路径?
本人是VB新手,有哪位高手告诉我。最好有源代码。 本帖最后由 pmq 于 2011-9-24 16:42 编辑
'------------文件支持路径-----------------------------------------
Dim AcadPref As AcadPreferences
Set AcadPref = ThisDrawing.Application.Preferences.Files'文件
AcadPref.SupportPath = AcadPref.SupportPath & ";" & "E:\Sur\Fonts;D:\Sur\PicTU;" '添加文件支持路径
Set AcadPref = ThisDrawing.Application.Preferences.User'用户
AcadPref.ShortCutMenuDisplay = True '绘图区域中使用快捷菜单 : True : Boolean
AcadPref.SCMCommandMode = acEnter '自定义右键单击 命令模式 : acEnter 确定 :
AcadPref.SCMDefaultMode = acRepeatLastCommand '自定义右键单击 默认模式 : acRepeatLastCommand AcadPref.AcDrawingAreaSCMDefault
AcadPref.SCMEditMode = acEdRepeatLastCommand'自定义右键单击 编辑模式 : acEdRepeatLastCommand 重复上一个命令
AcadPref.AcDrawingAreaSCMEdit '快捷菜单
AcadPref.SCMTimeMode = True '绘图区域中使用快捷菜单 打开计时右键单击 : True : Boolean
AcadPref.SCMTimeValue = 250 '慢速单击期限: 250 : Long
Set AcadPref = ThisDrawing.Application.Preferences.Display '显示
AcadPref.CursorSize = 50 '十字丝大小
真好有一个现成的,嘿嘿!
Public Sub Set_SupportPath()
'将支持文件的路径设置到需要的状态
Dim preferences As AcadPreferences
Dim newSupportPath As String
Set preferences = ThisDrawing.Application.preferences
newSupportPath = "C:\Documents and Settings\lenovo\Application Data\Autodesk\AutoCAD 2004\R16.0\chs\Support;" & vbNewLine & _
"D:\Program Files\AutoCAD 2004\Support;" & vbNewLine & _
"D:\Program Files\AutoCAD 2004\Fonts;" & vbNewLine & _
"D:\Program Files\AutoCAD 2004\Express;" & vbNewLine & _
"D:\Program Files\AutoSTRU 2007;" & vbNewLine & _
"D:\Program Files\AutoCAD 2004\Help;" & vbNewLine & _
"D:\acad-spt;" & vbNewLine & _
"D:\acad-spt\lisp;" & vbNewLine & _
"D:\acad-spt\Mylisp;" & vbNewLine & _
"D:\acad-spt\Mylisp1;" & vbNewLine & _
"D:\acad-spt\Mylisp2;" & vbNewLine & _
"D:\acad-spt\Vba;" & vbNewLine & _
"D:\acad-spt\support;" & vbNewLine & _
"C:\pkpm\cfg;" & vbNewLine & _
"C:\pkpm_pc\cfg;" & vbNewLine & _
"D:\acad-spt\工具条"
preferences.Files.SupportPath = newSupportPath
MsgBox "The new value for SupportPath is " & vbNewLine & newSupportPath, vbInformation, "SupportPath"
End Sub
LZ可参考,将里面的路径设置成你需要的 这么多好心人,谢谢了!
页:
[1]