GstarCAD 2023 GRX Migration Guide
GstarCAD 2023 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 2017
- #7. Description of GRX Class Library
- #8. 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 Enterprise 2017 (Version 15.9.17)
-
Windows SDK 10.0.17763.0
-
CPU:
Basic: 1.6 GHz CUP
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 2023
-
GstarCAD 2023
-
.NET Framework 4.8 and above
3. Requirement on Original Source Code
For the application source code with version lower than ObjectARX 2020, it needs to upgrade the source code to the ObjectARX 2020 first. Source code shall be compiled with Visual Studio 2017, 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-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
Assumes that the GstarCAD SDK is installed in ' C:\grxsdk '.
-
General / Target Extension : .grx
-
Select C/C++ in Configuration Properties and set as below:
General / Additional Include Directories : C:\grxsdk\arx\inc
- Select Linker in Configuration Properties and set as below:
General/Accessory library directory : C:\grxsdk\arx\lib-x64
Under debug configuration, please delete _ DEBUG macro definition 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;GcDbConstrai
nts.lib;GcDbPointCloudObj.lib;gcdyn.lib;GcGeolocationObj.lib;gcgs.lib;GcImaging.lib;
- GcModelDocObj.lib;gplot.lib;'
Meanwhile, set Module Definition File path as 'C:\grxsdk\arx\inc\AcRxDefault.def'
6. Migrate ARX Project with Visual Studio 2017
6.1. Configuration of Target Extension
Select General in Configuration Properties and set Target Extension as '.grx' , and set Configuration as 'Release' .
6.2. Configuration of Include Directory
Select C/C++ in Configuration Properties and set Additional Include Directories of General as
- 'C:\grxsdk\arx\inc' as shown below.
6.3. Configuration of Link
1) General Configuration
Select General under Linker of Configuration Properties and set Additional Library Directories to ' C:\grxsdk\arx\lib-x64' , as shown below.
- 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;GcDbConstrai
nts.lib;GcDbPointCloudObj.lib;gcdyn.lib;GcGeolocationObj.lib;gcgs.lib;GcImaging.lib;
- GcModelDocObj.lib;gplot.lib;'
Meanwhile, set Module Definition File path as 'C:\grxsdk\arx\inc\AcRxDefault.def'
6.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.1. 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.2. 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.3. 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.4. GcGi
The GcGi class library provides the graphic interface used for drawing CAD entities.
7.5. 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. 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.
