TransparencyΒΆ

The support for transparency was added to the DXF file format in revision R2004. The raw transparency value stored as 32 bit value in the DXF namespace as transparency attribute, has a range from 0 to 255 where 0 is fully transparent and 255 if opaque and has the top byte set to 0x02. For a more easy usage all graphical entities support the transparency property to get and set the transparency as float value in the range frem 0.0 to 1.0 where 0.0 is opaque and 1.0 is fully transparent. The transparency value can be set explicit in the entity, by layer or by block.

import ezdxf

doc = ezdxf.new()
msp = doc.modelspace()
line = msp.add_line((0, 0), (10, 0))
line.transparency = 0.5