drawing_tools.sheet package#

Submodules#

drawing_tools.sheet.featured_sheet module#

Enhanced sheet module for extracting features from a sheet.

class drawing_tools.sheet.featured_sheet.FeaturedSheet(sheet: Sheet, language_configs: list[LanguageConfig] | None = None, title_detection_config: TitleDetectionConfig | None = None)#

Bases: DessiaObject

An enhanced representation of a technical drawing sheet with calculated features.

This class enriches a Sheet object with calculated features that are not directly available in the original Sheet object, including featured views, organized annotations, and extracted metadata.

__init__(sheet: Sheet, language_configs: list[LanguageConfig] | None = None, title_detection_config: TitleDetectionConfig | None = None)#

Initialize a FeaturedSheet instance.

Parameters:
  • sheet – The source Sheet object to enrich with calculated features

  • language_configs – List of language configurations for parsing view titles.

  • title_detection_config – Configuration for title detection parameters.

__getattr__(name: str)#

Delegate attribute access to the underlying sheet object.

This allows accessing sheet attributes (passed as name) directly from FeaturedSheet, e.g., featured_sheet.views instead of featured_sheet.sheet.views

property format: str#

Get the format of the sheet.

property views: list[FeaturedView]#

Get all featured views in the sheet.

get_background_view() View#

Get the background view of the sheet.

views_of_types(view_types: list[ViewType], dominant_language: str | None = None) list[FeaturedView]#

Get all views of specific types in the sheet.

Parameters:
  • view_types – List of ViewType enum values to filter by

  • dominant_language – The language to use for type detection (e.g., “french”, “english”)

Returns:

List of FeaturedView instances matching the specified types

views_of_type(view_type: ViewType, dominant_language: str | None = None) list[FeaturedView]#

Get all views of a specific type in the sheet.

Parameters:
  • view_type – The ViewType enum value to filter by

  • dominant_language – The language to use for type detection (e.g., “french”, “english”)

Returns:

List of FeaturedView instances matching the specified type

views_of_types_by_reading_order(view_types: list[ViewType], y_tolerance: float = 50.0, dominant_language: str | None = None) list[FeaturedView]#

Get views of specified view types sorted by reading order in the sheet.

Parameters:
  • view_types – List of ViewType enum values to filter by

  • y_tolerance – Y-coordinate tolerance for reading order sorting (default: 50.0)

  • dominant_language – The language to use for type detection (e.g., “french”, “english”)

Returns:

List of FeaturedView instances matching the specified types, sorted by reading order

property collector: SheetCollector#

Get the SheetCollector for accessing sheet-level collectors.

This property provides access to sheet-level filtering and searching operations, consistent with how View.collector works in dessia_drawing.

Example

symbols = featured_sheet.collector.type.symbols(entity_subtypes=[“TypeBalloon”]) views_sorted = featured_sheet.collector.get_views_sorted_by_reading_order() text_results = featured_sheet.collector.text.search(“tolerance”)

Returns:

SheetCollector instance for the underlying sheet

property background_view: FeaturedView#

Get the background view of the sheet as a FeaturedView.

property front_views: list[FeaturedView]#

Get all front views in the sheet.

property section_views: list[FeaturedView]#

Get all section views in the sheet.

property isometric_views: list[FeaturedView]#

Get all isometric views in the sheet.

property detail_views: list[FeaturedView]#

Get all detail views in the sheet.

property auxiliary_views: list[FeaturedView]#

Get all auxiliary views in the sheet.

property other_views: list[FeaturedView]#

Get all other views in the sheet.

property balloons: list[Balloon]#

Get all balloons across all views of the sheet.

property section_line_indicators: list[SectionLineIndicator]#

Get all section line indicators across all views of the sheet.

property auxiliary_view_indicators: list[tuple[IdentifierInfo, object]]#

Get all auxiliary view indicators across all views of the sheet.

property sets: list[SheetSet]#

Get detected sheet sets (lazy-cached).

Returns:

List of SheetSet instances, empty if no sets detected

property has_sets: bool#

Check if the sheet has detected sets.

Returns:

True if at least one set was detected

get_set_for_view(view: FeaturedView) SheetSet | None#

Find which set a view belongs to, based on full bounding rectangle containment.

Views that span multiple sets are not assigned to any set.

Parameters:

view – The FeaturedView to locate

Returns:

The containing SheetSet, or None if the view spans multiple sets

get_views_in_set(sheet_set: SheetSet) list[FeaturedView]#

Get all views fully contained within a given set.

Views spanning multiple sets (or the entire sheet) are excluded.

Parameters:

sheet_set – The SheetSet to query

Returns:

List of FeaturedView instances fully within the set

property views_by_set: dict[str, list[FeaturedView]]#

Get views organized by set name.

Returns:

Dictionary mapping set names to lists of FeaturedView instances

