Course 19: C# .NET & C++ GRX SDK Development — Porting AutoCAD ObjectARX Plugins to GstarCAD 2027
Set up Visual Studio 2022 with GsMgdDbg/gced.h headers, use Database.TransactionManager for high-speed entity creation, build Ribbon palettes, and dual-target AutoCAD & GstarCAD.
Course Technical Scope & Production Competencies
Independent Software Vendors (ISVs) and enterprise R&D teams with tens of thousands of lines of C# .NET or C++ ObjectARX code need a deterministic, low-effort migration path to GstarCAD 2027. Course 19 walks software engineers through multi-target Visual Studio 2022 project architecture, namespace mapping, and binary compilation.
- Configure a single Visual Studio 2022 C# (.csproj) or C++ (.vcxproj) solution using conditional compilation symbols (#if GSTARCAD vs. #if AUTOCAD) to build both .dll/.grx binaries from one codebase.
- Map AutoCAD .NET assemblies (AcCoreMgd.dll, AcDbMgd.dll, AcMgd.dll) to GstarCAD managed assemblies (GsMgd.dll, GsDbMgd.dll) with Copy Local = False and Gssoft.GstarCAD.* namespaces.
- Port C++ ObjectARX custom entities (AcDbEntity), database reactors, and Jig classes to the GstarCAD 2027 GRX SDK (MSVC v143 x64 toolset) and package multi-version .bundle autoloader plugins.
Module 1: Porting AutoCAD C# .NET & C++ ObjectARX Plugins to GstarCAD 2027 GRX SDK
Suzhou Gstarsoft Co., Ltd. (SSE: 688657) engineered the GstarCAD GRX SDK and .NET Managed API specifically to minimize porting friction for the global AutoCAD developer community. In C# .NET, the class names (`Database`, `Transaction`, `BlockTable`, `BlockTableRecord`, `Entity`, `Editor`, `PromptPointOptions`, `PaletteSet`) and method signatures are 99.5% identical; porting typically requires changing only the top-level `using` directives from `Autodesk.AutoCAD.*` to `Gssoft.GstarCAD.*`.
In C++ GRX, GstarCAD provides matching compatibility headers (`grxdefs.h`, `aced.h`, `dbmain.h`) that alias `AcDb*`, `AcGe*`, and `AcGi*` symbols directly to the underlying GstarCAD kernel runtime—allowing million-line commercial civil, piping, and architectural plugins to recompile cleanly.
Module 2: Step-by-Step Hands-On Command Execution Lab
Follow this structured 4-step laboratory procedure directly at the GstarCAD command line or dynamic input prompt:
- Step 1 — Environment & System Variable Initialization: At the command prompt, verify the active state of core commands and variables:
NETLOAD, CommandMethod, TransactionManager, BlockTableRecord, AcDbObject / OdDbObject. Ensure that object snap bitcodes (OSMODE=175), associative dimensioning (DIMASSOC=2), and multi-core display regeneration (WHIPTHREAD=3) are active. - Step 2 — Primary Geometry & Metadata Authoring: Execute the primary workflow on standardized ISO 13567 or discipline-specific layers. Never place production geometry or block definitions on
Defpoints, and keep internal block geometry onLayer 0so instances inherit host layer properties dynamically. - Step 3 — Associative Verification & Revision Auditing: Test parametric associativity by stretching or modifying parent geometry and confirming that linked dimensions, attributes, schedules, or section views update automatically without disassociation warnings (
ANNOMONITOR=2). - Step 4 — Pre-Transmittal Quality Assurance (QA/QC): Prior to saving or publishing the deliverable, run
OVERKILLto eliminate duplicate vectors,-PURGE(RegApps and All) to strip orphaned symbol table bloat, andAUDITto verify 100%AcDbObjecthandle integrity.
Module 3: Command & System Variable Reference Matrix
| Workflow Stage | Primary Commands & Variables | Enterprise Production Standard |
|---|---|---|
| .NET Assemblies | GsMgd.dll / GsDbMgd.dll |
Managed C#/.NET 4.8+ API under Gssoft.GstarCAD.Runtime, ApplicationServices, and DatabaseServices. |
| C++ GRX Kernel | grxdefs.h / gcedRegCmds |
Source-level C++ ObjectARX equivalent compiled with Visual Studio 2022 (MSVC v143 x64). |
| Autoloader Pack | ApplicationPlugins/*.bundle |
Deploys zero-touch plugin packages via PackageContents.xml across enterprise workstations. |
Module 4: Practical Lab Exercise & Certification Self-Check
Hands-On Capstone Task: Open a production DWG file in GstarCAD 2027, execute the complete NETLOAD, CommandMethod, TransactionManager, BlockTableRecord, AcDbObject / OdDbObject sequence documented above, and save your standardized configuration as a reusable corporate template (.dwt). Once you have verified zero audit errors and clean Paper Space viewport scaling, test your mastery in the official GstarCAD Skill Certification & Assessment Engine.