GstarCAD 2026 VBA Migration Guide

Contents

396af350f6957c246f4854bb

1. Migrate Project Code

1.1. Run AutoCAD® VBA Manager

Run VBAMAN command to launch the VBA Manager in AutoCAD® as shown below.

b2bec23972381c5dabcdb578

1.2. Load Project File (.dvb) to Be Migrated

Click Load… and select the DVB file to load, e.g. 'v baSample.dvb ' as shown below:

14537d2dd8d1dd29246af347 e51b19df2540245636b490d6

3

1.3. Run VBA Editor

Click Visual Basic Editor button to launch VBA editor and all the project contents of ' vbaSample.dvb ' are listed on the left side of the VBA editor, and the project name is 'MySection '.

150b344260f36260e6aa68af

1.4. Export VBA Project

  1. Right click on the items under Forms , Modules or Class Modules , e.g. right click on the ' frmAbout ' form under Forms and select Export File…, as shown below:
bdb94b88a57bdc03f19e1190
  1. Specify a folder to save the exported file (The extension of exported form file is '. frm ').

  2. In the same way, export modules and class modules to files (The extension of exported module is ' .bas ', and the extension of exported class module is ' .cls ').

  3. Double click on ' ThisDrawing ' under AutoCAD Objects to show and copy the codes to a new file.

1.5. Run VBA Editor in GstarCAD

Run VBAIDE command to launch the VBA editor in GstarCAD, same as that of AutoCAD. A new empty project ' GCADProject ' is automatically created by default.

6b4ed305c85f2c0665005387

1.6. Modify Project Name

Right click on the ' GCADProject ' and select GCADProject Properties(E)… , the Project Properties dialog window pops out. Modify the Project Name to ' MySection ' as same name as that in AutoCAD, and click OK .

1ccf30eb3558891ae8d91f9f 01dadac213642e6fe01adeb4

7

1.7. Import File

  1. Right click on 'MySection ' project and select the Import File… The Import File dialog window pops out, as shown below.
6027df01943d0a372f5e49c2
  1. Select all files just exported from AutoCAD and import into ' MySection ' project, as shown below:
5df1ba7ae0bb51653254b758 4cf9125be13cd868ad5487dd

1.8. Import Code of ' ThisDrawing '

Copy the source codes exported from ' ThisDrawing ' in AutoCAD to ' ThisDrawing ' here in GstarCAD VBA editor.

896c88247127854a7d1f40ce

9

1.9. Save as GstarCAD VBA Project (.vbi)

Click File → Save to save ' MySection ' project as ' vbaSample.vbi ', as shown below:

961600b988283cf3bce030d4 bb57c57016d8f458f3c464b6
NOTE

The extension name of AutoCAD VBA project file is ' DVB ' while the extension name of GstarCAD VBA project file is ' VBI '.

2. Modify Migrated Code

  1. Replace the preifx ' Acad ' of COM object name used in migrated codes with ' Gcad ' in correspondance with GstarCAD, e.g. replace " AcadLine " with " GcadLine ".

  2. Replace the ' autocad. a pplication ' used in migrated codes with ' gcad.application ' in correspondance with GstarCAD.

Copyright reserved: Gstarsoft Co.,Ltd

Copying and referencing any part of this document is allowed. No part of this document may be changed without permission. Please keep this statement when copying or referencing this document.

5e84c5956fb31cf28a507cb7