plot_data_view_indexes#

Specific display tag for PlotData. Add a picture argument.

plot_data_grid_reference#

Specific display tag for PlotData. Add a picture argument.

collect_title_overlay_primitives() list#

Collect title overlay primitives for all views, each in a different color.

Returns:

List of plot_data primitives (rectangle + text labels per view).

collect_section_line_overlay_primitives() list#

Collect section line indicator overlay primitives for all views.

Returns:

List of plot_data primitives (rectangle + text labels per indicator).

collect_table_overlay_primitives() list#

Collect table overlay primitives for all detected tables in the sheet.

Delegates to SheetTableDetector.collect_overlay_primitives().

Returns:

List of plot_data primitives (rectangle + text label per table).

collect_balloon_overlay_primitives() list#

Collect balloon overlay primitives for all views.

Delegates to each view’s collect_balloon_overlay_primitives() and adds the color legend at the top of the sheet.

Returns:

List of plot_data primitives.

plot_data_balloons#

Specific display tag for PlotData. Add a picture argument.

plot_data_section_lines#

Specific display tag for PlotData. Add a picture argument.

collect_balloon_flags_overlay_primitives() list#

Collect balloon flags overlay primitives (multiplicators, FM symbols) for all views.

Returns:

List of plot_data primitives.

plot_data_balloon_flags#

Specific display tag for PlotData. Add a picture argument.

collect_sets_overlay_primitives() list#

Collect set region overlay primitives for all detected sets.

Delegates to get_sets_plot_data_primitives() from the sheet sets visualization helper.

Returns:

List of plot_data primitives (colored rectangles + labels per set).

plot_data_sets#

Specific display tag for PlotData. Add a picture argument.

plot_data_tables#

Specific display tag for PlotData. Add a picture argument.

plot_data_title_view#

Specific display tag for PlotData. Add a picture argument.

collect_auxiliary_view_indicator_overlay_primitives() list#

Collect auxiliary view indicator overlay primitives for all views.

plot_data_auxiliary_view_indicators#

Specific display tag for PlotData. Add a picture argument.

collect_all_identifier_overlay_primitives() list#

Collect all identifier overlay primitives for all views.

plot_data_all_identifiers#

Specific display tag for PlotData. Add a picture argument.

plot_data_view#

Specific display tag for PlotData. Add a picture argument.

report#

Implementation of a tag for displays.

summary() str#

Generate a summary description of the sheet features.

Module contents#

Sheet analysis module.

This module contains analysis capabilities for technical drawing sheets.

class drawing_tools.sheet.FeaturedSheet(sheet: Sheet, language_configs: list[LanguageConfig] | None = None, title_detection_config: TitleDetectionConfig | None = None)#

Bases: DessiaObject

An enhanced representation of a technical drawing sheet with calculated features.

This class enriches a Sheet object with calculated features that are not directly available in the original Sheet object, including featured views, organized annotations, and extracted metadata.

__init__(sheet: Sheet, language_configs: list[LanguageConfig] | None = None, title_detection_config: TitleDetectionConfig | None = None)#

Initialize a FeaturedSheet instance.

Parameters:
  • sheet – The source Sheet object to enrich with calculated features

  • language_configs – List of language configurations for parsing view titles.

  • title_detection_config – Configuration for title detection parameters.

__getattr__(name: str)#

Delegate attribute access to the underlying sheet object.

This allows accessing sheet attributes (passed as name) directly from FeaturedSheet, e.g., featured_sheet.views instead of featured_sheet.sheet.views

property format: str#

Get the format of the sheet.

property views: list[FeaturedView]#

Get all featured views in the sheet.

get_background_view() View#

Get the background view of the sheet.

views_of_types(view_types: list[ViewType], dominant_language: str | None = None) list[FeaturedView]#

Get all views of specific types in the sheet.

Parameters:
  • view_types – List of ViewType enum values to filter by

  • dominant_language – The language to use for type detection (e.g., “french”, “english”)

Returns:

List of FeaturedView instances matching the specified types

views_of_type(view_type: ViewType, dominant_language: str | None = None) list[FeaturedView]#

Get all views of a specific type in the sheet.

Parameters:
  • view_type – The ViewType enum value to filter by

  • dominant_language – The language to use for type detection (e.g., “french”, “english”)

Returns:

List of FeaturedView instances matching the specified type

views_of_types_by_reading_order(view_types: list[ViewType], y_tolerance: float = 50.0, dominant_language: str | None = None) list[FeaturedView]#

Get views of specified view types sorted by reading order in the sheet.

Parameters:
  • view_types – List of ViewType enum values to filter by

  • y_tolerance – Y-coordinate tolerance for reading order sorting (default: 50.0)

  • dominant_language – The language to use for type detection (e.g., “french”, “english”)

