Extract the Title and all the summary info from .dwg file

Hi,

I want to extract the summary info from dwg file. I am not able to use CADSummaryInfo in the latest dll. Is there a way to extract the Summary info from the dwg file?

@abhargava

To extract summary information from a DWG file using Aspose.CAD, you can follow these general steps:

  1. Set Up Your Project: Ensure you have the Aspose.CAD library installed in your .NET or Java project. You can do this via NuGet for .NET or by downloading the library for Java.

  2. Load the DWG File: Use the appropriate method to load your DWG file into a CadImage object. This will allow you to access the contents of the file.

  3. Access Summary Information: While the specific class CADSummaryInfo may not be available in the latest version, you can still retrieve relevant attributes and metadata from the loaded CadImage. Look for properties or methods that provide access to the file’s attributes.

  4. Iterate Through Entities: If you need to extract specific information, you can iterate through the entities in the DWG file. This includes accessing block attributes, which may contain summary information.

Here is a basic example in C# to get you started:

using Aspose.CAD;
using Aspose.CAD.ImageOptions;

// Load the DWG file
using (CadImage cadImage = (CadImage)Image.Load("path_to_your_file.dwg"))
{
    // Access and print summary information
    foreach (var attribute in cadImage.Blocks)
    {
        Console.WriteLine($"Block Name: {attribute.Name}");
        // Access other properties as needed
    }
}

Make sure to replace "path_to_your_file.dwg" with the actual path to your DWG file. This code snippet demonstrates how to load a DWG file and access its blocks, which may contain the summary information you are looking for.

If you encounter any issues or need more specific functionality, consider checking the Aspose.CAD documentation or community forums for additional guidance.

For further details, you can refer to the following resources:

I am unable to use Blocks. Also, the block entities is not giving the title and all other information. Is there other way? CadSummaryInfo is not a class anymore?

@abhargava,
Hello.
Could you please test if this is helpful:


using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load("testfile.dwg"))
{
    SummaryInfoData summaryInfo = cadImage.Header.SummaryInfo;
}