Underlay¶
UNDERLAY entity (DXF Reference) links an underlay file to the DXF file, the file itself is not embedded into the
DXF file, it is always a separated file. The (PDF)UNDERLAY entity is like a block reference, you can use it
multiple times to add the underlay on different locations with different scales and rotations. But therefore
you need a also a (PDF)DEFINITION entity, see UnderlayDefinition
.
The DXF standard supports three different file formats: PDF, DWF (DWFx) and DGN. An Underlay can be clipped by a rectangle or a polygon path. The clipping coordinates are 2D OCS coordinates in drawing units but without scaling.
Subclass of |
|
DXF type |
internal base class |
Factory function |
|
Inherited DXF attributes |
|
Required DXF version |
DXF R2000 ( |
-
class
ezdxf.entities.
Underlay
¶ Base class of
PdfUnderlay
,DwfUnderlay
andDgnUnderlay
-
dxf.
scale_x
¶ Scaling factor in x-direction (float)
-
dxf.
scale_y
¶ Scaling factor in y-direction (float)
-
dxf.
scale_z
¶ Scaling factor in z-direction (float)
-
dxf.
rotation
¶ ccw rotation in degrees around the extrusion vector (float)
-
dxf.
extrusion
¶ extrusion vector, default =
(0, 0, 1)
-
dxf.
underlay_def_handle
¶ Handle to the underlay definition entity, see
UnderlayDefinition
-
dxf.
flags
¶ dxf.flags
Value
Description
UNDERLAY_CLIPPING
1
clipping is on/off
UNDERLAY_ON
2
underlay is on/off
UNDERLAY_MONOCHROME
4
Monochrome
UNDERLAY_ADJUST_FOR_BACKGROUND
8
Adjust for background
-
dxf.
contrast
¶ Contrast value (
20
-100
; default =100
)
-
dxf.
fade
¶ Fade value (
0
-80
; default =0
)
-
clipping
¶ True
orFalse
(read/write)
-
on
¶ True
orFalse
(read/write)
-
monochrome
¶ True
orFalse
(read/write)
-
adjust_for_background
¶ True
orFalse
(read/write)
-
scale
¶ Scaling
(x, y, z)
tuple (read/write)
-
boundary_path
¶ Boundary path as list of vertices (read/write).
Two vertices describe a rectangle (lower left and upper right corner), more than two vertices is a polygon as clipping path.
-
get_underlay_def
() → UnderlayDefinition¶ Returns the associated DEFINITION entity. see
UnderlayDefinition
.
-
set_underlay_def
(underlay_def: UnderlayDefinition) → None¶ Set the associated DEFINITION entity. see
UnderlayDefinition
.
-
reset_boundary_path
()¶ Removes the clipping path.
-
PdfUnderlay¶
Subclass of |
|
DXF type |
|
Factory function |
|
Inherited DXF attributes |
|
Required DXF version |
DXF R2000 ( |
-
class
ezdxf.entities.
PdfUnderlay
¶ PDF underlay.
DwfUnderlay¶
Subclass of |
|
DXF type |
|
Factory function |
|
Inherited DXF attributes |
|
Required DXF version |
DXF R2000 ( |
-
class
ezdxf.entities.
DwfUnderlay
¶ DWF underlay.