支持文件搜索路径
可以使用vba来定义新的支持文件搜索路径吗?**** Hidden Message ***** 是的,你想干什么? 这就是我如何确保这些驱动器在路径中的方法。
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
我想使用VBA插入一个dwg,但是如果它不在定义的路径中,vba会阻塞,因为它找不到块,所以我需要能够定义新路径。 使用上述方法,您应该可以添加您的路径。如果您需要帮助,请告诉我 让它工作,谢谢。 您使用的是什么版本?我看到有报道称,在2007年,InsertBlock现在需要一个完全限定的路径名。因此,仅仅确保支持路径指向您的块不起作用……请注意,我没有亲自测试过这一点。(self注意,今天晚些时候进行测试) 2005 adt JM,我这边没有确认,但我昨天在插入块时遇到了问题。我今天必须调查一下。
页:
[1]