Sub IntBlkBySelectDwg()<BR>On Error GoTo Err_Control
Dim BlkFile As Variant<BR>Dim i As Integer<BR>Dim InstPnt As Variant<BR>Dim BlkRefObj As AcadBlockReference<BR>Dim varCancel As Variant<BR>BlkFile = getFileBySelect("选择图形", "dwg", "CAD图形文件(*.dwg)|*.dwg|" + "所有文件(*.*)|*.*|")<BR>'用信息框返回所选文件的路径<BR>MsgBox BlkFile<BR>End Sub
'选定多个文件的函数,使用了CommonDialog类<BR>Public Function getFileBySelect(DialogTitle, DefaultExt, Filter) As Variant<BR>Dim dlg As CommonDialog<BR>Dim Files As Variant<BR>Dim i As Integer
Set dlg = New CommonDialog<BR>With dlg<BR> .DialogTitle = DialogTitle<BR> .DefaultExt = DefaultExt<BR> .Filter = Filter<BR> .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or dlOFNHideReadOnly <BR> dlg.ShowOpen<BR> getFileBySelect = .FileName<BR>End With
End Function
不知道有哪位仁兄调试过此段代码 因为是多选,所以返回的是数组 可是我调试时,IsArray(BlkFile)返回的是False,而不是Ture,不知道是为什么?而且在源程序中
If ShowOpen Then <BR> getFileBySelect =.ParseFileNames
End If
也提示出错,为什么? 用DOS下的批处理不也行嘛 在使用COMMONDIALOG类.showopen中,如何实现像cad打开对话框中右边的cad图形的预览功能?请教!
页:
1
[2]