Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

BjornFidder
Copy link

The numbering tool discussed in this OSArch post has been added into Bonsai.
The tool is available from the toolbar, below the Structural tool. Using the tool, one can directly assign or remove numbers. If the tool is activated, the sidebar shows an additional panel under the Tool section, containing the UI for the numbering settings.

TODO:

  • create icon for numbering tool in toolbar
  • add feature tests
  • additional features: number in order of selection, more options for customizing format (as suggested by @theoryshaw)

Further notes:
This is my first pull request to IfcOpenShell. I have tried to be consistent with the conventions. I have not been consistent in adding type signatures everywhere. Also, the bonsai/tool/numbering.py file contains several static classes with internal data storage, which seems not in accordance with conventions.

I'd love to know what is required to get my additions in accordance with conventions and ready for inclusion into native Bonsai. Any help or ideas are also welcome.

image

BjornFidder and others added 10 commits August 26, 2025 13:18
Introduces a new 'numbering' module to the Bonsai OpenBIM Blender add-on, including operators, properties, UI panel, and utility functions for assigning, removing, and managing numbers on IFC elements. Updates core registration to support the new module and adds integration points in the tool layer.
Commented out most functionality in the numbering UI and properties to prepare for refactoring. Added new data and core files for numbering, updated imports, and introduced stubs for project retrieval. Updated workspace icon and method signature, and fixed import paths for utility functions.
This commit completes the implementation of the Numbering module UI and property group, enabling all settings, selection, ordering, and storage options for element numbering in the Bonsai Blender add-on. It refactors the workspace tool to use the new UI, updates operator references, and adds core and tool documentation for maintainability.

Tool seems fully working, but there is still some refactoring to do, to use the NumberingData instead of static class variables, and to fix the format, the tool's formatting is not quite right. Also try to find a way to override the toolbar layout to be different from the sidebar layout.
Moved numbering logic from module/numbering/util.py to bonsai/core/numbering.py and deleted util.py. Updated imports across the module to use bonsai.core.numbering. Moved all the numbering settings to a separate UI panel (BIM_PT_Numbering), defined in ui.py, which is shown in the Tool panel of the sidebar, in a separate panel. Updated operator logic to use new Numbering class methods. Improved property naming for clarity and consistency.
This commit refactors and formats the BIM numbering module for improved readability and consistency. Changes include reformatting code, updating property definitions, improving error reporting, and cleaning up whitespace and indentation across multiple files. No functional changes were made.
Simplified type extraction in NumberFormatting by removing unnecessary list and str conversions. Updated ObjectGeometry to streamline Vector creation for min and max corners, improving code readability.
Eliminated the 'project' key and related method from NumberingData, as it is no longer used when updating data after polling. This simplifies the data structure and removes unnecessary code.
Refactored numbering-related classes and functions from src/bonsai/bonsai/core/numbering.py to src/bonsai/bonsai/tool/numbering.py. Updated imports in operator, prop, and ui modules to use bonsai.tool.numbering. Adjusted workspace keymap properties and extended the Numbering interface in core/tool.py. This improves modularity and separation of concerns between core and tool logic.
@BjornFidder BjornFidder marked this pull request as draft August 27, 2025 14:27
@BjornFidder BjornFidder marked this pull request as ready for review August 27, 2025 14:29
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