Search Text in DWG C#

DWG drawing files contain 2D or 3D design data. It is widely used by designers, engineers, and architects. In certain scenarios, you might need to find some text in a DWG file. Accordingly, this article discusses how to search text in a DWG file programmatically in C#.

Find Text in DWG Drawing File – C# API Configuration

Aspose.CAD for .NET supports creating or manipulating different CAD drawings like DWG, DXF, and several other file formats. You can easily set up the API by downloading the DLL files from the Downloads section or running the following NuGet installation command:

PM> Install-Package Aspose.CAD

How to Search Text in DWG File using C#

The following steps demonstrate how to search text in a DWG file using C#:

  1. Load an existing DWG file.
  2. Search for text by iterating through CadText entities.
  3. Search for text on a specific layout.
  4. Export the file to PDF format.

Search Text in DWG Drawing File in C#

You need to follow the steps below to search text in a DWG file using C#:

  1. Load an existing DWG file with CadImage class.
  2. Search for text by iterating through CadText entities.
  3. Search for text on specific layout.
  4. Export the file to PDF format.

The code sample below shows how to search text in a DWG file using C#:

Get Free Temporary License

You can test the features of the API without any evaluation limitations by requesting a free temporary license.

Conclusion

In this article, you have learned how to search text in a DWG file programmatically in C#. Moreover, you can explore different features of the API by taking a look at the documentation section. In case of any concerns, please write to us at forum.

See Also

Viewer of DWG files based on ASP.NET