dxfgrabber icon indicating copy to clipboard operation
dxfgrabber copied to clipboard

Read the flags with group code 70 when setting up attributes

Open olacognite opened this issue 5 years ago • 1 comments

From this reference: https://www.autodesk.com/techpubs/autocad/acadr14/dxf/attrib_al_u05_c.htm

Attributes have the following flags on group code 70

1 = Attribute is invisible (does not appear) 2 = This is a constant attribute 4 = Verification is required on input of this attribute 8 = Attribute is preset (no prompt during insertion)

In particular the first bit of this group is interesting for setting the invisibility field in the attrib. The other bits might need new fields, or a single field for flags containing all of them could be added.

A proposed solution for getting the invisibility information is to add the following lines to dxfgrabber.dxfentities.Attrib.setup_attributes

    def setup_attributes(self, tags):
        for code, value in super(dxfgrabber.dxfentities.Attrib, self).setup_attributes(tags):
            if code == 2:
                self.tag = value
            elif code == 70:  # change
                self.invisible = value % 2  # change
            elif code == 73:
                self.field_length = value
            else:
                yield code, value

or one could do self.flags = value, to store all the information. I am not sure if this would conflict with other parts of the reader.

olacognite avatar Aug 06 '19 08:08 olacognite

If you follow my advice in the head line of this project "Outdated DXF reader, please switch to ezdxf ", you would have access to the flags attribute.

mozman avatar Aug 06 '19 08:08 mozman