乐筑天下

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

如何把.PAT文件所属的文件路径用VBA程序自动添加到AUTOCAD的支持文件搜索路径中.

[复制链接]

11

主题

17

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
61
发表于 2005-2-20 19:48:00 | 显示全部楼层 |阅读模式
如何把.PAT文件所属的文件路径用VBA程序自动添加到的支持文件搜索路径中.即我把.PAT文件保存在 "E:\工程项目\SUPPORT\" 文件夹中,如何用VBA语言编程自动添加到AUTOCAD2002 >TOOLS>OPTIONS>SUPPORT FILE SERACH PATH 中.
回复

使用道具 举报

158

主题

2315

帖子

10

银币

顶梁支柱

Rank: 50Rank: 50

铜币
2951
发表于 2005-2-20 22:03:00 | 显示全部楼层
.SupportPath
回复

使用道具 举报

11

主题

17

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
61
发表于 2005-2-21 17:35:00 | 显示全部楼层
能否写具体点,谢谢
回复

使用道具 举报

12

主题

71

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
119
发表于 2005-2-21 19:19:00 | 显示全部楼层
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
回复

使用道具 举报

13

主题

396

帖子

5

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
448
发表于 2005-2-22 11:03:00 | 显示全部楼层
Sub AddSupportPath(ByVal Path As String)
Dim curSupportPath As Variant
Dim i As Integer
Dim Support As Boolean
Support = False
curSupportPath = Split(ThisDrawing.Application.preferences.Files, ";")
For i = 0 To UBound(curSupportPath)
                         If StrConv(curSupportPath(i), vbUpperCase) = StrConv(Path, vbUpperCase) Then
                                                         Support = True
                                                         Exit For
                         End If
Next
If Not Support Then
                 ThisDrawing.Application.preferences.Files = ThisDrawing.Application.preferences.Files & ";" & Path
End If
End Sub
       
Sub test()
AddSupportPath "d:\test"
End Sub
回复

使用道具 举报

0

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
1
发表于 2012-2-8 18:25:00 | 显示全部楼层
楼上讲的是inventor吗?
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-6-30 11:00 , Processed in 0.548385 second(s), 65 queries .

© 2020-2025 乐筑天下

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