Returns:

List of FeaturedView instances matching the specified types, sorted by reading order

property collector: SheetCollector#

Get the SheetCollector for accessing sheet-level collectors.

This property provides access to sheet-level filtering and searching operations, consistent with how View.collector works in dessia_drawing.

Example

symbols = featured_sheet.collector.type.symbols(entity_subtypes=[“TypeBalloon”]) views_sorted = featured_sheet.collector.get_views_sorted_by_reading_order() text_results = featured_sheet.collector.text.search(“tolerance”)

Returns:

SheetCollector instance for the underlying sheet

property background_view: FeaturedView#

Get the background view of the sheet as a FeaturedView.

property front_views: list[FeaturedView]#

Get all front views in the sheet.

property section_views: list[FeaturedView]#

Get all section views in the sheet.

property isometric_views: list[FeaturedView]#

Get all isometric views in the sheet.

property detail_views: list[FeaturedView]#

Get all detail views in the sheet.

property auxiliary_views: list[FeaturedView]#

Get all auxiliary views in the sheet.

property other_views: list[FeaturedView]#

Get all other views in the sheet.

property balloons: list[Balloon]#

Get all balloons across all views of the sheet.

property section_line_indicators: list[SectionLineIndicator]#

Get all section line indicators across all views of the sheet.

property auxiliary_view_indicators: list[tuple[IdentifierInfo, object]]#

Get all auxiliary view indicators across all views of the sheet.

property sets: list[SheetSet]#

Get detected sheet sets (lazy-cached).

Returns:

List of SheetSet instances, empty if no sets detected

property has_sets: bool#

Check if the sheet has detected sets.

Returns:

True if at least one set was detected

get_set_for_view(view: FeaturedView) SheetSet | None#

Find which set a view belongs to, based on full bounding rectangle containment.

Views that span multiple sets are not assigned to any set.

Parameters:

view – The FeaturedView to locate

Returns:

The containing SheetSet, or None if the view spans multiple sets

get_views_in_set(sheet_set: SheetSet) list[FeaturedView]#

Get all views fully contained within a given set.

Views spanning multiple sets (or the entire sheet) are excluded.

Parameters:

sheet_set – The SheetSet to query

Returns:

List of FeaturedView instances fully within the set

property views_by_set: dict[str, list[FeaturedView]]#

Get views organized by set name.

Returns:

Dictionary mapping set names to lists of FeaturedView instances

plot_data_view_indexes#

Specific display tag for PlotData. Add a picture argument.

plot_data_grid_reference#

Specific display tag for PlotData. Add a picture argument.

collect_title_overlay_primitives() list#

Collect title overlay primitives for all views, each in a different color.

Returns:

List of plot_data primitives (rectangle + text labels per view).

collect_section_line_overlay_primitives() list#

Collect section line indicator overlay primitives for all views.

Returns:

List of plot_data primitives (rectangle + text labels per indicator).

collect_table_overlay_primitives() list#

Collect table overlay primitives for all detected tables in the sheet.

Delegates to SheetTableDetector.collect_overlay_primitives().

Returns:

List of plot_data primitives (rectangle + text label per table).

collect_balloon_overlay_primitives() list#

Collect balloon overlay primitives for all views.

Delegates to each view’s collect_balloon_overlay_primitives() and adds the color legend at the top of the sheet.

Returns:

List of plot_data primitives.

plot_data_balloons#

Specific display tag for PlotData. Add a picture argument.

plot_data_section_lines#

Specific display tag for PlotData. Add a picture argument.

collect_balloon_flags_overlay_primitives() list#

Collect balloon flags overlay primitives (multiplicators, FM symbols) for all views.

Returns:

List of plot_data primitives.

plot_data_balloon_flags#

Specific display tag for PlotData. Add a picture argument.

collect_sets_overlay_primitives() list#

Collect set region overlay primitives for all detected sets.

Delegates to get_sets_plot_data_primitives() from the sheet sets visualization helper.

Returns:

List of plot_data primitives (colored rectangles + labels per set).

plot_data_sets#

Specific display tag for PlotData. Add a picture argument.

plot_data_tables#

Specific display tag for PlotData. Add a picture argument.

plot_data_title_view#

Specific display tag for PlotData. Add a picture argument.

collect_auxiliary_view_indicator_overlay_primitives() list#

Collect auxiliary view indicator overlay primitives for all views.

plot_data_auxiliary_view_indicators#

Specific display tag for PlotData. Add a picture argument.

collect_all_identifier_overlay_primitives() list#

Collect all identifier overlay primitives for all views.

plot_data_all_identifiers#

Specific display tag for PlotData. Add a picture argument.

plot_data_view#

Specific display tag for PlotData. Add a picture argument.

report#

Implementation of a tag for displays.

summary() str#

Generate a summary description of the sheet features.