Layout Manager

The layout manager is unique to each DXF drawing, access the layout manager by Drawing.layouts.

class Layouts

The Layouts class manages paper space layouts and the model space.

Layouts.__len__()

Return the count for layouts.

Layouts.__contains__(name)

Support for the in operator

Parameters:name (str) – layout name as shown in tab
Layouts.__iter__()

Iterate over model space layout and all paper space layouts as Layout objects.

Layouts.modelspace()

Returns the model space layout as Layout object.

Layouts.names()

Returns iterable of all layout names.

Layouts.get(name)

Returns layout name as Layout object.

Parameters:name (str) – layout name as shown in tab
Layouts.rename(old_name, new_name)

Rename a layout. Layout Model can not renamed and the new name of a layout must not exist.

Parameters:
  • old_name (str) – actual layout name
  • new_name (str) – new layout name
Layouts.names_in_taborder()

Returns all layout names in tab order as a list of strings.

Layouts.new(name, dxfattribs=None)

Create a new Layout.

Parameters:name (str) – layout name as shown in tab
Layouts.delete(name)

Delete layout and all entities in this layout.

Parameters:name (str) – layout name as shown in tab