Skip to content

Unable to access layers in DWG file using aspose-cad for python #3

Description

@ellkrauze

Description

I am currently working with aspose-cad for python to process a DWG file. I need to iterate through the layers of the DWG file, but I’m encountering an issue where the Image object doesn’t seem to have a layers attribute, even after loading to CadImage it is still an Image object. Here’s the code I’m using:

from aspose.cad.fileformats.cad import CadImage

cad_image = CadImage.load("test.dwg")
cad_image.layers

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[14], line 1
----> 1 cad_image.layers

AttributeError: 'aspose.cad.Image' object has no attribute 'layers'

Expected Behavior

I expected to be able to iterate over the layers in the DWG file, as shown in the documentation, by accessing cad_image.layers.
(https://reference.aspose.com/cad/python-net/aspose.cad.fileformats.cad/cadimage/)

Actual Behavior

An AttributeError occurs when trying to access layers from the CadImage object.

Additional Information

•	Python Version: 3.10.12
•	Aspose.CAD for Python via .NET Version: 24.7.0

Could you please provide guidance on how to correctly access the layers in a DWG file or let me know if there’s something missing in the current implementation?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions