ImageGear .NET - Updated March 30, 2018
Extract Text from DWG/DXF Formats
User Guide > How to Work with... > CAD > How To ... > Extract Text from DWG/DXF Formats

To extract text from a loaded DWG/DXF file, call ImGearDWGPage.ExtractText() and it returns a list of CADText objects.

Each CADText object contains the text and position of the text object.

The position is absolute and is based on the "world coordinates" of the DWG/DXF format. The position is stored in a double[3] and contains the x, y, z coordinates, respectively. 

Only text from the active layout will be extracted. See SetActiveLayout() for a look at how to change the layout that is currently active.
C#
Copy Code
using System.IO;
using System.Collections.Generic;
using ImageGear.Formats;
using ImageGear.Formats.CAD;

public static void ExtractTextFromCad(string path)
{
    ImGearDWGPage page = null;

    // Load the file.
    using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
    {
        page = (ImGearDWGPage)ImGearFileFormats.LoadPage(fileStream);
    }

    // Extract the text and use the returned list of CADText as desired.
    List<CADText> extractedText = page.ExtractText();
}