Sharper.GstarCAD.Extensions 2026.0.0

dotnet add package Sharper.GstarCAD.Extensions --version 2026.0.0
                    
NuGet\Install-Package Sharper.GstarCAD.Extensions -Version 2026.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sharper.GstarCAD.Extensions" Version="2026.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sharper.GstarCAD.Extensions" Version="2026.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Sharper.GstarCAD.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sharper.GstarCAD.Extensions --version 2026.0.0
                    
#r "nuget: Sharper.GstarCAD.Extensions, 2026.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sharper.GstarCAD.Extensions@2026.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sharper.GstarCAD.Extensions&version=2026.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Sharper.GstarCAD.Extensions&version=2026.0.0
                    
Install as a Cake Tool

Sharper.GstarCAD.Extensions

GstarCAD Extension Library

The GstarCAD port of Gile.AutoCAD.Extension. This is an unofficial extension library enhanced for GstarCAD .NET SDK.

You can get GstarCAD SDK on the official website https://www.gstarcad.com/download/, or on the Nuget Gallery.

This library should help to write code in a more concise and declarative way.

Example with a method to erase lines in model space which are smaller than a given distance:

public void EraseShortLines(double minLength)
{
    var db = Application.DocumentManager.MdiActiveDocument.Database;
    using (var tr = db.TransactionManager.StartTransaction())
    {
        var blockTable = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
        var modelSpace = (BlockTableRecord)tr.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForRead);
        var lineClass = RXObject.GetClass(typeof(Line));
        foreach (ObjectId id in modelSpace)
        {
            if (id.ObjectClass == lineClass)
            {
                var line = (Line)tr.GetObject(id, OpenMode.ForRead);
                if (line.Length < minLength)
                {
                    tr.GetObject(id, OpenMode.ForWrite);
                    line.Erase();
                }
            }
        }
        tr.Commit();
    }
}

The same method can be written:

public void EraseShortLines(double minLength)
{
    var db = Active.Database;
    using (var tr = db.TransactionManager.StartTransaction())
    {
        db.GetModelSpace()
            .GetObjects<Line>()
            .Where(line => line.Length < minLength)
            .UpgradeWrite()
            .ToList()
            .ForEach(line => line.Erase());
        tr.Commit();
    }
}

Build the project

> build.bat

If 'msbuild' is not recognized, please set compilation environment firstly.

Deployment

This library is published as a nuget package in nuget.org.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.0.0 166 8/24/2025
2024.4.0 188 5/13/2024
2024.3.0 172 3/13/2024
2024.2.0 192 12/29/2023
2024.1.0 212 11/6/2023
2023.2.0 156 8/24/2025
2023.1.0 151 5/13/2024
2022.2.0 163 3/13/2024
2022.1.0 328 10/30/2022 2022.1.0 is deprecated because it is no longer maintained and has critical bugs.