- 积分
- 10513
- 明经币
- 个
- 注册时间
- 2002-6-3
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-6-5 14:00:00
|
显示全部楼层
在注册表中添加
注册表的路径为:HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-1:804\Profiles\<<Unnamed Profile>>\General,那儿有一个键值是ACAD,它保存的就是搜索路径。比如:ACAD="D:\\Program Files\\ACAD2000\\support;D:\\Program Files\\ACAD2000\\fonts;D:\\Program Files\\ACAD2000\\help;D:\\Program Files\\ACAD2000\\express;"
上面要注意的R15.0这个跟版本有关系,不同版本是不一样的,而<<Unnamed Profile>>则是配置名称,也跟不同的配置有关系。
还有一种就是创建一个VB的应用程序,通过对Application对象的preferences引用,以程序的方式添加搜索路径。
后一种可能相对比较简单。
Sub Example_SupportPath()
' This example returns the current setting of
' SupportPath. It then changes the value, and finally
' it resets the value back to the original setting.
Dim preferences As AcadPreferences
Dim currSupportPath As String
Dim newSupportPath As String
Set preferences = ThisDrawing.Application.preferences
' Retrieve the current SupportPath value
currSupportPath = preferences.Files.SupportPath
MsgBox "The current value for SupportPath is " & currSupportPath, vbInformation, "SupportPath Example"
' Change the value for SupportPath
newSupportPath = "TestSupportPath"
preferences.Files.SupportPath = newSupportPath
MsgBox "The new value for SupportPath is " & newSupportPath, vbInformation, "SupportPath Example"
' Reset SupportPath to its original value
preferences.Files.SupportPath = currSupportPath
MsgBox "The SupportPath value is reset to " & currSupportPath, vbInformation, "SupportPath Example"
End Sub |
|