Skip to content

generate_drawing_package fits every title-block field - #251

Merged
andrewbartels1 merged 3 commits into
mainfrom
fix/title-block-fit-every-field
Nov 19, 2026
Merged

andrewbartels1 merged 3 commits into
mainfrom
fix/title-block-fit-every-field

Conversation

@andrewbartels1

@andrewbartels1 andrewbartels1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Merge after #250. Both edit the CHANGELOG's Unreleased section and the queue, so this one may need a one-line conflict fix there.

Every title-block field fits its box (part of #158)

generate_drawing_package shrank only DWG NO. and TITLE until they fit; a long material name, company or DRAWN BY value ran over the next cell. Now every field the sheet format fills from a property ($PRP:"..." or $PRPSHEET:"...") is fitted the same way:

  • shrunk until its text ends before the next note in its row;
  • never below the minimum height;
  • capped by title_block_text_height_mm when given.

The reply's title_block lists each field:

  • DWG NO. and TITLE keep their names, drawing number and title.
  • The drawing's own fields use update_title_block's names: drawn by, drawn date, revision and company.
  • Any other field is named by its property, e.g. SW-Material.

A property shown twice is fitted once, and labels (notes with no property) are left alone.

The subtitle is the TITLE's second line (#158)

subtitle used to fill the company field when company was empty. ISO 7200 treats a subtitle as the supplementary title, which goes under the title, and the company field as the legal owner's name only. So now:

  • the subtitle is the TITLE's second line;
  • the TITLE is set at 60% of the format's height (or the caller's cap) so both lines fit;
  • the company field shows company only.

Still open on #158: measuring against the format's cell lines instead of the next note.

Checks

  • Unit tests:

    • a long material value is shrunk;
    • a short DRAWN BY keeps its height;
    • a property shown twice is fitted once;
    • a property named title doesn't overwrite TITLE's entry;
    • a field that can't be measured is skipped.
  • 4,330 tests pass at 100% coverage; ruff and mypy are clean; the docs build in strict mode.

  • Live: the fitting passed on 2026-11-17 (20 fields, all fit). The test now also passes subtitle and checks that the TITLE reads Package Block then Base support; that part is not run yet:

    powershell -ExecutionPolicy Bypass -File tests\scripts\live_demo.ps1 -Test tests/live/test_live_sw_drawing_package_tools.py::test_generate_drawing_package_on_a_block

Not just DWG NO. and TITLE: every field the sheet format fills from a
property (material, drawn by, company...) is shrunk until it fits its
box, and each is listed in the reply's title_block (#158).
ISO 7200 treats a subtitle as the supplementary title, under the title, and the company field as the legal owner's name only. The TITLE is set at 60% of the format's height so both lines fit (#158).
@andrewbartels1
andrewbartels1 merged commit 4d844c7 into main Nov 19, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant