乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 35|回复: 1

[求助]宏的自动安装

[复制链接]

21

主题

33

帖子

1

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
117
发表于 2003-6-5 13:29:00 | 显示全部楼层 |阅读模式
您好:
请教一下,我在做一个cad vba宏的自动安装程序,但需要在系统的支持搜索路径中添加C:\leo\files这个路径,不只应修改那个文件,在此文件中的哪里添加?
                                                        请多指教!!
                                                        谢谢!!
回复

使用道具 举报

26

主题

589

帖子

10

银币

中流砥柱

Rank: 25

铜币
693
发表于 2003-6-5 14:00:00 | 显示全部楼层
注册表的路径为:HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-1:804\Profiles\\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这个跟版本有关系,不同版本是不一样的,而则是配置名称,也跟不同的配置有关系。
还有一种就是创建一个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
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 17:23 , Processed in 0.433481 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表