《CAD批量去除教育版VBA程序(2页).doc》由会员分享,可在线阅读,更多相关《CAD批量去除教育版VBA程序(2页).doc(2页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、-CAD批量去除教育版VBA程序-第 2 页总体思路就是记录下要去除教育版的dwg文件的文件夹位置,然后对整个文件夹的所有dwg进行打开,存dxf,删除dwg,打开dxf,存dwg操作,就可以去除教育版。Private Sub CommandButton11_Click() 选择文件,记录文件地址 CommonDialog2.CancelError = True With CommonDialog2 .Filter = *.dwg|*.dwg .ShowSave Dim A As String A = Trim(.FileName) i = InStrRev(A, ) MyPath = Mid
2、(A, 1, i) 文件目录 End With Dim MyFile, MyName As String MyFile = Dir(MyPath & *.dwg) Do While MyFile 开始循环。 nextline = Trim(MyFile) gangwei = InStr(nextline, .dwg) MyName1 = Mid(nextline, 1, gangwei - 1) ThisDrawing.Application.Documents.Open MyPath & MyName1 & .dwgation.Documents(MyName1 & .dwg).SaveAs MyPath & MyName1, ac2004_dxf 存DXF Kill (MyPath & MyName1 & .dwg) 删除DWG ThisDrawing.Application.Documents.Open MyPath & MyName1 & .dxf 打开dxf ThisDrawing.Application.Documents(MyName1 & .dxf).SaveAs MyPath & MyName1, ac2004_dwg 存dwg Kill (MyPath & MyName1 & .dxf) MyFile = Dir LoopEnd Sub