GstarCAD 2026 .NET Migration Guide
GstarCAD 2026 .NET Migration Guide
Contents
- #Table of Conents
- #1. Introduction
- #2. Programming Environment
- #3. Requirement on Original Source Code
- #4. Install GstarCAD SDK
- #5. Visual Studio 2022 C# .NET Program Migration Process
- #6. Visual Studio 2022 VB .NET Program Migration Process
- #7. Other Usage
- #8. Copyright
Table of Conents
| 1. | Intro | duction .. | … 3 |
|---|---|---|---|
| 2. | Prog | ramming | Environment … 4 |
| 3. | Requ | irement | on Original Source Code … 5 |
| 4. | Insta | ll GstarC | AD SDK … 6 |
| 5. | Visu | al Studio | 2022 C# .NET Program Migration Process … 7 |
| 5.1. | Chan | ge Reference File … 7 | |
| 5.1.1. | Remove Reference … 7 | ||
| 5.1.2. | Add Reference … 7 | ||
| 5.1.3. | Load Reference File … 9 | ||
| 5.2. | Modi | fy Name in Namespace … 11 | |
| 5.3. | Comp | ile Program … 11 | |
| 6. | Visu | al Studio | 2022 VB .NET Program Migration Process … 12 |
| 6.1. | Chan | ge Reference File … 12 | |
| 6.1.1. | Remove Reference … 12 | ||
| 6.1.2. | Add Reference … 12 | ||
| 6.1.3. | Load Reference File … 13 | ||
| 6.2. | Modi | fy Name in Namespace … 15 | |
| 6.3. | Comp | ile Program … 15 | |
| 7. | Othe | r Usage . | … 16 |
| 7.1. | Abtai | n GCAD Application Object under Visual Basic Environment … 16 | |
| 7.2. | C# . | NET and VB .NET Namespace Modification … 16 | |
| 7.3. | Samp | le of Replacement … 17 | |
| 7.3.1. | Sample of Namespace Replacement … 17 | ||
| 7.3.2. | Sample of Class Name and Property Name Replacement… 17 | ||
| 8. | Cop | yright … | … 18 |
1. Introduction
There are a large number of .NET applications based on AutoCAD® . With GstarCAD SDK, it is easy to migrate .NET application programs running on AutoCAD® to GstarCAD with little change to the original source codes, keeping the source-code-level compatibility.
2. Programming Environment
-
Microsoft® Visual Studio 2022 (version 17.8.0)
-
Windows SDK 10.0 (latest installed version)
-
CPU:
Basic: 1.6 GHz CPU Recommended: 3.0 GHz CPU and above
- RAM:
Basic: 2 GB
Recommended: 8 GB and above
- Operation System (OS)
Windows 11
Windows 10 (version 1507 and above):
Home, Professional, Education and Enterprise (not support LTSC and Windows 10 S)
Windows 8.1 (with 2919355 update):
Core, Professional and Enterprise
Windows 7 SP1 (with the latest update):
Home, Professional, Enterprise and Ultimate
- Monitor Resolution:
1028x800 and above true color display, including 4K (3840x2160) display
-
GstarCAD SDK 2026
-
GstarCAD 2026
-
Microsoft .NET 8.0
3. Requirement on Original Source Code
The original source codes should be .NET application source codes of .NET ObjectARX 2025.
4. Install GstarCAD SDK
Download GstarCAD SDK (' GRXSDK.ZIP ' file) from GstarCAD website:
https://www.gstarcad.net/download/
Unzip GRXSDK.ZIP file to the local disk (e.g. 'C:\grxsdk' ) and there will be 5 directories generated (in 'C:\grxsdk' ) which are: arx , inc , inc-x64 , lib-x64 and utils .
arx contains the header files, library files and sample programs used for porting ARX programs to GRX programs. It contains the following directories:
-
Inc: Header files used for porting from ARX to GRX
-
inc-x64 : Files used by COM and .NET (for 64-bit)
-
lib-x64 : GRX libraries (for 64-bit)
-
Samples : Sample projects, including Dotnet, fact_dg, HelloADS, HelloA and SimplePalette.
-
Dotnet : .NET programming samples
-
- Addline : .NET programming sample of adding solid lines
-
- Hello : .NET programming sample of outputting prompt information
-
- Vbhello : Sample of .NET programming with VB .NET
-
fact_dg : Sample of LISP function definition
-
HelloADS : Sample of ADS programming
-
HelloARX : Sample of GRX programming
-
SimplePalette : Programming sample of how to create a set Palette windows
-
Utils: Directory contains sub-directories of GRX extended applications, including APIs for extended function development,
e.g. BREP for boundary representation.
Inc: Header files used for programming the GRX
inc-x64 : Files used by COM and .NET (for 64-bit) lib-x64 : GRX libraries (for 64-bit)
Utils : Directory contains subdirectories of GRX extended applications, including APIs for extended function development, e.g. BREP for boundary representation.
5. Visual Studio 2022 C# .NET Program Migration Process
The following illustrates the migration process by taking the ' Hello ' project as an example, and assumes that the GstarCAD SDK is installed in ' C:\grxsdk '.
5.1. Change Reference File
5.1.1. Remove Reference
From Solution Explorer of Visual Studio 2022, find project ' Hello ' and remove relevant ARX reference files, as shown below.
5.1.2. Add Reference
In Solution Explorer of Visual Studio 2022, right-click on project ' Hello ' and select Add Reference . After the Reference Manager dialog window pops out, click Browse… button as shown below.
5.1.3. Load Reference File
From the installation path of GstarCAD SDK, e.g. ' C:\grxsdk' , select 'GcCoreMgd.dll', 'GcDbMgd.dll' and 'GcMgd.dll' in ' \arx\inc ' and ' GrxCAD.Interop.dll ' or ' acax.tlb ' in ' \arx\inc-x64 ', and add them by clicking Add button.
' GcCoreMgd.dll', 'GcDbMgd.dll' and 'GcMgd.dll' must be added while 'GrxCAD.Interop.dll ' (or ' acax.tlb ') is optional (needed when COM is used in the program).
After adding the files, right-click added ' GcCoreMgd.dll', 'GcDbMgd.dll' and 'GcMgd.dll' files and select Properties at the context menu, the Reference Properties palette pops up. Set the value of Copy Local property to False . The following screenshot shows how to change Copy Local property of ' GcCoreMgd.dll '.
5.2. Modify Name in Namespace
Replace the ' Autodesk.AutoCAD ' with corresponding ' Gssoft.Gscad ' in .NET source codes.
5.3. Compile Program
In Visual Studio 2022, click Build → Build Solution to regenerate the DLL file in corresponding directory. Run GstarCAD and input ' netload ' at command line, select the relative DLL file from Select .Net Assembly dialog window and click Open button to load it.
6. Visual Studio 2022 VB .NET Program Migration Process
The following illustrates the migration process by taking the ' vbHello ' project as an example, and assumes that the GstarCAD SDK is installed in ' C:\grxsdk' .
6.1. Change Reference File
6.1.1. Remove Reference
From Solution Explorer of Visual Studio 2022, find project ' vbHello ' and remove relevant ARX reference files, as shown below.
6.1.2. Add Reference
In Solution Explorer of Visual Studio 2022, right-click on project ' vbHello ' and select Add Reference . After the Reference Manager dialog window pops out, click Browse… button as shown below.
6.1.3. Load Reference File
From the installation path of GstarCAD SDK, e.g. ' C:\grxsdk' , select 'GcCoreMgd.dll', 'GcDbMgd.dll' and 'GcMgd.dll' in ' \arx\inc ' and ' GrxCAD.Interop.dll ' or ' acax.tlb ' in ' \arx\inc-x64 ', and add them by clicking Add button.
' GcCoreMgd.dll', 'GcDbMgd.dll' and 'GcMgd.dll' must be added while 'GrxCAD.Interop.dll ' (or ' acax.tlb ') is optional (needed when COM is used in the program).
After adding the files, right-click added ' GcCoreMgd.dll', 'GcDbMgd.dll' and 'GcMgd.dll' files and select Properties at the context menu, the Reference Properties palette pops up. Set the value of Copy Local property to False . The following screenshot shows how to change Copy Local property of ' GcCoreMgd.dll '.
6.2. Modify Name in Namespace
Replace the ' Autodesk.AutoCAD ' with corresponding ' Gssoft.Gscad ' in .NET source codes.
6.3. Compile Program
In Visual Studio 2022, click Build → Build Solution to regenerate the DLL file in corresponding directory. Run GstarCAD and input ' netload ' at command line, select the relative DLL file from Select .Net Assembly dialog window and click Open button to load it.
7. Other Usage
7.1. Abtain GCAD Application Object under Visual Basic Environment
By adding ' C:\grxsdk\arx\inc-x64\acax.tlb ' as reference, it is possible to obtain GCAD application objects with following codes.
Imports Gssoft.Gscad.Runtime
Imports GcadVbaLib
Public Class Class1
<CommandMethod("GetGcadApplication")>
Public Sub GetGcadApplication()
'Define abtain GcadApplication object, the object is null
Dim GCadApp As GcadApplication
' Abtain the object address through the process name.
GCadApp = GetObject(, "gcad.application")
'Minimize the abtained process window
GCadApp.WindowState = GcWindowState.acMin
End Sub
End Class
7.2. C# .NET and VB .NET Namespace Modification
VB .NET:
Change 'Autodesk.AutoCAD ' to 'Gssoft.Gscad ' after the 'Imports '
- C# .NET:
Change 'Autodesk.AutoCAD ' to 'Gssoft.Gscad ' after the 'using '
- COM With VB .NET:
Add 'Imports GcadVbaLib ' and delete 'Autodesk.AutoCAD.Interop.Common '
- COM With C# .NET:
Add 'using GcadVbaLib ' and delete 'Autodesk.AutoCAD.Interop.Common '
For the COM object name in the codes, such as AcadLWPolyline, it is needed to change the prefix ' Acad' to ' Gcad' , e.g. 'AcadLWPolyline ' should be change to 'GcadLWPolyline '.
If it's not sure a COM object exists or not, then first check it from the object browser, e.g. for ACAD_COLOR , check whether there is corresponding GCAD_COLOR first from the browser. Then change ' ACAD_COLOR' to ' GCAD_COLOR' if GCAD_COLOR is found.
7.3. Sample of Replacement
7.3.1. Sample of Namespace Replacement
| AutoCAD® | GstarCAD |
|---|---|
| Autodesk.AutoCAD.ApplicationServices | Gssoft.Gscad.ApplicationServices |
| Autodesk.AutoCAD.EditorInput | Gssoft.Gscad.EditorInput |
| Autodesk.AutoCAD.GraphicsSystem | Gssoft.Gscad.GraphicsSystem |
| Autodesk.AutoCAD.PlottingServices | Gssoft.Gscad.PlottingServices |
| Autodesk.AutoCAD.Publishing | Gssoft.Gscad.Publishing |
| Autodesk.AutoCAD.Runtime | Gssoft.Gscad.Runtime |
| Autodesk.AutoCAD.Windows | Gssoft.Gscad.Windows |
| Autodesk.AutoCAD.Colors | Gssoft.Gscad.Colors |
| Autodesk.AutoCAD.DatabaseServices | Gssoft.Gscad.DatabaseServices |
| Autodesk.AutoCAD.DatabaseServices.Filters | Gssoft.Gscad.DatabaseServices.Filters |
| Autodesk.AutoCAD.Geometry | Gssoft.Gscad.Geometry |
| Autodesk.AutoCAD.GraphicsInterface | Gssoft.Gscad.GraphicsInterface |
| Autodesk.AutoCAD.LayerManager | Gssoft.Gscad.LayerManager |
7.3.2. Sample of Class Name and Property Name Replacement
| AutoCAD® | GstarCAD |
|---|---|
| Autodesk.AutoCAD.Interop.Common.ACAD_COLOR | GcadVbaLib.GCAD_COLOR |
| Autodesk.AutoCAD.Interop.Common.AcadEntity | GcadVbaLib.GcadEntity |
| Autodesk.AutoCAD.Interop.Common.AcSelect | GcadVbaLib.GcSelect |
| _Autodesk.AutoCAD.Interop.Common.AcadRasterImage _ | _GcadVbaLib.GcadRasterImage _ |
| Autodesk.AutoCAD.Interop.Common.AcadText | GcadVbaLib.GcadText |
| Autodesk.AutoCAD.Interop.Common.AcadMText | GcadVbaLib.GcadMText |
| Autodesk.AutoCAD.Interop.Common.AcWindowState | GcadVbaLib.GcWindowState |
8. Copyright
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.
