GstarCAD 2026 GRX Migration Guide
GstarCAD 2026 GRX Migration Guide
Contents
- #1. Introduction
- #2. Programming Environment
- #3. Requirement on Original Source Code
- #4. Install GstarCAD SDK
- #5. Project Configuration
- #6. Migrate ARX Project with Visual Studio 2022
- #7. Description of GRX Class Library
- #8. About the Use of Macro OBJECTPARAM_ALLOWED
- #9. Copyright
1. Introduction
GRX is the Runtime eXtension programming environment of GstarCAD, which is the latest application development SDK provided with GstarCAD. It provides Object-oriented development environment and APIs based on C++, which can be used to develop GstarCAD application programs, extension CAD classes and protocols, and create new commands in GstarCAD.
One of GRX's advantages is that it supports seamless migration of ARX application programs running on AutoCAD® to GstarCAD with little change to the original source code, 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
For the application source code with version lower than ObjectARX 2025, it needs to upgrade the source code to the ObjectARX 2025 first. Source code shall be compiled with Visual Studio 2022, under 'Use Unicode Character Set' and 'Multi-threaded DLL(/MD)' environment.
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. Project Configuration
'<sdkpath>' indicates the installation path of GstarCAD SDK, e.g. ' C:\grxsdk' .
-
General / Target Extension : .grx
-
Select C/C++ in Configuration Properties and set as below:
General / Additional Include Directories : <sdkpath>\arx\inc
- Select Linker in Configuration Properties and set as below:
General/Accessory library directory : <sdkpath>\arx\lib-x64
Under debug configuration, please delete _DEBUG macro definition from C/C++ drop down list Preprocessor -Preprocessor Definitions and set Code Generation / Runtime Library as ' Multi-threaded DLL (/MD)' .
- Additional Dependencies:
| Lib Name | Need to import or not | Description of related module |
|---|---|---|
| AecModeler.lib | As needed | Faceted solid modeler |
| GcDbConstraints.lib | As needed | Constraint |
| gcdyn.lib | As needed | Dynamic block |
| gcad.lib | Usually | GUI/Controls |
| gcax.lib | As needed | COM service |
| gcbase.lib | Usually | Basic APIs, including memory, graphics, strings, etc |
| gcbr.lib | As needed | 3D solid boundary |
| gccore.lib | Usually | Editing/Document |
| gcdb.lib | Usually | Database/Entity |
| GcDbPointCloudObj.lib | As needed | Point cloud |
| GcGeolocationObj.lib | As needed | Geographic map |
| gcgs.lib | As needed | Display |
| GcImaging.lib | As needed | Image |
| GcModelDocObj.lib | As needed | Symbolic entity |
| gplot.lib | As needed | Printing |
Select Input/Additional Dependencies under Linker in Configuration Properties , remove lib files of ARX and add lib files of GRX:
'AecModeler.lib;gcad.lib;gcax.lib;gcbase.lib;gcbr.lib;gccore.lib;gcdb.lib;GcDbConstraints.lib;GcDbPointCloudObj.lib;gcdyn.lib;GcGe olocationObj.lib;gcgs.lib;GcImaging.lib; GcModelDocObj.lib;gplot.lib;'
Meanwhile, set Module Definition File path as '<sdkpath>\arx\inc\AcRxDefault.def'
6. Migrate ARX Project with Visual Studio 2022
7.1. Configuration of Target Extension
Select Advanced in Configuration Properties and set Target Extension as '.grx' , and set Configuration as 'Release' .
7.2. Configuration of Include Directory
Select C/C++ in Configuration Properties and set Additional Include Directories of General as '<sdkpath>\arx\inc' as shown below.
7.3. Configuration of Link
- General Configuration
Select General under Linker of Configuration Properties and set Additional Library Directories to ' <sdkpath>\arx\lib-x64' , as shown below.
2) Input Configuration
Select Input / Additional Dependencies under Linker of Configuration Properties , remove the lib files of ARX and add lib files of GRX:
'AecModeler.lib;gcad.lib;gcax.lib;gcbase.lib;gcbr.lib;gccore.lib;gcdb.lib;GcDbConstraints.lib;GcDbPointCloudObj.lib;gcdyn.lib;GcGe olocationObj.lib;gcgs.lib;GcImaging.lib; GcModelDocObj.lib;gplot.lib;'
Meanwhile, set Module Definition File path as '<sdkpath>\arx\inc\AcRxDefault.def'
7.4. Compile Program
After completing the above steps, compile the project and make sure that the compilation is successful. Otherwise repeat the above steps to reconfigure the project settings.
7. Description of GRX Class Library
The following libraries are frequently used in programming with GRX. These libraries have same functions with the corresponding
ARX libraries.
-
GcRx : same as AcRX of ARX , classes for binding an application and for runtime class registration and identification
-
GcEd : same as AcEd of ARX , classes for registering commands and for event notification
-
GcDb : same as AcDb of ARX , GstarCAD database class
-
GcGi : same as AcGi of ARX , graphics classes for rendering entities
-
GcGe : same as AcGe of ARX , utility classes for common linear algebra and geometric objects
7.5. GcRx
The GcRx class library provides system-level functionality such as DLL initialization and linking, and runtime class registration and
identification as below:
-
Object runtime class identification and inheritance analysis
-
Runtime addition of new protocol to an existing class
-
Object equality and comparison testing
-
Object copy
7.6. GcEd
The GcEd class library is used to define and register new GstarCAD commands which operate in the same manner as the original ones.
7.7. GcDb
The GcDb classes are components of the GstarCAD database. This database stores all the information for the graphical objects that
compose a drawing, and the non-graphical objects (such as layers, linetypes, and text styles) that are also part of a drawing.
7.8. GcGi
The GcGi class library provides the graphic interface used for drawing CAD entities.
7.9. GcGe
The GcGe class library provides classes used for performing common 2D and 3D geometric operations, including utility
classes such as vectors and matrices and basic geometric objects such as points, curves, and surfaces.
8. About the Use of Macro OBJECTPARAM_ALLOWED
In order to be compatible with ObjectARX2025, in GRX2026 of GstarCAD, if GcString is passed into a variable parameter function
such as gcutPrintf, it is necessary to call GcString :: constPtr (); as follows:
Previous version:
GcString sz ;
_gcutPrintf ( T( " \ n%s " ), sz );
2026 Edition
GcString sz ;
_gcutPrintf ( T( " \ n%s " ), sz.constPtr ());
If this modification is not made ( i.e. constPtr () is not called), a compilation error will be reported when GRX is compiled:
error C4840: non-portable use of class " GcString " as argument to variadic function
Developers can use this compilation error to modify the code where GcString is called in previous versions.
This compatibility change will result in a compilation error when CStirng is passed into a variable parameter function such as
gcutPrintf :
error C4840: non-portable use of class "ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t>>>" as
argument to a variadic function
At this point, you can choose one of the following two methods to modify it:
Method 1: Change to
_gcutPrintf ( T("%s"), sz.GetBuffer ()); or
_gcutPrintf ( T("%s"), ( LPCTSTR ( sz )));
Method 2: After modifying all GcString codes , add OBJECTPARAM_ALLOWED definition in the project configuration . This macro definition can ignore all such compilation errors. As shown below
9. 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.
