Digi21.DigiNG.IO.Dwg

This assembly provides an importer/exporter for AutoCAD DWG files (.dwg).

Digi3D.AI installs the assembly in <carpeta de instalación>\Digi21.DigiNG.IO.Dwg\26.0.0\Digi21.DigiNG.IO.Dwg.dll. The default installation folder is C:\Program Files\Digi21.net\Digi3D.AI.

How to reference it

Digi21.DigiNG.IO.Dwg has no NuGet package. To use it:

  1. Add the Digi21.DigiNG package to the project. It contains the entity types and the Digi3DAssemblyResolver.cs file that loads assemblies from the installation folder.
  2. Add a reference to the installed DLL with Private set to false, so it is not copied to the output folder:
<ItemGroup>
  <PackageReference Include="Digi21.DigiNG" Version="26.0.0" />
  <Reference Include="Digi21.DigiNG.IO.Dwg">
    <HintPath>C:\Program Files\Digi21.net\Digi3D.AI\Digi21.DigiNG.IO.Dwg\26.0.0\Digi21.DigiNG.IO.Dwg.dll</HintPath>
    <Private>false</Private>
  </Reference>
</ItemGroup>

When the program runs, .NET does not find Digi21.DigiNG.IO.Dwg in the program folder and the code in Digi3DAssemblyResolver.cs loads it from <carpeta de instalación>\Digi21.DigiNG.IO.Dwg\26.0.0\, just like assemblies from NuGet packages. This mechanism is explained in Migrating to .NET 10.

Unlike a NuGet package, this reference compiles against the full assembly rather than a reference assembly. Therefore, Digi3D.AI must be installed on the computer used to compile the program. The BindADwg example calculates the DLL path from the installation folder.

Types

Type Description
Dwg Drawing file in AutoCAD DWG format (.dwg).
DwgParameters Read and write parameters for a DWG file.
DwgVersion AutoCAD version used to write the file.
DwgImportBlocksAs Entity type to which block references are converted.

For DGN files, use Digi21.DigiNG.IO.Dgn.