Skip to content

Manual drawing reference#7798

Open
theoryshaw wants to merge 7 commits intov0.8.0from
ManualDrawingReference
Open

Manual drawing reference#7798
theoryshaw wants to merge 7 commits intov0.8.0from
ManualDrawingReference

Conversation

@theoryshaw
Copy link
Copy Markdown
Member

@theoryshaw theoryshaw commented Mar 15, 2026

Addresses #7790:

Manual Drawing Reference Tags

What & Why

Elevation and section reference tags are normally generated automatically by Bonsai. But there are cases where a manually placed, persistent reference is needed — one that survives drawing regeneration without being moved or deleted. This PR adds a Manual Drawing Reference annotation type for exactly that.

Changes

  • New annotation type — "Manual Drawing Reference" in the annotation tool opens a dialog to choose Elevation or Section geometry and optionally link to a target drawing at placement time.
  • AssignManualDrawingReference operator — reassign an existing manual tag to a different drawing via the Properties panel, using a searchable dropdown.
  • IsManualDrawingReference pset flag — marks a tag as manually placed; is_auto_annotation now respects this flag so manual tags are never touched during regeneration.
  • SVG export — graceful fallback for angle computation when the tag's local -Z is parallel to the camera view; no crash when no drawing is assigned.

Bug Fixes

  • ElevationDecorator arrow — triangle failed to render in non-plan views because the tag's local -Z always projects to near-zero XY in camera space. Now cascades through local axes to find a non-degenerate screen projection.
  • Section placement in non-plan views — identity-rotation initialisation caused a tessellation crash when the active camera was horizontal. Fixed by using get_default_annotation_matrix(camera), matching how auto annotations are created.
  • Annotation sidebar crashget_text_data was called without checking for an IFC entity on the active object; guarded with tool.Ifc.get_entity(obj).
20260315_1533.mp4

Introduces a boolean pset property that marks an ELEVATION or
SECTION annotation as manually placed, exempting it from
automatic deletion or regeneration during drawing sync.

Generated with the assistance of an AI coding tool.
Adds operator to place manual elevation/section drawing reference
tags that survive drawing regeneration. Includes core function,
tool methods, type-selection dialog, default horizontal rotation
for elevation tags, and SVG null guard for unassigned references.

Generated with the assistance of an AI coding tool.
Adds operator to link a manual drawing reference tag to a target
drawing via IfcRelAssignsToProduct, with a pre-populated dialog
and immediate Properties panel refresh on confirm.

Generated with the assistance of an AI coding tool.
Adds MANUAL_DRAWING_REFERENCE to the annotation type dropdown.
Selecting it shows a dialog to choose elevation or section and
optionally assign a target drawing before placement. Tags are
protected from regeneration via EPset_Annotation.IsManualDrawingReference.

Generated with the assistance of an AI coding tool.
The elevation tag's local -Z axis is intentionally parallel to its
drawing camera's view direction, making screen-space projection of that
axis always degenerate (zero XY delta). Fall through to the tag's local
+X axis, which lies in the camera plane and rotates correctly as the
user adjusts the tag's orientation. Also fix a zero-length vector crash
in svgwriter when the same degenerate case occurs during SVG export.
Use get_default_annotation_matrix() for manual SECTION annotations so
the object is placed in the camera's annotation plane with the correct
rotation, matching how auto-generated section annotations are created.
Without this, annotations placed in elevation or section camera views
had identity rotation, causing the IFC representation to be in the wrong
coordinate system and failing to tessellate.

Also guard draw_edit_object_interface against non-IFC active objects to
prevent AssertionError during toolbar redraws, and skip IFC item edit
mode for ELEVATION/SECTION annotation types on placement.
Replace plain enum dropdowns with prop_with_search in the AddAnnotation
and AssignManualDrawingReference operator dialogs, making it easier to
locate a target drawing when many drawings exist in the project.

Generated with the assistance of an AI coding tool.
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