Best VBA Editor for Autocad

I am developing some VBA macros in Autocad. The built-in editor is outdated, but I could not find a better way to edit .dvb files.

A .dvb contains many other source files packaged into it, and so far I believe Autocad is the only software that can unpack them ...

The only way this succeeds is to export each file from .dvb manually; but since I have about 30 files, it seems like this is a good way to do something.

Any ideas on how to make this better?

+4
source share
2 answers

You can export all your files with this code:

 Public Sub Export() Dim vbe As vbe Set vbe = ThisDrawing.Application.vbe Dim comp As VBComponent Dim outDir As String outDir = "C:\\Temp\\VbaOutput" If Dir(outDir, vbDirectory) = "" Then MkDir outDir End If For Each comp In vbe.ActiveVBProject.VBComponents Select Case comp.Type Case vbext_ct_StdModule comp.Export outDir & "\" & comp.Name & ".bas" Case vbext_ct_Document, vbext_ct_ClassModule comp.Export outDir & "\" & comp.Name & ".cls" Case vbext_ct_MSForm comp.Export outDir & "\" & comp.Name & ".frm" Case Else comp.Export outDir & "\" & comp.Name End Select Next comp MsgBox "VBA files were exported to : " & outDir End Sub 
+5
source

If you don't like changing the code using the Export() subroutine above, you can export your VBA code from a .dvb file using the VBA2VB Form Converter written by Leslie Lowe or a modified version written by Augusto Goncalves of the Autodesk Developer Network. This macro has the added benefit of converting simple VBA forms to VB6 forms. You will need to do this if you want the port to be migrated to .NET in the future, since AutoCAD is dropping VBA support. The modified version of the macro is especially enjoyable, as it will create a .vbproj ASCII file that you will need for the transfer, for which you would need a copy of the old Visual Basic 6 IDE.

FWIW, A .dvb file can be opened using an archive utility such as 7-Zip if you want to see what is in it, but it seems to be compiled and not useful if you want or exported code.

+2
source

Source: https://habr.com/ru/post/1344471/


All Articles