GstarCAD 2024 .NET Upgrade Guide

Contents

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/7fedf6f9f06dc3a5bc9ac0f9

1. Introduction

This document illustrates how to upgrade and adapt the .NET project/application to GstarCAD 2024 from old

versions of GstarCAD.

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 2024

  • GstarCAD 2024

  • .NET Framework 4.8 and above

3. 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

    1. Addline : .NET programming sample of adding solid lines
    1. Hello : .NET programming sample of outputting prompt information
    1. 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.

4. Visual Studio 2017 C# .NET Program Upgrade Process

The following illustrates the upgrade process by taking the ' Hello ' project as an example, and assumes that the GstarCAD SDK is installed in ' C:\grxsdk '.

4.1. Change Reference File

4.1.1. Remove Reference

From Solution Expore r of Visual Studio 2017, find project ' Hello ' and remove relevant reference files of previous version of GstarCAD, as shown below.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/160bbf9a314e2a2115b1392c

4.1.2. Add Reference

In Solution Exporer of Visual Studio 2017, right-click on project ' Hello ' and select Add Reference . After the Reference Manager dialog window pops out, click Browse… button as shown below.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/d35d8437dd251251a70a4464 Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/08211e656b6ce720b7bd290c

4.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.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/0de25a138125c186415e2430 Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/d2b31b1235ac472f9a9fa8da Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/4a2d7b4e51f9571e3f100932
NOTE

' 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 one by one 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 '.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/06cd1ad1b160caf1b51a703d

4.2. Change Target Framework

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/368215b94d65ed483c1c6653

In Solution Exporer of Visual Studio 2017, right-click on project ' Hello ' and select Properties . After the dialog window pops out, select Application and change the Target framework to .NET Framework 4.8 from the pull-down list.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/6968ee4fa2a23ee5cda57ee4

4.3. Compile Program

In Visual Studio 2017, 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.

5. Visual Studio 2017 VB .NET Program Upgrade Process

The following illustrates the upgrade 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 Expore r of Visual Studio 2017, find project ' Hello ' and remove relevant reference files of previous version of GstarCAD, as shown below.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/465d132d4a77fbbdd830db90

5.1.2. Add Reference

In Solution Exporer of Visual Studio 2017, right-click on project ' Hello ' and select Add Reference . After the Reference Manager dialog window pops out, click Browse… button as shown below.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/37f0b9b9b9d7d526254050ab Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/45b4e38a092dde0976fd0ccc

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.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/0de25a138125c186415e2430 Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/728f77a4b730e51cdde000ea
NOTE

' 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 one by one 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 '.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/4bcfc0fc7e4b782455c03d98 Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/368215b94d65ed483c1c6653

5.2. Change Target Framework

In Solution Exporer of Visual Studio 2017, right-click on project ' Hello ' and select Properties . After the dialog window pops out, select Application and change the Target framework to .NET Framework 4.8 from the pull-down list.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/1670ffd7e360475d4467fdf1

5.3. Compile Program

In Visual Studio 2017, 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.

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.

Literature/GSTARCAD/2024/03 API Guides/assets/NET Upgrade Guide assets/4e269b12e0e8eb1a535965d6