Core API
build123d_techdraw.core.sheet
ISO 5457 drawing sheets, standard sizes, borders, and coordinate grids.
DrawingSheet
Represents a single ISO 5457 technical drawing sheet with views and annotations.
Source code in src/build123d_techdraw/core/sheet.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 | |
from_template(template, **kwargs)
classmethod
Create a DrawingSheet initialized with a custom SVG or DXF template.
Source code in src/build123d_techdraw/core/sheet.py
set_template(template, *, adopt_size=False)
Attach or clear a custom corporate SheetTemplate on this sheet.
Source code in src/build123d_techdraw/core/sheet.py
add(item)
Add a view, layout, annotation, title block, or notes to the drawing sheet.
Source code in src/build123d_techdraw/core/sheet.py
set_title_block(title=None, drawing_number=None, drawing_title=None, drawing_no=None, subtitle=None, sheet_no=None, sheet_num=None, num_sheets=None, total_sheets=None, scale=None, rev=None, date=None, material=None, finish=None, author=None, project=None, status=None, units=None, third_angle=None, fields=None)
Update metadata fields in the ISO 7200 title block.
Source code in src/build123d_techdraw/core/sheet.py
set_notes(notes)
add_bom_item(item_no, qty, part_no, description, material)
Add a row to the Bill of Materials table.
Source code in src/build123d_techdraw/core/sheet.py
add_revision(rev, description, date, approved_by)
Add a row to the Revision History table.
A new sheet shows a placeholder row (A / INITIAL ENGINEERING RELEASE) so an
un-revised drawing still has a revision table. That placeholder is removed by the
first explicit call to this method, whatever its rev. After that, every call
appends a row, so the table holds exactly the revisions the caller added, in order.
Rows written straight into revision_rows do not affect the placeholder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rev
|
str
|
Revision letter or number, e.g. |
required |
description
|
str
|
Short description of the change. |
required |
date
|
str
|
Date of the revision as it should be printed. |
required |
approved_by
|
str
|
Approver's name or initials. |
required |
Source code in src/build123d_techdraw/core/sheet.py
add_view(shape_or_view, view_type=ViewType.FRONT, center=(150.0, 150.0), scale=1.0, show_hidden=True, view_label=None, rotation_angle_deg=0.0, view_label_y=None, model_origin=None, align_to=None, style=ViewStyle.WIREFRAME, shading_dpi=300, color_by_part=False, part_colors=None, ssao=True, gpu=None, shading_theme=None, *, hlr='exact', hlr_resolution=2048, hlr_gpu_face_threshold=250)
Add a projected orthographic/isometric view to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
update_shape(new_shape)
Update the 3D model across all views on the sheet and re-bind anchored annotations.
Every view is checked before any is changed, so a view that cannot be regenerated
raises ValueError without leaving the sheet half-updated. Detail views are
updated last so they re-cut their already-updated parent view.
Source code in src/build123d_techdraw/core/sheet.py
add_section_view(shape, cutting_plane, center=(150.0, 150.0), scale=1.0, view_label='SECTION A-A', view_label_y=None, model_origin=None, align_to=None, show_background=True, hatch='steel', hatch_pitch=4.0, hatch_angle=45.0)
Add a 2D section slice view with material hatching to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_half_section_view(shape, cutting_plane, center=(150.0, 150.0), scale=1.0, section_half='top', view_label='HALF SECTION', view_label_y=None, model_origin=None, align_to=None, show_background=True, hatch='steel', hatch_pitch=4.0, hatch_angle=45.0)
Add an ISO 128-3 half-section view (one half sectioned, opposite half external).
Source code in src/build123d_techdraw/core/sheet.py
add_offset_section_view(shape, base_plane, points, center=(150.0, 150.0), scale=1.0, view_label='SECTION A-A', view_label_y=None, model_origin=None, align_to=None, show_background=True, show_jog_lines=False, hatch='steel', hatch_pitch=4.0, hatch_angle=45.0)
Add a stepped/offset section view along a multi-jog cutting path.
Source code in src/build123d_techdraw/core/sheet.py
add_aligned_section_view(shape, base_plane, points, center=(150.0, 150.0), scale=1.0, view_label='SECTION A-A', view_label_y=None, model_origin=None, align_to=None, show_background=True, show_jog_lines=False, hatch='steel', hatch_pitch=4.0, hatch_angle=45.0)
Add an aligned/revolved section view unfolding angled legs onto base_plane.
Source code in src/build123d_techdraw/core/sheet.py
add_detail_view(parent_view, focus_target=None, radius=12.0, scale=2.0, center=(150.0, 150.0), view_label=None, label_letter='A', view_label_y=None, align_to=None, shape='circle', region_center=None, label=None)
Add a magnified circular or rectangular detail view to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_auxiliary_view(shape, face, center=(150.0, 150.0), scale=1.0, show_hidden=True, view_label='AUXILIARY VIEW', view_label_y=None, align_to=None)
Add an auxiliary view normal to an inclined face.
Source code in src/build123d_techdraw/core/sheet.py
add_flat_pattern(shape, center=(150.0, 150.0), scale=1.0, *, k_factor='din6935', thickness=None, base_face=None, recognize_punches=True, align_longest_horizontal=True, annotate_bends=True, annotate_punches=True, show_bend_extents=False, view_label='FLAT PATTERN', view_label_y=None, align_to=None)
Unfold a 3D sheet metal part (or wrap a FlatPattern) and add its flat pattern view.
Source code in src/build123d_techdraw/core/sheet.py
add_sheet_metal_views(shape, **kwargs)
Create a complete sheet metal drawing layout (flat pattern, 3D iso, bend & punch schedules).
Source code in src/build123d_techdraw/core/sheet.py
add_dimension(start, end, offset=8.0, dim_type=DimensionType.ALIGNED, text=None, tolerance=None, prefix='', suffix='', nominal=None, view=None)
Add a linear dimension directly in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_radial_dimension(center, radius, angle_deg=45.0, text=None, tolerance=None)
Add a radial dimension in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_diameter_dimension(center, diameter, angle_deg=45.0, text=None, tolerance=None)
Add a diameter dimension in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_angular_dimension(target1, target2, radius=20.0, text=None, tolerance=None, prefix='', suffix='°', apex=None, view=None)
Add an angular dimension to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_ordinate(target, datum_coord=0.0, direction='horizontal', jog=0.0, extension_length=12.0, prefix='', suffix='', view=None)
Add an ordinate dimension point to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_chamfer_callout(target, width=None, angle_deg=45.0, style='iso', quantity=None, elbow_offset=(15.0, -12.0), view=None)
Add an ISO/ASME chamfer callout note to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_half_diameter_dimension(feature_point, centerline_coord, diameter=None, orientation='vertical', offset=0.0, past_centerline=5.0, text=None, tolerance=None, view=None)
Add an ISO 129-1 §5.2.3 diametral centerline half-dimension in sheet space.
Source code in src/build123d_techdraw/core/sheet.py
add_undercut_callout(target, spec='E 0.8x0.3', roughness=None, quantity=None, include_standard=True, elbow_offset=(15.0, -12.0), view=None)
Add a DIN 509 relief undercut callout note to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_welding_symbol(target, weld_type=WeldType.FILLET, size='a5', length=None, pitch=None, all_around=False, field_weld=False, tail_text=None, arrow_side=True, elbow_offset=(16.0, -12.0), view=None)
Add an ISO 2553 welding annotation to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
lint()
inspect_layout()
Return a structured layout dictionary of canvas, views, title blocks, and annotations for AI and CI inspection.
Source code in src/build123d_techdraw/core/sheet.py
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 | |
add_gdt_frame(position, characteristic, tolerance_value, datum_a=None, datum_b=None, datum_c=None)
Add a GD&T Feature Control Frame in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_datum_symbol(target, label='A', direction='up')
Add an ISO datum feature identifier symbol.
Source code in src/build123d_techdraw/core/sheet.py
add_surface_finish(position, ra_value='Ra 3.2', material_removal=MaterialRemoval.REQUIRED, process=None)
Add an ISO 1302 surface roughness / finish symbol.
Source code in src/build123d_techdraw/core/sheet.py
add_centerline(start, end, stroke_width=0.25)
Add an ISO dash-dot centerline between two sheet points.
Source code in src/build123d_techdraw/core/sheet.py
add_centermark(center, size=6.0)
Add an ISO center crosshair.
Source code in src/build123d_techdraw/core/sheet.py
add_bolt_circle(center, diameter, num_holes=4, start_angle_deg=0.0)
Add a bolt pitch circle diameter (PCD) annotation.
Source code in src/build123d_techdraw/core/sheet.py
add_leader_note(target, lines, elbow_offset=(15.0, -12.0), shelf_length=20.0, align_right=None, terminator='dot')
Add a leader note with pointer dot/arrow, elbow, and horizontal text shelf.
Source code in src/build123d_techdraw/core/sheet.py
add_hole_callout(center, diameter=None, depth=None, countersink_dia=None, countersink_angle=90.0, counterbore_dia=None, counterbore_depth=None, quantity=None, tolerance=None, clearance_for=None, fit='medium', elbow_offset=(15.0, -12.0))
Add a standard engineering hole callout in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_thread_callout(center, thread='M5x0.8', depth='THRU', class_fit=None, quantity=None, show_tap_drill=False, elbow_offset=(15.0, -12.0))
Add a standard engineering thread callout in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_cosmetic_thread(center=None, thread=None, nominal_diameter=None, minor_diameter=None, thread_type='internal', depth=None, start=None, end=None, view_mode=None)
Add an ISO 6410-1 cosmetic thread in sheet paper coordinates.
Source code in src/build123d_techdraw/core/sheet.py
add_table(headers=None, rows=None, position=(0.0, 0.0), col_widths=None, title=None, **kwargs)
Add a tabular schedule to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_raw_svg(content, position=(0.0, 0.0), **kwargs)
Add a raw SVG vector element to the sheet.
Source code in src/build123d_techdraw/core/sheet.py
add_balloon(item_no, target, balloon_center, radius=4.5, terminator='dot')
Add an ISO BOM balloon callout circle connected to component via leader.
Source code in src/build123d_techdraw/core/sheet.py
add_section_cutting_line(points, label='A', arrow_dir='up')
Add an ISO section cutting plane line.
Source code in src/build123d_techdraw/core/sheet.py
render_border_and_grid()
Render ISO 5457 borders, centering marks, and alphanumeric grid zones.
Source code in src/build123d_techdraw/core/sheet.py
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 | |
render_notes()
Render general notes block in bottom-left.
Source code in src/build123d_techdraw/core/sheet.py
render_view_labels()
Render view titles and scale notes positioned cleanly below annotations.
Source code in src/build123d_techdraw/core/sheet.py
render_hatch_defs()
Render standard ISO 128 / ANSI hatch patterns in SVG defs.
Source code in src/build123d_techdraw/core/sheet.py
to_svg(theme=Theme.DARK_BLUEPRINT)
Render the complete drawing sheet to an SVG vector string.
Source code in src/build123d_techdraw/core/sheet.py
1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 | |
export_svg(path, theme=Theme.DARK_BLUEPRINT)
Export sheet to an SVG file.
Source code in src/build123d_techdraw/core/sheet.py
export_pdf(path, theme=Theme.DARK_BLUEPRINT)
Export sheet to a vector PDF file.
Source code in src/build123d_techdraw/core/sheet.py
export_dxf(path, flat_pattern=False, dxfversion='R2010')
Export sheet to a multi-layer DXF CAD drawing. If flat_pattern=True, exports 1:1 unannotated CNC geometry.
Source code in src/build123d_techdraw/core/sheet.py
export_html(filepath, theme=Theme.DARK_BLUEPRINT, *, shape=None, linear_deflection=0.08, angular_deflection=0.25, crease_angle_deg=20.0, title=None, initial_layout='split')
Export sheet to a self-contained interactive 3D-in-2D HTML5 blueprint.
Source code in src/build123d_techdraw/core/sheet.py
SheetSize
Bases: Enum
Standard ISO 216 and ANSI/US paper sheet sizes in millimeters (width, height).
Source code in src/build123d_techdraw/core/sheet.py
coerce(value)
classmethod
Coerce a SheetSize enum or case-insensitive string into a SheetSize.
Source code in src/build123d_techdraw/core/sheet.py
build123d_techdraw.core.view
SheetView representations, view projection mathematics, and coordinate transformations.
SheetView
Represents an orthographic, isometric, or section view placed on a DrawingSheet.
Provides bidirectional coordinate transformations between 3D model space, 2D view projection space, and 2D paper sheet space (mm).
Source code in src/build123d_techdraw/core/view.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 | |
center
property
View center on the drawing sheet in paper mm.
add(item)
Attach an annotation or collection of annotations to this view.
Source code in src/build123d_techdraw/core/view.py
add_break(interval, axis='X', style='zigzag', gap=10.0)
Cut a uniform span out of the view (ISO 128-3 interrupted view).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
tuple[float, float]
|
Start and end of the removed span in absolute model coordinates along
|
required |
axis
|
str
|
|
'X'
|
style
|
str
|
|
'zigzag'
|
gap
|
float
|
Paper distance in mm between the two break lines. |
10.0
|
Dimensions keep reporting true model lengths; only the drawn span is shortened.
Source code in src/build123d_techdraw/core/view.py
break_gap_centers(axis)
Broken-view paper positions (mm) of the middle of each break gap along axis.
Source code in src/build123d_techdraw/core/view.py
export_dxf(filepath, layers=None, scale=1.0, dxfversion='R2010')
Export 1:1 CAM manufacturing DXF from this 2D view (outer profile, holes, centerlines).
Source code in src/build123d_techdraw/core/view.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | |
can_regenerate()
Return True if update_shape is able to re-project this view's geometry.
Source code in src/build123d_techdraw/core/view.py
update_shape(new_shape)
Update the view's 3D shape, re-project geometry, and re-bind all anchored annotations.
Every view type is regenerated from the parameters it was built with (cut plane,
section path, detail region, auxiliary direction, explicit model_origin,
label placement). Detail views follow their parent view: the parent is updated to
new_shape first if needed, then the detail is re-cut from it. Space reserved
below the view by dimensions (bottom_annotation_y) is kept, shifted with the
view's new bottom edge.
Raises:
| Type | Description |
|---|---|
ValueError
|
if this view has no recorded build parameters and cannot be regenerated (section/detail/auxiliary views constructed by hand). |
Source code in src/build123d_techdraw/core/view.py
locate(center)
Reposition the view center on the sheet (in paper mm).
Source code in src/build123d_techdraw/core/view.py
scale_to(scale)
Change the view scale factor and update its bounding box.
Source code in src/build123d_techdraw/core/view.py
get_visual_bounds(include_annotations=True, include_label=True)
Compute the visual bounding box (min_x, min_y, max_x, max_y) of this view in paper mm.
Source code in src/build123d_techdraw/core/view.py
__getitem__(key)
Provide dictionary-style access for backward compatibility.
Source code in src/build123d_techdraw/core/view.py
to_sheet_x(model_x)
Transform 2D model X coordinate to sheet paper coordinate (mm), honouring breaks.
Source code in src/build123d_techdraw/core/view.py
to_sheet_y(model_y)
Transform 2D model Y coordinate to sheet paper coordinate (mm), honouring breaks.
Source code in src/build123d_techdraw/core/view.py
to_sheet_coords(model_x, model_y)
Transform 2D model (X, Y) to sheet paper (X, Y) coordinates (mm).
to_sheet_3d(x, y, z)
Project a 3D part point (X, Y, Z) to 2D sheet paper coordinate space (mm).
Source code in src/build123d_techdraw/core/view.py
dimension(target, offset=-8.0, direction=None, text=None, tolerance=None, prefix='', suffix='')
Add a dimension for a topological Edge, Face, or pair of points in this view.
Automatically determines dimension direction and length from the model entity.
Source code in src/build123d_techdraw/core/view.py
dimension_between(target1, target2, direction='horizontal', offset=-8.0, text=None, tolerance=None, prefix='', suffix='')
Add a linear dimension between two model vertices, edges, or points in this view.
Source code in src/build123d_techdraw/core/view.py
979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 | |
dim_horizontal(model_x1, model_x2, model_y, offset_y=-8.0, text=None, tolerance=None, prefix='', suffix='')
Add a horizontal dimension between model_x1 and model_x2 at model_y.
Source code in src/build123d_techdraw/core/view.py
dim_vertical(model_y1, model_y2, model_x, offset_x=-10.0, text=None, tolerance=None, prefix='', suffix='')
Add a vertical dimension between model_y1 and model_y2 at model_x.
Source code in src/build123d_techdraw/core/view.py
dim_aligned(p1_model, p2_model, offset=8.0, text=None, tolerance=None, prefix='', suffix='')
Add an aligned dimension between two model points.
Source code in src/build123d_techdraw/core/view.py
add_overall_horizontal(offset_y=-8.0, text=None, tolerance=None, prefix='', suffix='')
Add an overall horizontal dimension spanning view's bounding box.
Source code in src/build123d_techdraw/core/view.py
add_overall_vertical(offset_x=-10.0, text=None, tolerance=None, prefix='', suffix='')
Add an overall vertical dimension spanning view's bounding box.
Source code in src/build123d_techdraw/core/view.py
auto_dimension(tolerance=None)
Automatically dimension this view using collision-avoiding placement.
Source code in src/build123d_techdraw/core/view.py
dim_radial(center_model, radius_model, angle_deg=45.0, text=None, tolerance=None)
Add a radial dimension pointing to an arc defined in model space.
Source code in src/build123d_techdraw/core/view.py
dim_diameter(center_model, diameter_model, angle_deg=45.0, text=None, tolerance=None)
Add a diameter dimension across a hole/cylinder defined in model space.
Source code in src/build123d_techdraw/core/view.py
dim_angular(target1, target2, radius=20.0, text=None, tolerance=None, prefix='', suffix='°')
Add an angular dimension between two edges, rays, or faces in this view.
Source code in src/build123d_techdraw/core/view.py
dim_ordinate(target, datum_coord=0.0, direction='horizontal', jog=0.0, extension_length=12.0, prefix='', suffix='')
Add an ordinate dimension point in this view.
Source code in src/build123d_techdraw/core/view.py
chamfer_callout(target=None, width=None, angle_deg=45.0, style='iso', quantity=None, elbow_dx=15.0, elbow_dy=-12.0, *, anchor=None)
Add an ISO/ASME chamfer callout leader note.
Source code in src/build123d_techdraw/core/view.py
weld_symbol(target, weld_type=WeldType.FILLET, size='a5', length=None, pitch=None, all_around=False, field_weld=False, tail_text=None, arrow_side=True, elbow_dx=16.0, elbow_dy=-12.0)
Add an ISO 2553 welding annotation.
Source code in src/build123d_techdraw/core/view.py
centermark(model_x, model_y, size=6.0)
Add a centermark crosshair at (model_x, model_y).
Source code in src/build123d_techdraw/core/view.py
centerline_horizontal(model_y=0.0, model_x1=None, model_x2=None, overhang=4.0)
Draw an ISO centerline across the horizontal axis at model_y.
Source code in src/build123d_techdraw/core/view.py
centerline_vertical(model_x=0.0, model_y1=None, model_y2=None, overhang=4.0)
Draw an ISO centerline across the vertical axis at model_x.
Source code in src/build123d_techdraw/core/view.py
bolt_circle(center_model=(0.0, 0.0), diameter_model=50.0, num_holes=4, start_angle_deg=0.0)
Add a bolt pitch circle diameter (PCD) annotation in model space.
Source code in src/build123d_techdraw/core/view.py
leader(model_x, model_y, lines, elbow_dx=15.0, elbow_dy=-12.0, shelf_length=20.0, align_right=None, terminator='dot')
Add a leader note pointing to (model_x, model_y) on the part.
Source code in src/build123d_techdraw/core/view.py
leader_3d(x, y, z, lines, elbow_dx=15.0, elbow_dy=-12.0, shelf_length=20.0, align_right=None, terminator='dot')
Add a leader note pointing to a 3D part point (x, y, z).
Source code in src/build123d_techdraw/core/view.py
balloon(item_no, model_x, model_y, balloon_x, balloon_y)
Add a BOM balloon callout pointing to (model_x, model_y).
Source code in src/build123d_techdraw/core/view.py
add_gdt_frame(model_x=0.0, model_y=0.0, characteristic=GDTCharacteristic.POSITION, tolerance_value='0.05', datum_a=None, datum_b=None, datum_c=None, leader_offset=None, *, anchor=None)
Add a GD&T Feature Control Frame near (model_x, model_y) or an anchor, optionally with a leader line.
Source code in src/build123d_techdraw/core/view.py
add_datum_symbol(model_x=0.0, model_y=0.0, label='A', direction='up', *, anchor=None)
Add an ISO datum feature identifier symbol at (model_x, model_y) or an anchor.
Source code in src/build123d_techdraw/core/view.py
add_surface_finish(model_x=0.0, model_y=0.0, ra_value='Ra 3.2', material_removal=MaterialRemoval.REQUIRED, process=None, *, anchor=None)
Add an ISO 1302 surface roughness symbol at (model_x, model_y) or an anchor.
Source code in src/build123d_techdraw/core/view.py
hole_callout(model_x=0.0, model_y=0.0, diameter=None, depth=None, countersink_dia=None, countersink_angle=90.0, counterbore_dia=None, counterbore_depth=None, quantity=None, tolerance=None, clearance_for=None, fit='medium', elbow_dx=15.0, elbow_dy=-12.0, *, anchor=None)
Add a standard engineering hole callout at (model_x, model_y) or an anchor.
Source code in src/build123d_techdraw/core/view.py
thread_callout(model_x=0.0, model_y=0.0, thread='M5x0.8', depth='THRU', class_fit=None, quantity=None, show_tap_drill=False, elbow_dx=15.0, elbow_dy=-12.0, *, anchor=None)
Add a standard engineering thread callout at (model_x, model_y) or an anchor.
Source code in src/build123d_techdraw/core/view.py
cosmetic_thread(target=None, thread=None, nominal_diameter=None, minor_diameter=None, thread_type='internal', depth=None, model_x=None, model_y=None, view_mode=None)
Add an ISO 6410-1 cosmetic thread representation to this view.
Source code in src/build123d_techdraw/core/view.py
auto_cosmetic_threads(*, threaded_diameters=None, infer_threads=False, tolerance=0.08)
Automatically generate ISO 6410-1 CosmeticThread annotations from recognized holes.
Source code in src/build123d_techdraw/core/view.py
dim_half_diameter(target=None, axis_point=None, diameter=None, orientation='auto', side='auto', offset=0.0, dim_pos=None, past_centerline=5.0, text=None, tolerance=None, prefix='⌀', suffix='', *, anchor=None)
Add an ISO 129-1 §5.2.3 diametral centerline half-dimension to this view.
Source code in src/build123d_techdraw/core/view.py
undercut_callout(target=None, spec='E 0.8x0.3', roughness=None, quantity=None, include_standard=True, elbow_dx=15.0, elbow_dy=-12.0, *, anchor=None)
Add a DIN 509 relief undercut callout to this view.
Source code in src/build123d_techdraw/core/view.py
auto_dimension_turned(shape=None, *, half_diameters=True, include_centerline=True, include_diameters=True, include_lengths=True, include_chamfers=True, include_undercuts=True, tolerance=None)
Automatically dimension a turned/cylindrical view using ISO lathe conventions.
Source code in src/build123d_techdraw/core/view.py
add_bend_annotations(*, include_tag=True, include_allowance=False, show_bend_extents=False, label_mode='auto')
Attach BendLineAnnotation items for every bend on this flat pattern view.
Source code in src/build123d_techdraw/core/view.py
add_punch_markers(*, show_tag=True, show_callout=False)
Attach PunchMarker items for every punch on this flat pattern view.
Source code in src/build123d_techdraw/core/view.py
auto_dimension_flat_pattern(*, include_overall=True, include_bend_stations=True, include_punch_dims=False, tolerance=None)
Auto-dimension this flat pattern view with overall blank and bend-station dims.
Source code in src/build123d_techdraw/core/view.py
ViewType
Bases: Enum
Standard technical drawing view types and projections.
Source code in src/build123d_techdraw/core/view.py
build123d_techdraw.core.title_block
ISO 7200 title blocks, BOM tables, and revision tables.
TitleBlockInfo
dataclass
Metadata fields for ISO 7200 compliant title blocks.
Source code in src/build123d_techdraw/core/title_block.py
extra_fields
property
Return custom fields that do not map to built-in title block cells.
apply_custom_fields(custom_fields)
Merge custom metadata key-values and sync any standard ISO 7200 fields.
Source code in src/build123d_techdraw/core/title_block.py
BOMItem
dataclass
build123d_techdraw.core.template
Custom corporate title block and sheet template engine (SVG & DXF).
SheetTemplate
Bases: SheetDirective
Reusable corporate SVG or DXF drawing sheet / title block template.
Supports both full-sheet templates (TemplateMode.SHEET, replacing the built-in
ISO 5457 border and ISO 7200 title block) and standalone title-block templates
(TemplateMode.TITLE_BLOCK, anchored inside the sheet's standard border).
Source code in src/build123d_techdraw/core/template.py
1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 | |
placeholders
property
Normalized placeholder names discovered in this template.
from_file(path, *, mode='auto', anchor='bottom_right', position=None, offset=(0.0, 0.0), scale=1.0, fit_mode='fit', theme_adapt=True, missing_placeholder='empty', defaults=None, title_block_bbox_mm=None, margins=None, show_revision_table=None, layout='auto', unit_scale=None, bind_dxf_attributes=True)
classmethod
Load an SVG or DXF template file based on its file extension.
Source code in src/build123d_techdraw/core/template.py
1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 | |
from_svg(source, *, mode='auto', anchor='bottom_right', position=None, offset=(0.0, 0.0), scale=1.0, fit_mode='fit', theme_adapt=True, missing_placeholder='empty', defaults=None, title_block_bbox_mm=None, margins=None, show_revision_table=None)
classmethod
Create a template from an SVG file path or raw SVG XML string.
Source code in src/build123d_techdraw/core/template.py
from_dxf(source, *, mode='auto', layout='auto', unit_scale=None, bind_dxf_attributes=True, anchor='bottom_right', position=None, offset=(0.0, 0.0), scale=1.0, fit_mode='fit', theme_adapt=True, missing_placeholder='empty', defaults=None, title_block_bbox_mm=None, margins=None, show_revision_table=None)
classmethod
Create a template from a DXF file path or an in-memory ezdxf Drawing.
Source code in src/build123d_techdraw/core/template.py
with_defaults(fields=None, **kwargs)
Return a copy of this template with additional/overridden default field values.
Source code in src/build123d_techdraw/core/template.py
resolve_fields(info, *, sheet=None, extra_fields=None)
Return resolved placeholder key -> value mapping for all placeholders in the template.
Source code in src/build123d_techdraw/core/template.py
missing_fields(info, *, sheet=None, extra_fields=None)
Return placeholder keys that have no bound value or inline default.
Source code in src/build123d_techdraw/core/template.py
placement_transform(sheet)
Return (tx, ty, sx, sy) mapping template viewBox units into sheet mm.
Source code in src/build123d_techdraw/core/template.py
title_block_bbox(sheet)
Return the rendered title block bounding box in sheet mm (min_x, min_y, max_x, max_y).
Source code in src/build123d_techdraw/core/template.py
render_parts(sheet, *, extra_fields=None)
Render scoped (defs_svg, body_svg) fragments ready to embed in sheet.to_svg().
Source code in src/build123d_techdraw/core/template.py
render_svg(sheet, *, extra_fields=None)
Render a self-contained SVG group containing any scoped defs and the template body.
Source code in src/build123d_techdraw/core/template.py
TemplateMode
Bases: Enum
How a SheetTemplate integrates with a DrawingSheet.
Source code in src/build123d_techdraw/core/template.py
coerce(value)
classmethod
Coerce a TemplateMode or case-insensitive string into a TemplateMode.
Source code in src/build123d_techdraw/core/template.py
build123d_techdraw.core.part_info
Typed bill-of-materials metadata for build123d shapes.
build123d already carries label (BOM description) and material (a typed
FinishedMaterial) on every shape. It has no field for a part number or a free-text
material specification, so this module attaches a frozen PartInfo to a shape.
This is the only place that reads or writes that attribute.
The attribute lives in the shape's __dict__, so it survives copy/deepcopy
(and therefore moved()/located() copies). Boolean operations (a - b) create
a new shape without it: set the part info on the finished shape.
PartInfo
dataclass
BOM metadata for one assembly component.
Attributes:
| Name | Type | Description |
|---|---|---|
part_no |
str
|
Part / drawing number shown in the BOM. Empty -> |
material_spec |
str
|
Material designation text for the BOM (e.g. |
Source code in src/build123d_techdraw/core/part_info.py
set_part_info(shape, info)
get_part_info(shape)
Return the BOM metadata attached with set_part_info, if any.
build123d_techdraw.core.directive
Base class for objects that configure a DrawingSheet when added to it.
SheetDirective
Bases: ABC
Something DrawingSheet.add applies to the sheet instead of storing as an annotation.
Examples: title block and notes settings, revision rows, BOMs and multiview layouts.
Source code in src/build123d_techdraw/core/directive.py
build123d_techdraw.core.booklet
Multi-page drawing booklets and PDF/SVG package generation.
DrawingBooklet
Manages an ordered package of multiple technical drawing sheets with auto-pagination.
Source code in src/build123d_techdraw/core/booklet.py
add_sheet(sheet)
export_svgs(output_dir, theme=Theme.DARK_BLUEPRINT)
Export each sheet in the booklet as an individual SVG file with auto-pagination.
Source code in src/build123d_techdraw/core/booklet.py
export_pdf(output_path, theme=Theme.DARK_BLUEPRINT, bookmarks=True)
Compile all sheets into a single multi-page vector PDF file with auto-pagination and document outline bookmarks.
Source code in src/build123d_techdraw/core/booklet.py
build123d_techdraw.core.scale
ISO 5455 scale ladders and auto-scale utilities.
format_iso_scale(scale)
find_closest_iso_scale(ratio)
Find the largest standard ISO 5455 scale that is <= the specified ratio.
Source code in src/build123d_techdraw/core/scale.py
calculate_auto_scale(model_bbox_size, available_size, margin_factor=0.75, enforce_iso_scale=True)
Calculate the best standard ISO 5455 scale fitting model dimensions into available space.