Jeff_M 发表于 2006-7-17 09:29:30

支持文件搜索路径

vba可以用于定义新的支持文件搜索路径吗?

冠ゑ山 发表于 2006-7-17 09:53:11

是的,你想做什么?

静文 发表于 2006-7-17 09:56:34

这就是我如何确保这些驱动器在路径中
Public Sub ACADStartup()
    Set AutoCAD = Application
    Dim strUSER As String
    Dim supppath As String
    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    'This will prevent you entering the same entry more than once
    If InStr(1, supppath, "U:\TITLEBLOCKS") > 1 Then
    GoTo Nextline
    Else
    ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\TITLEBLOCKS"
    End If
Nextline:
    If InStr(1, supppath, "U:\symbols") > 1 Then
    GoTo Lastline
    Else
    ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\symbols"
    End If
Lastline:
    If InStr(1, supppath, "U:\PROJECTLOGS") > 1 Then
    Exit Sub
    Else
    ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\PROJECTLOGS"
    End If
    Exit Sub
End Sub

海盗 发表于 2006-7-17 10:02:49

我想使用VBA插入dwg,但如果它's不在定义的路径中,vba阻塞,因为它可以#039;找不到块,所以我需要能够定义新路径。

大学女生 发表于 2006-7-17 10:12:36

使用上述内容,您应该能够添加路径 如果你需要帮助,请告诉我

蛇群 发表于 2006-7-17 11:04:34

成功了,谢谢。

问题 发表于 2006-7-17 11:48:14

你用的是什么版本?本人'我们已经看到一些报告,2007年InsertBlock现在需要一个完全限定的路径名。因此,仅仅确保支持路径指向您的区块是行不通的;请注意,我没有亲自测试过这一点。(请注意,今天晚些时候进行测试)

魔兽玩家 发表于 2006-7-18 07:29:13

2005年adt

随心所欲 发表于 2006-7-18 09:45:14

JM,我这边没有确认,但我昨天在插入块时遇到了问题 今天必须调查一下。
页: [1]
查看完整版本: 支持文件搜索路径