Inquiry about AutoCAD GROUP extraction in Aspose.CAD for .NET

Hello,

I am a developer currently working with Aspose.CAD for .NET to process DWG files.

I am trying to extract AutoCAD GROUP objects (for example, a group consisting of a circle, text, and line) using Aspose.CAD.

My test environment is as follows:

  • Aspose.CAD for .NET (latest version)
  • A simple DWG file containing only one GROUP (attached: GROUP_TEST.dwg)

I have attempted the following approaches:

  1. Iterating through cadImage.Objects collection
  2. Searching for CadGroup type objects
  3. Traversing Named Objects Dictionary (ACAD_GROUP)
  4. Resolving handles recursively to identify group members

However, the results are:

  • No CadGroup objects are found in cadImage.Objects
  • Some group-related handles (e.g., CAD005) are detected,
    but I cannot resolve them to actual entity members
  • Even with a simplified DWG file, the result is the same

I would like to ask the following:

  1. Does Aspose.CAD for .NET officially support AutoCAD GROUP objects?
  2. If supported, what is the recommended way to extract group member entities (handles)?
  3. Is there any API (such as a Groups collection) to directly access GROUP objects?
  4. If not supported, are there any plans to support GROUP extraction in future versions?

For your reference, I have attached a minimal DWG file (GROUP_TEST.dwg)
which contains only one group consisting of a circle, a text, and a line.

Please let me know if you need any additional information.

Thank you for your support.

GROUP_TEST.7z (30.3 KB)

@ysoh,
Hello,
please test if this example is helpful to reveal the relation between entities and Group object:

 using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load("GROUP_TEST.dwg"))
 {
     System.Console.WriteLine("Entities ");

     foreach (CadEntityBase entityBase in cadImage.Entities)
     {
         System.Console.WriteLine(entityBase.GroupHandle + " " + entityBase.ObjectHandle);
     }

     System.Console.WriteLine("Group ");

     foreach (CadObjectBase objectBase in cadImage.Objects)
     {
         if (objectBase.GetType() == typeof(CadGroup))
         {
             CadGroup group = (CadGroup)objectBase;
             if (group.HardPointerHandles.Count > 0)
             {
                 System.Console.WriteLine(group.ObjectHandle + " " + string.Join(",", group.HardPointerHandles));
             }
         }
     }
 }

Hello,

Thank you for your previous suggestion.

I implemented your example and tested it using Aspose.CAD for .NET 24.5.0.

Test environment:

  • Aspose.CAD for .NET version: 24.5.0.0
  • Temporary License is applied
  • Test was performed in a clean Docker environment
  • Test file: GROUP_TEST.dwg (attached)
    (This is a simplified test file derived from a real drawing, containing only one group: circle + text + line)

While implementing your example, I encountered a compile issue with the type “CadBaseEntity”,
so I slightly modified the code using ‘var’ and reflection to access GroupHandle and ObjectHandle.
The overall logic remains the same as your suggestion.

Test code (Program.cs) is attached.

Execution result:

dwg-inspector | Aspose.CAD Version: 24.5.0.0
dwg-inspector | === Entities ===
dwg-inspector | Aspose.CAD.FileFormats.Cad.CadObjects.CadCircle | GroupHandle= | ObjectHandle=49E
dwg-inspector | Aspose.CAD.FileFormats.Cad.CadObjects.CadText | GroupHandle= | ObjectHandle=49F
dwg-inspector | Aspose.CAD.FileFormats.Cad.CadObjects.CadLine | GroupHandle= | ObjectHandle=4A0
dwg-inspector | === Groups ===
dwg-inspector | === END ===

Observations:

  • GroupHandle is empty for all entities
  • No CadGroup objects are found in cadImage.Objects

Could you please try running the same test on your side?

Specifically:

  • Do you see GroupHandle populated?
  • Do CadGroup objects appear in cadImage.Objects?

If it works on your side, could you please share:

  • Your Aspose.CAD version
  • Any specific DWG save settings or conditions required

I have attached:

  • GROUP_TEST.dwg
  • Program.cs
  • Output log

Thank you very much for your help.

Best regards,
Yunseok, Oh.

Group_test_files.7z (31.2 KB)

@ysoh,
Hi.
My example above was tested with the latest Aspose.CAD for .NET 26.1. As I can see, the work with Groups was implemented for 24.9 version, the output both for it and for the latest is:

Entities
4A1 49E
4A1 49F
4A1 4A0
Group
4A1 49E,49F,4A0

Hi,

Thank you very much for your quick response and helpful information. I really appreciate your support.

Best regards,
Yunseok, Oh.

1 Like

@ysoh,
we are happy to help :slight_smile: