iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
620 stars 210 forks source link

AccuSnap Hints on SectionDrawings #7245

Closed Ellord207 closed 3 weeks ago

Ellord207 commented 1 month ago

Describe the bug

While viewing a section drawing, Tools with AccuSnap does not give hints for geometry coming from the spatial view.

To Reproduce

Steps to reproduce the behavior:

  1. Create and load a ViewStete of SectionDrawing
  2. Start a tool with AccuSnap (such as the measure tool)
  3. Observe AccuSnap hints on geometry not in the spatial view
  4. Observe NO AccuSnap hints on geometry from the Spatial View.

You can reference the SectionDrawings and ViewDefintions in this iModel. If requested, I can provide access or a local snapshot. I have confirm this bug is Observable in DTA with the ViewDefinitions section-with-annotations and test-section-drawing in this iModel.

Expected behavior I would expect AccuSnap to provide hints on the geometry from the spatial view.

Screenshots Here is a video it happening. In the video, the view is a sheet with an attached SectionDrawing. The result is the same if you just view the section drawing directly.

https://github.com/user-attachments/assets/bcf4e1a5-2114-4081-9f46-b89b48a94fca

Desktop (please complete the applicable information):

Additional context I am able to Select the geometry with the SelectTool, just no AccuSnap Hints.

pmconne commented 1 month ago

5633 added support for snapping to geometry inside ViewAttachments in sheets. It did not do anything to support snapping to geometry inside a section drawing's attached spatial view. The solution would presumably be very similar.

@Ellord207 can you please describe what specifically you are trying to accomplish? Like, are you trying to draw a leader between a dimension and the dimensioned element? Are you trying to measure distances between things in the sheet and in the spatial view or drawing? etc.

Ellord207 commented 1 month ago

@Ellord207 can you please describe what specifically you are trying to accomplish? Like, are you trying to draw a leader between a dimension and the dimensioned element? Are you trying to measure distances between things in the sheet and in the spatial view or drawing? etc.

We expect the users will need snapping to:

  1. Drawing leaders for dimensions, bubble properties, and other such annotations inside the SectionDrawing
  2. Snap and offset annotations from existing annotations for a clean layout.
  3. Measuring distances of elements inside the SectionDrawing
  4. Drawing annotations and markup on a Sheet with one or more attached views of SectionDrawings
  5. There is a fringe case where the user will want to measure between annotations in a Sheet/SectionDrawing and elements in the spatial view for layout purposes.

While we are hoping to automate a lot of these eventually, but manual editing will still need to be supported.

Ellord207 commented 3 weeks ago

The provided fix works for uses cases 1-3, but does not allow for uses 4 & 5. When using an authoring tool, AccuSnap hints are present when viewing a Section Drawing, but when viewing that same Section Drawing as an attachment on a sheet, the AccuSnap hints are not Present.

https://github.com/user-attachments/assets/76d85983-36b4-4e28-864a-dd08c410b4f7

While this use case is less urgent, it is something we will need to support.

pmconne commented 3 weeks ago

when viewing that same Section Drawing as an attachment on a sheet, the AccuSnap hints are not Present.

Ok, I'll try to get that working before tomorrow's demo.

pmconne commented 3 weeks ago

@Ellord207 try now, close if satisfied.

Ellord207 commented 3 weeks ago

Works as expected. Thank you.