The fix in 0899a2a8 ensured that when you switched geometry, all other
elements (sharing the same type or representation) would also switch
alongside it. However it would lead to mesh invalidation which broke
some assumptions in the style code. The style code also repeated a lot
of the logic of switch representation (i.e. finding shared
representations) so this seems simpler.
In general the whole representation part of the code is messy and
hopefully over time it'll get better.
For occurrences, the iterator would populate ios_materials if there is a
material / style associated with it. However, for types we do
create_shape to the representation directly, so we need to do the
material / style check manually.
The same issue of handling relative paths, doing as_posix, checking
drives, etc was solved again and again in slightly different ways. This
centralises it.
Example - https://imgur.com/a/4PZr0px
It's very clunky and mainly exposed just to be available in some way, it will all make more sense when we display project libraries as trees in project library ui.
* Add AssignConstituentFractions recipe
* license, units & added context description
* removed src, using better unit handling and several other small improvements based on feedback
Force the color of the icons in the Properties-Scene tab to match Regular Text
Use the icon display mode function to detect where to use dm_ifc.png or lm_ifc.png
Co-authored-by: tim <tjrhyder@gmail.com>
Handle missing IfcRelationship - eg. if all sofas are deleted the
IfcRelDefinesByType is deleted too, but we reincarnate as an empty list
so it can be merged.
Sanity check internal graph - If an entity is deleted in one branch but
has a new usage in another branch, merging would break the graph leaving
a dangling reference. ie. now you can't delete types, materials etc..
in one branch while using them for new objects in another and still
expect the merge to succeed.
Previously I was only toggling Blender collections which is an
optimisation for large projects but will result in incorrect behaviour
if things aren't in the collection you think they're in. So for now it's
slower but more correct. We can optimise it later.
This means that seeing the extrusion type graphically is now possible,
adding booleans is now through a consistent interface. It's still
possible to immediately edit the axis via Alt-E and profile via Shift-E.
This helps consoliate code too.
I can't believe I accidentally left out the minus sign. The ability to
handle simple remapping of location A --> B is useful for software that
doesn't support map conversion properly.
Previously the collection and scene object was removed, but this is
obviously not sufficient since the bpy.data.library still exists (which
meant that if you relinked it, regardless of your cache setting, it'd
just load the existing Blender file which is completely useless).
* feature_faster_unit_method > main: added constants
* feature_faster_unit_method > main: extended `file` class to dynamically save unit information
* feature_faster_unit_method > main: refactored `get_property_unit` method
1. split out case that returns the wrong type (dictionary of units) into its own method
2. cleaned up (but preserved) logic
3. refactored common part of all cases (the method which prioritises unit then value-entity then measure_class)
---------
Co-authored-by: raj-open <raj-open@users.noreply.github.com>
Co-authored-by: Dion Moult <dion@thinkmoult.com>
* linting-workflow > v0.8.0: make QA only throw warning instead of error on unprettified code with no syntax errors
Without a Linting policy, the workflow should only fail if code base contains syntax errors.
* linting-workflow > v0.8.0: better logging
* linting-workflow > v0.8.0: changed instruction to notice-type
---------
Co-authored-by: raj-open <raj-open@users.noreply.github.com>
This means that openings can (and default to) start with extrusions. It
also starts to open up the possibility to add other types of feature
elements. Still really incomplete.
As it also has a third value "UNKNOWN" which has it's own meanig in IFC and therefore IfcLogical cannot be represented by simple booleans.
Example in Bonsai - https://i.imgur.com/xuPMcwA.png
Since calculate_unit_scale now requires a project.
def calculate_unit_scale(ifc_file: ifcopenshell.file, unit_type: str = "LENGTHUNIT") -> float:
"""Returns a unit scale factor to convert to and from IFC project units and SI units.
Example:
.. code:: python
ifc_project_length * unit_scale = si_meters
si_meters / unit_scale = ifc_project_length
:param ifc_file: The IFC file.
:param unit_type: The type of SI unit, defaults to "LENGTHUNIT"
:returns: The scale factor
"""
> if not (units := ifc_file.by_type("IfcProject")[0].UnitsInContext):
E IndexError: list index out of range
It was triggering name_callback, adding indices to the names and writing the name with index to ifc.
Also now check previous and new object name explicitly instead of relying on `obj.name` as it may have Blender indices (Blender doesn't support multiple objects sharing the same name).
It's important to have somewhere information on how many elements were actually affected since some of the selected objects may not support the used attribute.
Example - https://i.imgur.com/UrLNWcF.png
E.g. previously if you would tab into editing IfcExtrudedAreaSolid that was using not supported profile type (e.g. IFCCSHAPEPROFILEDEF) it would import it as empty geometry and tabbing out then would save it corrupting the original profile. Now there is an error message that it's not yet supported - https://i.imgur.com/NzksYVP.png
Bonsai now creates a user data folder that allows you overriding Bonsai data files. E.g. you can put you own `default.css` as `data/assets/default.css` in that folder and it will override the `default.css` Bonsai is using for the drawings. Previously you could have change internal `default.css` but Bonsai would always restore the original one on every update / reinstallation.
You can also store your .ifc files in data/libraries or data/templates and Bonsai will ensure they're loaded and you won't need to worry about Bonsai removing them later.
E.g. on Windows this path is `C:\Users\xxx\AppData\Roaming\bonsai\bonsai\data`/
You can also find path in the preferences - https://i.imgur.com/kwMc0JU.png
Previously cache_dir was located under site-packages, which is managed
by blender and could be read-only. Now location defaults to eg.
~/.cache/bonsai or equivalent location on other platforms. See #5564
Note this adds a dependency on the platformdirs python module
I can't explain this one so I'm pretty embarrassed to commit this, but
it crashes (see situation in #5799) on my machine and I can't recreate
it outside this scenario. In any case I think as a general strategy we
should:
1. Minimise reliance on msgbus
2. Msgbus listeners themselves should be wary of invalid state (e.g. if
object is now unlinked)
3. Not clear listeners (don't overreach)
The commit that introduced the problem was trying to optimise rendering
dense meshes with the opening decorator. However, it introduced more
calculation in the initial project load and stored more data on every
object. This resulted in models loading 3x slower for me which is pretty
major. The original problem needs further investigation.
Sometimes we want to fetch selected objects, and that includes the
active object, even if the active object isn't actually highlighted in
the viewport (albiet rare, I think?).
Conversely sometimes we want to get the active object, even if it isn't
actually highlighted. The tool.Blender functions now have kwargs to
distinguish between these.
I find this a bit of a strange behaviour in IFC. Imagine you start with
a Tessellation representation type. You're only allowed meshy things, no
solid extrusion. And vice versa if you have a SweptSolid representation
type.
Now imagine you suddenly create a boolean. Now, you can mix both
tessellations and solids together.
The ZIP installer now contains a `libs/bin` folder that contains
`ifcmerge`. Bonsai on `register()` adds this folder to the system `PATH`
for the current Blender session. Advantage of this is that we don't have
to fiddle with the registry on windows, or install files to
`~/.local/bin` on Linux, it _should_ work on Darwin, updates are
automatic, and we have a mechanism to ship other executables if
required.
(Note that ifcmerge.exe increases the size of the Windows Bonsai ZIP
download by about 7MB)
If Git isn't installed on Windows, the Git panel now offers to install
it from the Windows Package Manager Community Repository using `winget`.
The annotation adding code was a bit of a mess, spread around
create_annotation, create_annotation_occurrence, and
bpy.ops.bim.add_annotation. I've now consolidated it all into
core.add_annotation and updated it to work with the new item editing
mode (basically new objects need to reload their representation to
populate item_ids). Things are still messy, but a bit less now.
Otherwise it was hidden until user guesses that 2 objects need to be selected for it to appear.
Also, not sure if it's useful operator anymore - it seems just duplicating an opening and then adding it does the same thing.
WARNING! The roof generation is now quite significantly different. This
WILL change your geometry when you refresh roofs from existing models.
- The roof profile now always represents the top of eave. This better
represents how things are built rather than bottom of eave which was
previous.
- The roof therefore always grows down from the profile. The rafter
edge angle can only be acute. This means that the roof will never grow
larger than the footprint profile that you've drawn. (before, the
footprint was not guaranteed to match).
- The roof thickness is now the actual thickness of the roof, not the
"vertical dimension" of the roof. This means that the roof thickness can
now match intended layer thicknesses instead of you needing to do math
to work it out.
I've rewritten the internals of how roofs were generated to be hopefully
a lot simpler but as a tradeoff it's more restrictive. After the
skeleton is generated, non-uniform angles would be handled through
vertex splitting and moving. This works in simple scenarios but fails in
more complex ones. The new approach only handles non-uniform angles on
triangular faces. These faces are really easy to handle compared to
ngons, but are also more robust. The rafter edge angle is also now
handled using a clipping plane, which is a lot, lot simpler than vertex
sliding math.
Each face is now processed separately and then merged at the end. This
means that if a face has a different angle, it will now correctly
represent the different thickness at that portion of the roof.
In the process consistent roof thickness / rafter angle bugs were fixed.
E.g. two objects are selected - tesselation and profile and tesellation being active object. Using s-e with deselect tesselation object as it doens't have a usage but Bonsai would still try to run bim.enable_editing_extrusion_profile on it leading to the error.
Also fix possible issues for hotkey executed without active object (it seems all operators in hotkey do require active object)
Apparently (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62572) coreutils have changed `mv -n` to throw an error now instead of working silently, therefore our build was failing on Mac when Github Action switched from Ubuntu 22 to 24.
`--update=none` seems to restore the old behaviour.
The for/else block was too greedy, meaning that if nothing was selected,
it would still try to create slabs from walls. I find for/else confusing
so I restructured the section to do more early returns and unindent the
logic.
• Removed bpy.context.preferences.themes[0] from the input and hardcoded it in the function.
• color_path now only requires the attribute path suffix (e.g., "user_interface.wcol_regular.text").
• Updated error handling to default to "dm" instead of "lm".
If you move a wall, and that wall has features (e.g. openings), it's
desirable to also move those openings (because they are invisible). This
is a special exception to `should_transform_children` because the
definition of the feature (opening) is inherently tied to the parent
(wall).
What wasn't considered is that this would typically then also move
subchildren of the features (e.g. fills like doors). I'm surprised
nobody caught this earlier.
I did also consider another approach where if you move a wall, it moves
all unfilled openings, and if you move a door which fills a opening, it
moves the opening too. Intuitively it sounds nice, but it doesn't work
because:
- Openings can have multiple fillings. If you move all fillings, they
all fight to move the openings.
- All logic about children goes one way: a placement may have child
placements relative to it. This breaks the convention (if moving a door
instead moves its opening) which can make brains explode.
- It starts to conflate rules about relative / referenced placements
with spatial decomposition. We assume all IFCs are valid and follows the
convention of relative placement but we cannot guarantee this. This also
leads to brain explosion.
Previously the code looked for additive facets (entity, instance)
anywhere in the query, and then only added the default basket once at
the beginning of the query. This change makes it look for additive
facets in order (that way you could start with a default selection, and
then later use an additive facet) and does it per facet list (so you can
omit the additive facet at the beginning of each list).
The IDS documentation used to state that "optional" on requirement
facets was "for information only" and didn't affect the pass / fail
state. This was changed a while ago (which I missed) to a new behaviour:
both no values and passing values will pass.
Previously, to edit a single IfcMaterial pset, you'd do so in the
material manager. In contrast, to edit a IfcMaterialSet pset, you'd do
so only when assigned to an object. Not only is it bad to edit psets in
two locations, it also means you can't edit psets until you've first
assigned the material set to an object which is bad. Now it's less code,
and material / material set psets are in the same spot.
There still more consolidation work to do, to allow editing of sets in
the material manager and to figure out how to show item psets, but it's
a step in the right direction.
Went back to previous toolbar : icon + type name + dot grid icon which all launch the type manager.
Validating the type manager popup now only closes it. Functionally is the same thing as clicking Cancel. Don't really know what to do to fix it. Does cancel make sense in the type manager ? Do we want to be able to undo what is possible to be done from within the type manager ?
You can change the active type either with the dropdown in the popup and in the grid flow. I changed it so that changing the type in the dropdown jumps to the corresponding page. BTW first time using github copilot to figure out the maths and it worked magically :) . I'm not against removing the dropdown but I feel like it's nice to see a plain list to choose from.
You can input a specific page number or scrub the page number field. Might be usefull if user has dozens of pages to flip through.
Right now the search is very simple, it does not implement fuzzy search or anything fancy with *
Add back the type dropdown and looking glass icon in the toolbar
Clicking on a type in the manager no longer closes the popup anymore.
A visual indictor is displayed on the active type
Changed the parameters icon in the individual type interface
Fix bug in "Slab from Walls" Shift + A code
This highlights a potential bug that already existed due to the way the attribute system is designed. Where the user mass-edits attributes from different IFC types, resulting in discrepancies due to the same attributes having a different index. eg IfcWindow has the Tag attribute at index 3, IfcDoor at index 4. So using the ALT modifier feature from vanilla Blender to mass-modify similarly named attributes on the Tag attribute of the IfcWindow will modify the PredefinedType attribute on the IfcDoor (index 3). For this reason I added the ALT modifier to the buttons so mass-operations are a conscious effort for more knowledgeable users. Might reconsider if problems arise but this is IMO a good QOL feature.
Also fix floating point precision errors on Pset float values stored as strings (re last commit)
To do so Right Click on a material in the Asset Browser then `Set To External Style`. The style editor must be loaded in the properties editor.
Also run black on a file from previous commit and fix a bug soft-locking the style editor when removing a style that is being edited
It's a naive implementation and very inefficient. Moreover there may be false positives because it's testing overlapping the evaluated mesh element with all openings applied.
No functional change apart from in dissolve_triangulated_edges where it will try to load the attribute if it can. I believe it will be easier in the long term to use the builtin Attributes system. Unfortunately Curves don't support Attributes yet. Also, attributes are more lightweight compared to custom properties.
It uses a custom boolean attribute on the mesh to decide whether an edge should be displayed or not. I think later on it can be used to get rid of the dictionary accessors which make the blend file size skyrocket.
- Highlight new objects in red when in aggregate mode
- Introduce an operator to add new objects to the current aggregate, accessible via a button in the header menu
Now, when trying to move an object that is a part of an aggregate, the
`OverrideMoveAggregate` will be called, meaning that it will move the whole
aggregation. It works by creating constraints and moving the aggregate instead
of the selected object.
It also introduces the idea of editing an aggregate (no hotkey yet). When active, the user
will be able to move the parts of the aggregate instead of the whole aggregation: https://imgur.com/IcCGtPN
- Enables the vanilla Blender autosave feature back, since a running modal operator deactivates it
- ESC is not used by any other vanilla keymap in the 3D viewport (may be conflict with other addons)
- Hitting ESC over another type of editor (eg enum field in the properties editor) will not trigger disabling ifc item mode
- You can now hit ESC in IFC edit mode to cancel editing the geometry and go back to ifc object mode
Error occurred if IfcElementAssembly, that was currently refreshed, had another IfcElementAssembly as it's part. Then, it was removed twice - once during delete_objects and another time during delete_ifc_object, leading to the error.
If current set of rules (e.g. IfcOpenShell) doesn't provide a way to quantify some type of element, then user now have an option to fallback to other calculator (Blender).
Location - https://i.imgur.com/csIPOuo.png
This operator allows users to create walls from a slab.
When the wall tool is active, pressing `Shift + A` will generate walls based on the exterior polygon of the selected slab.
This operator allows users to create a slab from a selected closed loop of walls.
When the slab tool is active, pressing `Shift + A` will generate a slab based on the exterior polygon of the selected walls.
E.g. in #5890 pset was shared by 2 elements and they it worked is
1) it appended first element and it's rel to pset
2) it appended second element and skipped updating it's rel as it was appended before. Now it's going to update it to ensure it encludes second element too.
I believe, issue occurred after 8c28f52 when we stopped duplicating inverses and started to reuse them.
Mentioned in 618ba51, it probably will be more natural this way - if there are no textures, we hide UV attribute to indicate that it won't be saved and on save we either do nothing, if texture style wasn't saved before, or remove it.
It was suggesting that it's possible to create it with just shading style though it's not currently supported.
Now it also appears when user is about to enable texture style editing, not when they're already trying to save the changes.
Demo - https://imgchest.com/p/xny8qvox5yb
You can also now reuse 'bpy.data.texts['globalid-filter-3UvnD5Ml95zBDEcwAkAUIp']' kind of queries from Search in ExtractElements query.
1) Identify from previous pset value whether prop was an enum (by checking if previous value is a list), instead of searching through prop templates
2) Compare previous and new enum values - if they match, skip editing IFC.
1) If object had multiple representations for the same context, then switch simply wouldn't work as it would always pick up the first representation it could find. Now it prioritizes the one user is selecting in UI.
2) If some object is selected and it also has multiple representations for the same context, then switch representation would switch it to any representation in that context it first finds. As user doesn't provide representation explicitly in that case, now it will stick to the already active representation on selected object if it matches the context, to avoid accident switches.
Notcied by working with example from #5824
- The patch was failed when executed from Bonsai since self.src wasn't provided, fixed now.
- Added a temporary hack to diplsay file selector for this patch.
- small refactor.
It was only checking if it's existing path but wasn't checking whether it's a file, therefore directories with suffixes were slipping in and then failing during `IfcHeaderExtractor(filepath)`.
Mentioned in logs from #5820
Turned out, `area.spaces` also contain all other spaces this area used (e.g. it used be view3d before it became a nodegraph) leading to errors. Simplifying it with `area.spaces.active`.
the way it was intended to originally but absolute paths of ifc and ids got in the way
Replaced TemporaryDirectory with mkdtemp as sometimes .html report doesn't open fast enough and directory gets deleted. Also need to keep the directory to make sure .ods is not removed.
The titleblock is ifc relative, not .blend/cwd relative.
e.g. if you open Blender in C:\ and then would open .ifc from c:\path\to\project.ifc, it would try to create layouts folder in C:\layouts instead of c:\path\to\layouts
Error: Python: Traceback (most recent call last):
File "\bonsai\bim\ifc.py", line 443, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\profile\operator.py", line 172, in _execute
if not indices:
^^^^^^^
UnboundLocalError: cannot access local variable 'indices' where it is not associated with a value
example - https://imgchest.com/p/qb4zwj6ad4j
1) moved profile object selection to the same row as the profile type selection, so it will more noticable that they're related
2) added object requirements in the description
3) filtered only mesh objects to appear in the dropdown
There was an issue that it wouldn't load until you manually select it in the "Cost Item Rates" enum - otherwise items didn't appear the first time cost schedule opened and didn't not update when you makes changes to the active schedule of rates.
To avoid confusing situations when user would assign a class, move object around and save ifc file, then to realize that it was saved using just local transforms which can be completely different.
No idea what happened but in Blender <4.3 `type(bpy.types.SCENE_PT_rigid_body_world_settings.bl_rna)` is `<class 'bl_ui.properties_scene.SCENE_PT_rigid_body_world_settings'>` which is `bpy.types.Panel` but in Blender 4.3 it's now is `bpy.types.Struct`. Using `.base` seems to work for both versions.
Error: Python: Traceback (most recent call last):
File "\bonsai\bim\ifc.py", line 443, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\drawing\operator.py", line 2960, in _execute
core.edit_assigned_product(tool.Ifc, tool.Drawing, obj=context.active_object, product=product)
File "\bonsai\core\drawing.py", line 66, in edit_assigned_product
drawing.update_text_value(obj)
File "\bonsai\tool\drawing.py", line 983, in update_text_value
cls.import_text_attributes(obj)
File "\bonsai\tool\drawing.py", line 904, in import_text_attributes
props.font_size = str(text_data["FontSize"])
should_draw_decorations is updated as part of regular refresh_ui_data.
'removed_drawings' line was a dead code
Traceback (most recent call last):
File \bonsai\bim\module\drawing\prop.py", line 252, in update_should_draw_decorations
collection = context.scene.camera.BIMObjectProperties.collection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'BIMObjectProperties'
File \bonsai\bim\module\drawing\prop.py", line 249, in update_should_draw_decorations
Items generators were exhausted at the first register leading to errors like 'TypeError: EnumProperty(..., default='-'): not found in enum members' preventing reregistration.
Traceback:
Traceback (most recent call last):
File "\bonsai\bim\module\patch\operator.py", line 187, in execute
core.run_migrate_patch(tool.Patch, infile=self.infile, outfile=self.outfile, schema=self.schema)
File "\bonsai\core\patch.py", line 30, in run_migrate_patch
patch.run_migrate_patch(infile, outfile, schema)
File "\bonsai\tool\patch.py", line 28, in run_migrate_patch
output = ifcpatch.execute(
^^^^^^^^^^^^^^^^^
File "\ifcpatch\__init__.py", line 85, in execute
patcher.patch()
File "\ifcpatch\recipes\Migrate.py", line 58, in patch
new_element = migrator.migrate(element, self.file_patched)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 363, in migrate
new_element = self.migrate_attributes(element, new_file, new_element, new_element_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 393, in migrate_attributes
self.migrate_attribute(attribute, element, new_file, new_element, new_element_schema)
File "\ifcopenshell\util\schema.py", line 494, in migrate_attribute
new_value.append(self.migrate(item, new_file))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 363, in migrate
new_element = self.migrate_attributes(element, new_file, new_element, new_element_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 393, in migrate_attributes
self.migrate_attribute(attribute, element, new_file, new_element, new_element_schema)
File "\ifcopenshell\util\schema.py", line 497, in migrate_attribute
setattr(new_element, attribute.name(), value)
File "\ifcopenshell\entity_instance.py", line 325, in __setattr__
self[index] = value
~~~~^^^^^^^
File "\ifcopenshell\entity_instance.py", line 363, in __setitem__
raise TypeError(
TypeError: attribute 'CountValue' for entity 'IFC4X3_ADD2.IfcQuantityCount' is expecting value of type 'INT', got 'float'.
Error: Python: Traceback (most recent call last):
File "\ifcopenshell\entity_instance.py", line 361, in __setitem__
self.method_list[idx](self.wrapped_data, idx, entity_instance.unwrap_value(value))
File "\ifcopenshell\ifcopenshell_wrapper.py", line 9271, in setArgumentAsInt
return _ifcopenshell_wrapper.entity_instance_setArgumentAsInt(self, i, v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: in method 'entity_instance_setArgumentAsInt', argument 3 of type 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\ifcopenshell\entity_instance.py", line 325, in __setattr__
self[index] = value
~~~~^^^^^^^
File "\ifcopenshell\entity_instance.py", line 363, in __setitem__
raise TypeError(
TypeError: attribute 'CountValue' for entity 'IFC4X3_ADD2.IfcQuantityCount' is expecting value of type 'INT', got 'float'.
Traceback:
Traceback (most recent call last):
File "\bonsai\bim\module\patch\operator.py", line 187, in execute
core.run_migrate_patch(tool.Patch, infile=self.infile, outfile=self.outfile, schema=self.schema)
File "\bonsai\core\patch.py", line 30, in run_migrate_patch
patch.run_migrate_patch(infile, outfile, schema)
File "\bonsai\tool\patch.py", line 28, in run_migrate_patch
output = ifcpatch.execute(
^^^^^^^^^^^^^^^^^
File "\ifcpatch\__init__.py", line 85, in execute
patcher.patch()
File "\ifcpatch\recipes\Migrate.py", line 58, in patch
new_element = migrator.migrate(element, self.file_patched)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 358, in migrate
new_element = self.migrate_attributes(element, new_file, new_element, new_element_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 388, in migrate_attributes
self.migrate_attribute(attribute, element, new_file, new_element, new_element_schema)
File "\ifcopenshell\util\schema.py", line 489, in migrate_attribute
new_value.append(self.migrate(item, new_file))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 358, in migrate
new_element = self.migrate_attributes(element, new_file, new_element, new_element_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 388, in migrate_attributes
self.migrate_attribute(attribute, element, new_file, new_element, new_element_schema)
File "\ifcopenshell\util\schema.py", line 484, in migrate_attribute
value = self.migrate(value, new_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\util\schema.py", line 346, in migrate
return new_file.create_entity(element.is_a(), element.wrappedValue)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\file.py", line 400, in create_entity
e[idx] = arg
~^^^^^
File "\ifcopenshell\entity_instance.py", line 363, in __setitem__
raise TypeError(
TypeError: attribute 'wrappedValue' for entity 'IFC4X3_ADD2.IfcCountMeasure' is expecting value of type 'INT', got 'float'.
Error: Python: Traceback (most recent call last):
File "\ifcopenshell\entity_instance.py", line 361, in __setitem__
self.method_list[idx](self.wrapped_data, idx, entity_instance.unwrap_value(value))
File "\ifcopenshell\ifcopenshell_wrapper.py", line 9271, in setArgumentAsInt
return _ifcopenshell_wrapper.entity_instance_setArgumentAsInt(self, i, v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: in method 'entity_instance_setArgumentAsInt', argument 3 of type 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\ifcopenshell\file.py", line 400, in create_entity
e[idx] = arg
~^^^^^
File "\ifcopenshell\entity_instance.py", line 363, in __setitem__
raise TypeError(
TypeError: attribute 'wrappedValue' for entity 'IFC4X3_ADD2.IfcCountMeasure' is expecting value of type 'INT', got 'float'.
Traceback
2024-11-18:11:09:15,441 ERROR [log.py:69] Uncaught exception
Traceback (most recent call last):
File "\bonsai\bim\module\pset_template\ui.py", line 66, in draw
self.draw_pset_template()
File "\bonsai\bim\module\pset_template\ui.py", line 110, in draw_pset_template
value_name = self.props.active_prop_template.get_value_name()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\pset_template\prop.py", line 175, in get_value_name
ifc_data_type = IfcStore.get_schema().declaration_by_name(self.primary_measure_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\ifcopenshell_wrapper.py", line 10119, in declaration_by_name
return _ifcopenshell_wrapper.schema_definition_declaration_by_name(self, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Entity with name '-' not found in schema 'IFC4'
Full error traceback:
Error: Python: Traceback (most recent call last):
File "\ifcopenshell\entity_instance.py", line 361, in __setitem__
self.method_list[idx](self.wrapped_data, idx, entity_instance.unwrap_value(value))
File "\ifcopenshell\ifcopenshell_wrapper.py", line 9271, in setArgumentAsInt
return _ifcopenshell_wrapper.entity_instance_setArgumentAsInt(self, i, v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: in method 'entity_instance_setArgumentAsInt', argument 3 of type 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\bonsai\bim\ifc.py", line 443, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\pset\operator.py", line 142, in _execute
ifcopenshell.api.run(
File "\ifcopenshell\api\__init__.py", line 92, in run
return usecase_function(ifc_file, should_run_listeners=should_run_listeners, **settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\__init__.py", line 258, in wrapper
raise e
File "\ifcopenshell\api\__init__.py", line 252, in wrapper
result = usecase(*args, **settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\pset\edit_qto.py", line 135, in edit_qto
return usecase.execute()
^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\pset\edit_qto.py", line 149, in execute
self.update_existing_properties()
File "\ifcopenshell\api\pset\edit_qto.py", line 166, in update_existing_properties
self.update_existing_property(prop)
File "\ifcopenshell\api\pset\edit_qto.py", line 180, in update_existing_property
prop[3] = float(value)
~~~~^^^
File "\ifcopenshell\entity_instance.py", line 363, in __setitem__
raise TypeError(
TypeError: attribute 'CountValue' for entity 'IFC4X3_ADD2.IfcQuantityCount' is expecting value of type 'INT', got 'float'.
Example - https://imgchest.com/p/bp452xxbx45
cc @steverugi @DimitriosThe maybe you'll find useful too if you use custom quantity sets for products in 4d/5d
tuple(resource) was resulting in (GlobalId, OwnerHistory, Name, ...) instead of (resource,), so the check never passed and orphaned IfcRelAssignsToResource was never removed.
* Fix Shift-clicking SVG-DXF conversion
* Fix Schedules and References not incrementing the ID number properly
* Remove the superfluous Create and Open buttons from the Active Drawing pane
* Add active camera indicator to the Drawing list
* Improved enable/disabled icon behaviour
As many operators as possible now use polling method to set enabled/disabled state.
Icons set their enabled/disabled state intelligently depending on what is selected.
When an operator is disabled it says why it is disabled in the tooltip.
* Rename core open_sheet, operator OpenSheet/bim.open_sheet to better reflect what it actually does, i.e. open_layout
* Added selection checkmarks to Sheets, and operator to select all/none, to do batch ops on sheets
* Missed adding the renamed operator to __init__ in commit 4cfc0bd9f3
* Decouple creating and viewing drawings/sheets to avoid focus stealing popups polluting display on long batch runs
* Improve drawing selections in OpenDrawing operator
* Add the Shift+click power move to Create Sheet
* Add the Open Sheet + Shift+click power move
* Improve drawing selections in RemoveDrawing operator
* All operators are now documented with standardised language and terms.
* Add status bar Info messages for feedback on create tasks that now don't have visual feedback
* Fix enable/disable for ActivateDrawing operator icons.
This was a strange one. They have common invoke and execute methods,
but the polling has different conditions.
I tried subclassing the original ActivateDrawing for the Sheets version,
but something about Blenders operators breaks the classmethod decorated
poll. This was the cleanest solution I found, but maybe there's a better
one.
* Placeholder operator for DuplicateSheet function.
Does nothing but report Not Implemented. Could be omitted if this
kind of thing is frowned upon.
* Change icons to be more consistent
* Final changes to toolbars
Change button order and spacing for better usability.
Add a checkmark all/none button, to do batch ops on sheets.
Moved Bonsai Web UI button up to sheets toolbar.
Some general cleanup of unnecessary clutter in the toolbar code.
* Sheet/Drawing checkmarks remember their state properly
* Adjust sheet/drawing operators to view after singular create, but not when batch creating more than one.
* By special request, add back the opening windows when creating, but requiring Ctrl to be pressed.
* black the files
* Second attempt at blacking ui.py because I used an old black
* Change method of getting active drawing to use one in tool import as requested
* Fix for incorrect d1fc5158d - actually checked it this time
On large projects selecting cost items is very slow due to all data that needs to be loaded. On the project I was testing, it was taking about 0.8sec, now this time is reduced to 0.17sec.
That way all assigned resources will be added as cost values to cost items and it will be more apparent what resources were used for the last calculation and what costs/quantities they had at the time.
cc @Andrej730 we need this for validate.buildingsmart.org because for express rule evaluation we depend on include_id=False and entity_instance.__eq__ has been changed to get_info_2.
Previously Bonsai would show a wall of errors, now it's show a simple error message and redirecting to system console for the details.
Example error - https://i.imgur.com/uJJfjUW.png
Example validation error details in console - https://i.imgur.com/3mcVBUh.png
Same details but in text:
Validation error details:
failed validating {'dataType': 'IFCBOOLEAN', 'ursi': 'https://google.com', 'cardinality': 'required', 'instructions': "Make sure it's true"} with XsdAttributeGroup(['dataType', 'uri', 'cardinality', 'instructions']):
Reason: 'ursi' attribute not allowed for element
Schema component:
<xs:extension xmlns:xs="http://www.w3.org/2001/XMLSchema" base="ids:propertyType">
<xs:attribute name="uri" type="xs:anyURI" use="optional" />
<xs:attribute name="cardinality" type="ids:conditionalCardinality" use="optional" default="required" />
<xs:attribute name="instructions" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Author of the IDS can leave instructions for the authors of the IFC. This text could/should be displayed in the BIM/IFC authoring tool.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
Instance type: <class 'xml.etree.ElementTree.Element'>
Instance:
<ids:property xmlns:ids="http://standards.buildingsmart.org/IDS" dataType="IFCBOOLEAN" ursi="https://google.com" cardinality="required" instructions="Make sure it's true">
<ids:propertySet>
<ids:simpleValue>Pset_WallCommon</ids:simpleValue>
</ids:propertySet>
<ids:baseName>
<ids:simpleValue>Combustible</ids:simpleValue>
</ids:baseName>
<ids:value>
<ids:simpleValue>false</ids:simpleValue>
</ids:value>
</ids:property>
Path: /ids:ids/ids:specifications/ids:specification/ids:requirements/ids:property[1]
Got report that there was an issue with get_parts not returning all parts if there are multiple IfcRelAggregates involved though it is valid ifc. Fixed the same possible issue for ContainsElements, IsNestedBy
* fix: Rename the "MergeProject" recipe to "MergeProjects"
This rename, alongside renaming "filepath" to "filepaths" and adjusting the docstring has been done to clarify, that this patch can be used to merge multiple IFC files into one (and not just two)
* fix: Fix `test_Merge_Project.py`, which was broken due to renaming the patch recipe
Traceback
```
Error: Python: Traceback (most recent call last):
File "\bonsai\bim\ifc.py", line 443, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\bonsai\bim\module\pset\operator.py", line 126, in _execute
ifcopenshell.api.run(
File "\ifcopenshell\api\__init__.py", line 92, in run
return usecase_function(ifc_file, should_run_listeners=should_run_listeners, **settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\__init__.py", line 252, in wrapper
result = usecase(*args, **settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\pset\edit_pset.py", line 166, in edit_pset
return usecase.execute()
^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\pset\edit_pset.py", line 176, in execute
existing_props = self.update_existing_properties()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\pset\edit_pset.py", line 225, in update_existing_properties
prop = self.update_existing_prop_enum(prop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\api\pset\edit_pset.py", line 251, in update_existing_prop_enum
primary_measure_type = prop.EnumerationReference.EnumerationValues[
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'EnumerationValues'
```
Noticed working on #5596 and #5708 a few issue when pset template is changing the prop types.
E.g. prop had string data type and now template suggests that it should be a float.
Previously, it might error trying to cast a string to a float. Now it will show a float until user will set it to null, then next time it will be loaded from the template data type.
Another example - prop was a string and now it's a boolean. Previously, it would be cast to boolean implicitly. E.g. "test" -> bool("test") -> True. And if user wouldn't be paying attention then enabling pset editing and saving it would make them lose "test" value.
Now - https://imgchest.com/p/na7ke99wb78
Before - https://imgchest.com/p/5xy23rr3z4l
Basically it won't allow setting values below 0 by accident (especially important for representation item props as it may lead to a crash).
1) IfcPositiveLengthMeasure will affect bunch of props like Depth in IfcExtrudedAreaSolid.
2) IfcNonNegativeLengthMeasure will affect MaterialLayer and some profiles attributes.
As it's the quicker way to select it than searching it in outliner - https://i.imgur.com/p2NVcdR.png
Couldn't find a simpler a way to do it in UI and had to create bunch of columns. Tried to use splits but they end up readjusting the buttons.
1) Fixed non-existent tool.Blender.get_screen
2) ui.py - remove try/except for the case when tabs are not loaded yet as it's covered by BIMTabProperties
3) removed previous_tab, alt_tab props never used in ui
4) general method for getting area properties that includes BIMTabProperties automatically
I guess by accident in d443c5e I've made this method too strict and it broke get_references using it for IfcPropertySets. Maybe it's a good idea to make it more strict in the future, for now just restoring the previous behaviour.
Basically now all length ifc attributes should be displayed in UI as Blender length properties - they display the units and allow math, typing different units, etc.
Example - https://imgchest.com/p/dl7p93gz64o
Now it's stored as a collection property in the project properties, so in the most cases we delegate to Blender to ensure it's handled properly on undo and redo.
Button location - https://i.imgur.com/6zSv8vV.png
Now it's possible to "bake" openings to the geometry, The openings representation will be marked as "Reference".
Example - https://i.imgur.com/v8p4D57.png (it's ignoring walls).
Since we now filter valid elements in poll_container_obj, then there is no need to check it twice in update_container_obj.
Previously for both cardinality optional/required ifctester would show same results.
E.g.
<ids:property dataType="IFCBOOLEAN" cardinality="required">
<ids:property dataType="IFCBOOLEAN" cardinality="optional">
Were resulting in something like
LoadBearing data shall be true and in the dataset Pset_WallCommon
LoadBearing data shall be true and in the dataset Pset_WallCommon
Now it will result in
LoadBearing data shall be true and in the dataset Pset_WallCommon
LoadBearing data may be true and in the dataset Pset_WallCommon
`transition_curve.py` is now obsolete and has been removed.
A python port of IfcAlignmentHelper.cpp has also been started.
It needs further development to accommodate vertical alignment.
2024-10-26 17:06:24 +02:00
694 changed files with 30423 additions and 12934 deletions
Replace this text describing what problem occurred and what you expected to happen instead.
1. To reproduce this, open file '...'
2. Click on '....'
3. See error
**Attachments**
If applicable, add screenshots to help explain your problem. Please also drag-drop any files necessary to show the error (rename the file extension from .ifc to .txt to upload). Private files can be uploaded to https://ifcopenshell.org/upload.html - only viewed by core developers and will be deleted afterwards.
**Debug information**
If this is in Bonsai, paste the output from the Copy Debug Information option in Bonsai. It can be found under Quality and Coordination -> Quality Control -> Debug. If this is a general software issue, if relevant include details about IfcOpenShell version, operating system, Python version, etc.
Replace this text and describe a feature you'd like us to add. If it's not obvious, explain why this feature is awesome. Note that feature requests must be specific and measurable.
#3=IFCSIMPLEPROPERTYTEMPLATE('1yVWUt5H9DAOuu0OaMMLpe',$,'Scale','The scale of this drawing represented as a numerator and denominator, such as 1/100',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#4=IFCSIMPLEPROPERTYTEMPLATE('3gsuPBtU93b8f0gg1pjkq6',$,'HumanScale','The scale of this drawing in human readable format, such as 1:100',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#24=IFCSIMPLEPROPERTYTEMPLATE('0EP4WR7eb1IR$rqEJ_XRVX',$,'DPI','DPI of rasterized underlays',.P_SINGLEVALUE.,'IfcInteger',$,$,$,$,$,.READWRITE.);
#25=IFCSIMPLEPROPERTYTEMPLATE('3LHwCrOcb6Y8ozfJZ7Ay$c',$,'LineworkMode','Method to use for line work',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#26=IFCSIMPLEPROPERTYTEMPLATE('2iwERDOW55Pf4hCbuFRe1Q',$,'FillMode','Method to fill areas seen in projection',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#27=IFCSIMPLEPROPERTYTEMPLATE('1YF$qLzBzF19Io8aB2N8cE',$,'CutMode','Method for cutting geometry',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#4=IFCSIMPLEPROPERTYTEMPLATE('3q0oxMUKP47vZ4jnyG$dDb',$,'Classes','Classes separarated by spaces that end up in classes for this element in svg. Can be used to specify the text font size: small - 1.8mm; regular - 2.5mm; large - 3.5mm; header - 5mm; title - 7mm. By default regular size is used.',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
@@ -33,6 +33,6 @@ DATA;
#26=IFCSIMPLEPROPERTYTEMPLATE('0SVyOfB0rC2xNfdRYf3XvY',$,'SuppressZeroInches','Suppress 0 inch values in dimension annotation text (for example: 12'' - 0" -> 12'')',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#27=IFCSIMPLEPROPERTYTEMPLATE('2bUmj458PBqPAtUoI3MXsb',$,'TextPrefix','Text to add before annotation measurement value',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#28=IFCSIMPLEPROPERTYTEMPLATE('0bnzttUb9BPuN597uNTXOE',$,'TextSuffix','Text to add after annotation measurement value',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.