Conversation
When editing an element's representation items (Item Mode), selecting an item object directly in the 3D viewport left the "Representation Items" list unchanged, so users had to hunt through the list manually to find the row matching what they'd just clicked on. Geometry.sync_active_item_index() now runs on every active-object change (same msgbus hook that already drives selection-driven BIM tool sync) and, when Item Mode is active, updates active_item_index to the row whose IFC id matches the newly active item object. It's a no-op outside Item Mode, for objects with no matching row, and for the hidden representation host object itself. Fixes IfcOpenShell#6239. Generated with the assistance of an AI coding tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6239.
Selecting a representation item object in the 3D viewport now highlights the matching row in the "Representation Items" list, instead of leaving it on whatever row was last active.
Geometry.sync_active_item_index()reads the newly active object'sifc_definition_idand updatesactive_item_indexto the matching row; it reuses the existing active-object msgbus hook that already drives BIM-tool-props sync, so no new selection handler was added. It no-ops immediately outside Item Mode, for the representation host, or for unrelated objects, so it only ever scans one element's items.Thanks for reporting this, @theoryshaw.
Test plan
TestSyncActiveItemIndex(4 cases) added; fulltest_geometry.pysuite 68/68 pass.Generated with the assistance of an AI coding tool.