it was creating new applications and users every time `ifcopenshell.api.owner.settings.get_user` or `ifcopenshell.api.owner.settings.get_application` was called
We were incorrectly multiplying a shape matrix in SI units with a vertex in project units. We also didn't do a final check whether or not that final resultant coordinate was far away or not (for example, origin and vertex can cancel each other out)
Fix LSP warnings like ""entity_instance" is not exported from module "ifcopenshell"PylancereportPrivateImportUsage" for `ifcopenshell.file`, `ifcopenshell.entity_instance` etc.
After adding py.typed in 722201a1a it's now a typed library and all imported symbols in modules are considered private by default and should be added to `__all__` if they are supposed to be generally available from imported module.
See https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
1) we were setting OwnerHistory to the "elevation" attribute of SpatialElement (in BIMSpatialProperties.containers)
2) we were setting "elevation" attribute at all when SpatialElement doesn't have "elevation" attribute
Though those bugs were silent since PropertyGroup doesn't alarm when we add a completely new attribute to it.
Sphinx autoapi also now only shows subpackages 1 level deep. This prevents us having a huge long list. Also don't show private or special members. Also show imported members so ifcopenshell.file and ifcopenshell.entity_instance works in docs too.
previously it required to save external style attributes to preview the changes, now it's couple clicks saved if you want to preview different blender materials for your styles
Examples:
1) active shading type = EXTERNAL, now after changing it's SHADING attributes and accepting the changes, it will reload EXTERNAL shading back since it's the one that's active.
2) active shading type = SHADING, after adding EXTERNAL shader will reload SHADING style to the material.
Mentioned in #4593
The error message was (it was trying to access curves from the original mesh instead of dummy curve object):
```
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\geometry\operator.py", line 46, in execute
IfcStore.execute_ifc_operator(self, context)
File "\blenderbim\bim\ifc.py", line 349, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\bim\module\geometry\operator.py", line 169, in _execute
core.add_representation(
File "\blenderbim\core\geometry.py", line 52, in add_representation
representation = ifc.run(
^^^^^^^^
File "\blenderbim\tool\ifc.py", line 34, in run
return ifcopenshell.api.run(command, IfcStore.get_file(), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\api\__init__.py", line 172, in run
result = usecase_class(ifc_file, **settings).execute()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\api\geometry\add_representation.py", line 73, in execute
return self.create_plan_representation()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\api\geometry\add_representation.py", line 170, in create_plan_representation
return self.create_annotation2d_representation()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\api\geometry\add_representation.py", line 833, in create_annotation2d_representation
items = [self.file.createIfcGeometricCurveSet(self.create_curves(is_2d=True))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\api\geometry\add_representation.py", line 492, in create_curves
curves = self.create_curves_from_curve_ifc2x3(is_2d=is_2d, curve_object_data=dummy.data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\api\geometry\add_representation.py", line 575, in create_curves_from_curve_ifc2x3
for spline in self.settings["geometry"].splines:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Mesh' object has no attribute 'splines'
```
it was failing with something very verbose:
```
File "\blenderbim\bim\module\project\operator.py", line 1239, in execute
db = ifcpatch.execute(
^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcpatch\__init__.py", line 80, in execute
patcher.patch()
File "\blenderbim\libs\site\packages\ifcpatch\recipes\ExtractPropertiesToSQLite.py", line 137, in patch
properties.append([i, "IFC Material", f"Layer {idx + 1} Name", item.Name])
^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 197, in __getattr__
raise AttributeError(
AttributeError: entity instance of type 'IFC2X3.IfcMaterialLayer' has no attribute 'Name'
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 1239, in execute
db = ifcpatch.execute(
^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcpatch\__init__.py", line 80, in execute
patcher.patch()
File "\blenderbim\libs\site\packages\ifcpatch\recipes\ExtractPropertiesToSQLite.py", line 137, in patch
properties.append([i, "IFC Material", f"Layer {idx + 1} Name", item.Name])
^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 197, in __getattr__
raise AttributeError(
AttributeError: entity inTraceback (most recent call last):
File "\Temp\tmpdggt3syt.py", line 9, in <module>
run()
File "\Temp\tmpdggt3syt.py", line 5, in run
bpy.ops.bim.load_linked_project(filepath="/Dormitory-ARC.ifc", false_origin="0,0,0")
File "\Blender\4.1\scripts\modules\bpy\ops.py", line 109, in __call__
ret = _op_call(self.idname_py(), kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 1239, in execute
db = ifcpatch.execute(
^^^^^^^^^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcpatch\__init__.py", line 80, in execute
patcher.patch()
File "\blenderbim\libs\site\packages\ifcpatch\recipes\ExtractPropertiesToSQLite.py", line 137, in patch
properties.append([i, "IFC Material", f"Layer {idx + 1} Name", item.Name])
^^^^^^^^^
File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 197, in __getattr__
raise AttributeError(
AttributeError: entity instance of type 'IFC2X3.IfcMaterialLayer' has no attribute 'Name'
Location: \Blender\4.1\scripts\modules\bpy\ops.py:109
... truncatedUnregistered Snippets Library
BMAX Connector - UnRegistred!
An error occurred while processing your IFC.
Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 949, in execute
self.link_ifc()
File "\blenderbim\bim\module\project\operator.py", line 991, in link_ifc
self.link_blend(blend_filepath)
File "\blenderbim\bim\module\project\operator.py", line 953, in link_blend
with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to):
OSError: load: \Dormitory-ARC.ifc.cache.blend failed to open blend file
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 949, in execute
self.link_ifc()
File "\blenderbim\bim\module\project\operator.py", line 991, in link_ifc
self.link_blend(blend_filepath)
File "\blenderbim\bim\module\project\operator.py", line 953, in link_blend
with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to):
OSError: load: \Dormitory-ARC.ifc.cache.blend failed to open blend file
Location: \Blender\4.1\scripts\modules\bpy\ops.py:109
Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 870, in execute
bpy.ops.bim.load_link(filepath=filepath, false_origin=self.false_origin)
File "\Blender\4.1\scripts\modules\bpy\ops.py", line 109, in __call__
ret = _op_call(self.idname_py(), kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 949, in execute
self.link_ifc()
File "\blenderbim\bim\module\project\operator.py", line 991, in link_ifc
self.link_blend(blend_filepath)
File "\blenderbim\bim\module\project\operator.py", line 953, in link_blend
with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to):
OSError: load: \Dormitory-ARC.ifc.cache.blend failed to open blend file
Location: \Blender\4.1\scripts\modules\bpy\ops.py:109
```
it was clearing all other blender materials - e.g. blender materials associated with representation items styles. Also had the same issue with affecting extra elements as with unassigning materials
When you would unassign material (e.g. implicitly by removing the object), it might have also removed materials slots from other occurrences of the same type.
Which may had some unexpected sideffects later on - as unassigned styles saving IFC project (BBIM unassigned styles based on a assumption that it was the user decision to remove the materials and related styles).
previously every operation that would try to create owner history would fail with the error below if there wasn't IfcPersonAndOrganisation in the project.
On older numpy versions, np.ndarray was less forgiving and wasn't allowing passing 1 argument instead of required 2.
And turned out numpy doesn't yet have typing for shapes (https://github.com/numpy/numpy/issues/16544), so all matrices and other shapes specified as `npt.NDArray[np.float64]`.
Fixed type discrepancies for `get_edges` and `get_faces` and also had to fix `import_ifc` as Blender apparently has problems with storing np.int32 in custom attributes (https://projects.blender.org/blender/blender/issues/121072), tested that Blender is okay with np.int32 in other cases we had (addressing BMesh.verts[i] where `i` is np.int32).
Example:
```
import ifcopenshell
ifc_file = ifcopenshell.file(schema="IFC2X3")
# ifc_file.begin_transaction()
wall = ifc_file.createIfcWall()
wall.Identification = "25"
# Before:
# Traceback (most recent call last):
# File "test.py", line 4, in <module>
# wall.Identification = "25"
# ^^^^^^^^^^^^^^^^^^^
# File "\ifcopenshell\entity_instance.py", line 279, in __setattr__
# self[index] = value
# ~~~~^^^^^^^
# File "\ifcopenshell\entity_instance.py", line 293, in __setitem__
# method = self.method_list[idx]
# ~~~~~~~~~~~~~~~~^^^^^
# IndexError: list index out of range
# or this (if file had a transaction going)
# File "\ifcopenshell\entity_instance.py", line 279, in __setattr__
# self[index] = value
# ~~~~^^^^^^^
# File "\ifcopenshell\entity_instance.py", line 288, in __setitem__
# self.wrapped_data.file.transaction.store_edit(self, idx, value)
# File "\ifcopenshell\file.py", line 101, in store_edit
# "old": self.serialise_value(element, element[index]),
# ~~~~~~~^^^^^^^
# File "\ifcopenshell\entity_instance.py", line 283, in __getitem__
# raise IndexError("Attribute index {} out of range for instance of type {}".format(key, self.is_a()))
# IndexError: Attribute index 4294967295 out of range for instance of type IfcWall
# After:
# Traceback (most recent call last):
# File "test.py", line 4, in <module>
# wall.Identification = "25"
# ^^^^^^^^^^^^^^^^^^^
# File "ifcopenshell\entity_instance.py", line 283, in __setattr__
# raise AttributeError(
# AttributeError: entity instance of type 'IFC2X3.IfcWall' has no attribute 'Identification'
```
ifcpatch ConvertLengthUnit - change used units from plural to singular names, to make it consistent across the api
more test coverage - test converting to more units and back from them
BlenderBIM will regenerate missing SVG drawings from the IFC on demand,
now it attempts to regenerate missing SVG sheets too. ie. you can open a
bare IFC file with configured drawings and sheets and continue working.
Only drawings are recognised, spreadsheet and other SVG refs are not
regenerated, all drawings are placed at the 30,30 pixel location.
the error is below, not sure how I haven't noticed it before 🤔
assert subject.format('imperial_length(1, 1)') == "1'"
> raise VisitError(tree.data, tree, e)
E lark.exceptions.VisitError: Error trying to process rule "imperial_length":
E
E cannot access local variable 'output_unit' where it is not associated with a value
- bim.select_aggregate(select_parts=True) - selects all the host aggregates and all the parts and subaggregates within these host aggregates
- bim.select_linked_aggregates(select_parts=False) - selects all the host aggregates that are linked
- bim.select_linked_aggregates(select_parts=True) - selects all the host aggregates that are linked and all the parts and subaggregates within these host aggregates
The issue was related to the sheet names - Excel prohibits some symbols in the names and it doesn't allow sheet name to be longer than 31 symbols. If sheet names doesn't match this criteria then Excel says file appears to be corrupted - when file open data itself is not really corrupted besides the spreadsheet names that failed the criteria.
Tried to reduce amount of IFC attributes retrieved by reusing already retrieved values.
E.g. previously get_nest() was retrieving same attribute 3 times on each call, now it does it only once and it's 2 times faster (2.4 ms -> 1.2 ms).
added temporary support for old version with warnings:
WARNING. `spatial.remove_container` api method is deprecated and should be replaced with spatial.unassign_container
WARNING. `product` argument is deprecated for API method "spatial.remove_container" and should be replaced with `products`.
* Help operator in grouping and filtering Panel
Opens up a webbrowser on click
* Help button on the right of filtering panel header
* replacing os.rename() by shutil.move in ifcpatch
* removing debug print from previous commit
* Removing extra operator
Using bim.open_uri to open help page
* Update docs url
* Clean up whitespace
---------
Co-authored-by: Dion Moult <dion@thinkmoult.com>
I'd like to add CCI classification to BBIM. It is very similar to CSS, developed by CCI-C and licensed under CC BY 4.0
More details here: https://cci-collaboration.org/the-standard/
This is my first commit, I used CCS(EN).ifc file as reference. Any feedback welcomed.
and some tweaks :
- Disable possibility to edit clipping plane quad geometry
- Add select and delete operators
- Remove polls from CreateClippingPlane that prevented from using it in the Properties editor. The clipping plane is added near the origin when using the Add button in the panel
The prop update callbacks on has_underlay, has_linework, and has_annotation would edit the active object, which is not necessarily the camera. Yikes! Also, this means that when activating the drawing, it would sync references and every time it synced a reference it would attempt to sync these properties too which was slow and wasteful.
To speed up the drawing process in large projects and reduce time on syncing stage I've found that if object is already assigned to it's parent collection (both as part of blender collection and in IFC) we can skip assigning stage significantly reducing time on syncing in general (from 20-25 secs -> 9 secs).
The only thing we'll be missing in that case that object won't be unlinked from other unrelated blender collections which shouldn't break anything in the case of drawing generation.
1) stop on first parent collection
2) ensure object's own collection's parent has BIMCollectionProperties.obj during the loop
3) collector._get_collections - returns project's own collection for consistency
4) couple tweaks skipping unnecessary iterations in loops
Turned out syncing process takes too much time on large projects, so we can speed up the printing process by syncing just once. Also exposed option not to sync to operator's properties to allow debugging failing elements.
A bit related to #4500
Previously with should_setup_workspace = False it wouldn't override Blender UI scene panels and they would get mixed up with BBIM panels. After fix Blender panels are always moved to "Blender Properties" tab
before - https://i.imgur.com/bPvcAEe.png
now - https://i.imgur.com/lRUox29.png
1) if reference annotation was changed, it would reload discarding the changes
2) even if reference annotation wasn't changed it would still reload them producing noise in .ifc changes
Checking start/end dates are done very, very often in date calculations (often looping through every day in a date range). So I'd prefer more opaque code but less overhead.
The dumb clash manager has been merged in with the main clash sets window. Loading and saving clashes now also bring in clash results, so the dumb clash manager's load/save is being deprecated. New decorator highlights clash result visually.
1) core.remove_material_set were removing material set and calling material_tool.get_active_material_type()
2) material_tool.get_active_material_type() called MaterialsData which failed with the traceback below since props.materias[current_index] had ifc id that were just removed
Traceback (most recent call last):
File "\prop.py", line 96, in get_material_types
MaterialsData.load()
File "\data.py", line 43, in load
"active_styles": cls.active_styles(),
^^^^^^^^^^^^^^^^^^^
File "\data.py", line 119, in active_styles
material = tool.Ifc.get().by_id(material)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \blenderbim\libs\site\packages\ifcopenshell\file.py", line 411, in by_id
return self[id]
~~~~^^^^
File \blenderbim\libs\site\packages\ifcopenshell\file.py", line 396, in __getitem__
return entity_instance(self.wrapped_data.by_id(key), self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4619, in by_id
return _ifcopenshell_wrapper.file_by_id(self, id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Instance # 66 not found
File "\prop.py", line 94, in get_material_types
WARN (bpy.rna): C:\Users\blender\git\blender-v410\blender.git\source\blender\python\intern\bpy_rna.cc:1366 pyrna_enum_to_py: current value '2' matches no enum in 'BIMMaterialProperties', '', 'material_type'
Error was:
```
Traceback (most recent call last):
File "\blenderbim\bim\module\material\ui.py", line 43, in draw
MaterialsData.load()
File "\blenderbim\bim\module\material\data.py", line 43, in load
"active_styles": cls.active_styles(),
^^^^^^^^^^^^^^^^^^^
File "\blenderbim\bim\module\material\data.py", line 117, in active_styles
return results
File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 194, in __getattr__
raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcMaterialLayerSet' has no attribute 'HasRepresentation'
```
Previously it was failing with
File "\ifcopenshell\geom\main.py", line 119, in __init__
self.this = initializer(
File "\ifcopenshell\ifcopenshell_wrapper.py", line 2467, in construct_iterator_with_include_exclude
return _ifcopenshell_wrapper.construct_iterator_with_include_exclude(settings, file, elems, include, num_threads)
TypeError: Attribute of type AGGREGATE OF STRING needs a python sequence of strs
1) avoid selecting elements of the same type multiple times
2) iterate over occurrences of the type rather than visible objects, as it's usually smaller amount of objects
it couldn't find linked collections and scenes since it was comparing `filepath` from `props.links` (.ifc file) and collection.library.filepath (which is .blend file)
Example - https://imgur.com/a/phPcKSo
Appending ifc elements from library files will be deprecated as it's much more limited than appending it from linked files (in library you can only see object's name).
* fixed qsets to display separately
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
* updated data.py and run black formattor
---------
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
If current representation didn't had any styles, only a material and it was failing during `assign_material_slots_to_faces` since it was looking for blender material only in self.styles and not in self.materials.
Note: `assign_material_slots_to_faces` is not skipped since `parse_representations` returns `True` because other representation has a style and it's added to the materials.
1) Excluded annotations from other drawings that user might accidentally include in IfcAnnotation
2) Excluded from EPset_Drawing.Include to avoid getting there other element types besides spaces
It's added as alt+v hotkey in Spatial Tool
Now it's possible to combine it with bim.load_project_space_boundaries to show decorations for all the boundaries or to keep the boundaries after Alt+B and just disable the decorations.
example - https://imgur.com/a/ecbPz13
BBIM is being used in companies as ways to automate various BIM processes, and it ends up being such that Blender Python becomes their dev environment.
since we don't use `file.add` to add inverse items and we use `file.create_entity` it was duplicating new elements, added optional parameter that makes it possible to track already added relationships between `append_asset`s.
Fix proposal for # 3515
OK I've deleted the unnecessary commented lines and left the option that feed only the description tooltip.
BTW, I have 2 questions i would like to ask you
1. about comment, i noticed there are not many comments in the code. I understand it is deliberate choice of design, is it ?
I usually comment a lot inside the code sometimes simply to order my thoughts and remember what the code is intending to do when i come to it later on.
I understand it is better not to leave unneccessary lines like here, but in general, do you prefer me to avoid comments when writing in blenderbim ?
2. As i'm in a discovering phase, I would like to feed some other bl_description operators to provide some additionnal inline information instead (undocumented operator) , is it something you planned or can i go for it. I could simply add the bl_description in each one i find while reading code and testing app.
Thank you for your kind help. and G'day !
issue occurred with ifcpatch ExtractElements - it was adding project from other ifc file (with the contexts) and then adding some elements from it using `append_asset`. During `append_asset` it was considering existing context with the duplicated one and was partially purging it.
Added new experimental section that allows you to cut objects based on current clipping planes in the scene. The difference from other clipping plane methods - it actually (temporarily) edits meshes geometry and adds cappings at the cut. So, the clipped meshes can be seen both on render and cutted parts won't get in the way as they do with temporary section cutaways (shader based method)
Example - https://imgur.com/a/SOqovOM
bim.reassign_class wasn't considering that root.reassign_class will also reassign class for occurrences of the same type and was reaccessing invalid elements
* initial ui
* changed the group name
* groups counter in ui
* added operators for selection and breaking link in the ui
* small removal
* changed IFC operators to _execute
* added simples linked aggregate test
* small fix in remove_old_connections function
* added test for refresh linked aggregate
* refresh linked aggregates now preserves the objects original name
* small fix in recreate_connections function
* tests for Refresh Linked Aggregate
* test for Refresh Linked Aggregate after copying an object
* small deletion
* added custom incremental naming
* small fix in tests
* small fix on the number for renaming
as probably in the most cases user would want 1 style per 1 representation item
After this it's finally possible in BBIM to assign styles to representation items through the materials: https://imgur.com/a/cgiJ1KV
Example - https://i.imgur.com/Mk6mkuP.png
E.g. alt-click now opens .ifc directory and shift-click opens .ifc with default software associated with .ifc files.
Should be cross-platform but tested only on Windows
Added this code to tool.Blender so it can be reused for other operators invoking file browsing window.
If multiple object placements were reusing the same IfcAxis2Placement then editing one of them would remove IfcAxis2Placement ignoring it's inverse references making all other object placements invalid.
Noticed that `file.addRelatedObject<IfcSchema::IfcRelDefinesByType>(door_style, door);` was resulting in list with `door` assigned as RelatingObject and `door_style` assigned as RelatedObjects.
error was:
File "\site-packages\ifcpatch\__init__.py", line 78, in execute
patcher.patch()
File "\site-packages\ifcpatch\recipes\MergeDuplicateTypes.py", line 73, in patch
self.assign_type(element, original_type)
File "\site-packages\ifcpatch\recipes\MergeDuplicateTypes.py", line 114, in assign_type
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": types[0]})
^^^^^^^^^^^^^^^^
AttributeError: module 'ifcopenshell' has no attribute 'api'
The warning was:
```
CMake Warning (dev) at CMakeLists.txt:299 (find_package):
Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
variables. Run "cmake --help-policy CMP0144" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
CMake variable BOOST_ROOT is set to:
\IfcOpenShell\_deps\boost_1_74_0
For compatibility, find_package is ignoring the variable, but code in a
.cmake module might still use it.
```
deprecation warning:
CMake Deprecation Warning at CMakeLists.txt:20 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
issue was mentioned in #2524 and resulted in error below trying to build boost dependency
```
'.\b2' is not recognized as an internal or external command,
operable program or batch file.
```
Made some changes to svg serialization code by moving chunks of code so `.generate_linework()` will be easier to read
- moved gathering linework contexts to a separate method
- moved common code for elements serialization to a function
- replaced self.yield_from_iterator(it) with it.__iter__
Functionally code is exactly the same.
Created IFC library with simple trees, shrubs and hedges - with both 2d and 3d representations. Example - https://i.imgur.com/pOjh1si.png
Now it's available along with the furniture library when creating new project - https://i.imgur.com/Ho0B5Gn.png
We can do that since In our workflow we won't be converting translations.py to .po files, that way it will be much shorter as it's containing only translated strings and doesn't have strings sources.
Added "Upgrate to IFC4X3" button on loading new projects to migrate them to IFC4x3 as Ifc4x3 got approved now will be used more widely.
https://i.imgur.com/mHSIV7T.png
Noticed it was resulting in error below migrating to IFC4X3 in some cases as we don't have a mapping for IFC4X3 yet.
```
if value is None and not attribute.optional():
UnboundLocalError: local variable 'value' referenced before assignment
```
The way blender gather messages to translate is:
1) disable the addon
2) parse all available strings
3) enable the addon
4) parse all strings available strings again and subtract the ones gathered at step 2.
But due Blender bug (https://projects.blender.org/blender/blender/issues/116579) not all addon parts unregistered at step 1, so some addon's strings left out and gathered at step 2 and then subtracted at step 4. At the end, we loose them and they will be missing from resulting translations files.
I've monkey patched dump_addon_messages so it now works a bit more safe:
0) It expects addon to be disabled and Blender restarted after
1) Gather all Blender strings
2) Enable addon
3) Gather all Blender strings again and subtract strings from step 1.
E.g. if you had some container selected in `active_container_id` and then it got deleted UI would break and won't allow to reload the spatial manger until you reload .ifc completely
* Refactor boundary creation to allow usage in a loop.
* Loop through all building element in building storey instead of stopping to the first one
* Enforce checking to prevent creation of invalid boundary geometries
# Inner boundaries
Some software or workflow generates many opening for the same element (eg. window) so it is not relevant to create inner boundaries for opening with no filling.
# Boundary name
Apply convention for 1st and 2nd Level boundaries
E.g. if you load a project and try to rename some element to "test" it will renamed to "test" instead of "IfcWindow/test" e.g.
Since we relid on `obj.name` handler to set `.is_renaming` back to `False`, it didn't set it back to False when project was just loaded and renamed object was not yet linked to ifc element and name handler is not yet setup.
Another option was to check whether object is linked before changing `is_renaming` but just setting it to False should be more more explicit.
When pushing to a remote repository set tracking for the current branch
so that a locally created repository behaves the same (on the
command-line) as a cloned repository
- removed redundant notion about saving .blend file
- relative paths were saved incorrectly
- fix issue using "bim.browse_external_style" if IfcSurfaceStyle already has external style and it's either .blend file or material in it is missing (it was failing opening file browser)
Previously overridden scene panels were removed but original panels were not restored.
Also added condition check for Blender version to generate list of panels to override, so we won't miss any errors using `try - except`.
also fixed the issue with default scene panels that were parented to other panels - because we didn't change `bl_parent_id` the panel structure for them was broken.
In #4081 reported the case when during redo (changing param in operator's popup) `Ifc.rebuild_element_maps` was relinking elements without discarding possible linked blender libraries. It end up accidentally linking some library's objects to the current Ifc file leading to errors.
Also fixed possible similar issue in couple other places.
Moved all shading style and textures parameters from shader-graph N-panel to general Styles UI. Shader graph now also update in real time on any prop changes in Styles UI.
Now there is practically no need to switch to shader graph to edit styles shaders - all parameters are available from the Styles UI. That also allows you to edit styles and see the results in viewport even if the edited style is not the one that's currently active.
small demo - https://imgur.com/a/i2suoZw
1) it was failing adding a new IfcSurfaceStyle if surface_style_class != Shading/Render as surface_style was not defined
2) It was never creating render material as IfcSurfaceStyleRendering class is a child of IfcSurfaceStyleShading and if statement never got to the is_a("IfcSurfaceStyleRendering") check
Texture path file dialog is also filtering image files now.
Removed subtype from `FILE_PATH` from all related props since `layout.prop()` for those props starts file dialog that cannot return path relative to .ifc. It can return path relative to .blend - though it can be processed in props update to convert to relative to .ifc, this doesn't allow setting relative paths if .blend is not saved. Therefore, I've created a separate operator.
add
Previously you could only create branches by checking out an older
revision, making changes and committing it. This was an annoyance as
typically you are making changes to the HEAD of a branch, then you
realise this should have been a branch - now you can create the branch
on commit (#3096)
This reverts commit 7828508179.
Turned out when I was assuming `bim.add_style` is assigning the style but it wasn't, it was `bim.update_representation` on the file save. So basically during the session style wasn't assigned, therefore I added back explicit style assignment. 😬
because pset wasn't removed BBIM was recognizing those elements as parts of an array resulting in issues during deletion and duplication. This issue is a regression after ec4f0e5, the root problem was that `keep_objs` wasn't working with `sync_children`.
Since `keep_objs` was used only for applying array layers I've replaced it with `array_layers_to_apply` that works for both `sync_children` = True and False.
https://community.osarch.org/discussion/1831/duplicating-failed-for-array-items-after-apply-array
Minor fixes to use view_layer.object.active etc instead of context.active_object when running via Blender UI (it seems when you run the patch recipe from the Blender UI at least in later versions, context does not have an "active_object" property.
it's very limited and covering very little cases now. It works only for IfcPolygonalFaceSets representations that consists of triangles.
Short example - https://imgur.com/a/1AxunSN
- fixed a typo in bim.select_by_style
- added note to clarify what Shade/Render/Texture/Lighting/etc buttons do and moved style selection block at the beggining (maybe it's just me but when edit buttons are above selection ui it seemed like they affect all the styles somehow, not just the currently active one), so it will be more intuitive
Before:
https://i.imgur.com/jRSTLGI.png
After:
https://i.imgur.com/8ih4qSX.png
Now you can set UV mode that will be used to sample textures (previously it was always using UV data on geometry or breaking if it was otherwise). Basically now you can use autogenerated UV for the objects without UV.
https://i.imgur.com/WtYdpmU.png
Removed BIMMaterialProperties.ifc_coordinate_id as it was only used during the ifc_import and maintained by the `Loader.create_surface_style_with_textures` which is also used to update live shader graph that not always have specific IFC id for the UV.
Warning is:
/usr/lib64/python3.12/site-packages/ifcopenshell/api/project/create_file.py:61:
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version.
Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
Previously it was throwing errors if load .bcf and then restart Blender, since it was just trying to reaccess file in BcfStore.bcfxml which is gone after Blender restart. Now we store filepath to bcf in Blender properties to reload it after Blender restart.
Removed BCFProperties.is_loaded as it won't be possible to rely on it after Blender restart - after restart it will still indicate that file is loaded and it won't be possible to change it from .poll and .draw if file is gone.
When PredefinedType is not found in the related enum reassign_class is considering it USERDEFINED and trying to set .ObjectType. The problem was it was doing for type classes also, when it should have set .ElementType instead.
Why it crashed BlenderBIM - in IfcClassData.data["has_entity"] we store currently active IFC entity which is recreated during `ifcopenshell.util.schema.reassign_class` making old entity invalid. Since `root.reassign_class` was failing in the process, related BBIM operator was failing too, IfcClassData wasn't updated and removed entity was accessed from UI leading to crash.
- error in settings poll message for bim.assign_selected_as_product
- test that drawing.assign_product won't create new assignments for the same product
Also:
- fixed bug with bim.mep_connect_elements not considering actual blender blender object's position
- moved syncing ifc position with blender object position to tools (sync_object_ifc_position)
- fixed a bug in adding a bend that occured if either any of the start/end points of the start/end segments matched - in that case one of the segments end up not connected to the bend
In case if some element (not another aggregate) was aggregated by IfcProject directly, importing IFC was resulting in error below since the project's collection was never added to `self.collections`.
Traceback:
```
File "\scripts\addons\blenderbim\bim\module\project\operator.py", line 732, in execute
ifc_importer.execute()
File "\scripts\addons\blenderbim\bim\import_ifc.py", line 292, in execute
self.place_objects_in_collections()
File "\scripts\addons\blenderbim\bim\import_ifc.py", line 1668, in place_objects_in_collections
self.place_object_in_collection(self.file.by_id(ifc_definition_id), obj)
File "\scripts\addons\blenderbim\bim\import_ifc.py", line 1672, in place_object_in_collection
self.place_object_in_decomposition_collection(element, obj)
File "\scripts\addons\blenderbim\bim\import_ifc.py", line 1689, in place_object_in_decomposition_collection
return self.collections[aggregate.GlobalId].objects.link(obj)
KeyError: '2bKVb8E7L6e89EQYJUk8BM'
```
Noticed the issue adding IfcFurnitureType in IFC2x3
```
Traceback (most recent call last):
File "\Blender\4.0\scripts\addons\blenderbim\bim\module\model\workspace.py", line 71, in draw_settings
BimToolUI.draw(context, layout, ifc_element_type="all")
File "\Blender\4.0\scripts\addons\blenderbim\bim\module\model\workspace.py", line 230, in draw
AuthoringData.load(ifc_element_type)
File "\Blender\4.0\scripts\addons\blenderbim\bim\module\model\data.py", line 56, in load
cls.data["predefined_type"] = cls.predefined_type()
File "\Blender\4.0\scripts\addons\blenderbim\bim\module\model\data.py", line 258, in predefined_type
predefined_type = relating_type.PredefinedType
File "\Blender\4.0\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 191, in __getattr__
raise AttributeError(
AttributeError: entity instance of type 'IFC2X3.IfcFurnitureType' has no attribute 'PredefinedType'
```
It was providing project units to `geometry.add_slab_representation` resulting and then they were converted to project units once again during `geometry.add_slab_representation`.
data.py doesn't update on every undo, so passed blender objects got invalidated on undo resulting in errors. changed blender objects to blender object names
The problem with that attribute was that object's and project's group ui section were both using groups loaded to BIMGroupProperties.groups.
So you could run into situation when you try to load object's groups ui and it would show empty list because user never loaded the groups from the project's ui...
So it was either caching groups twice or just using same `is_editing` flag to check whether groups were previously loaded and I went with the single flag.
Hi,
I noticed an issue and suggest a fix:
Unit names from <si_conversions> are all lowercase, whereas project units extracted from the IFC files with <get_project_unit(...).Name> are uppercase. So the convert function didn't seem to work properly.
Hope this helps!
The warning was: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
No need to click on "OK" anymore.
This is not a hacky workaround using the mouse position, it uses a signal sent to Blender to close the active popup
See https://blenderartists.org/t/programatically-close-pie-menu-2-79/1488807/2
re-committing since it seems I commited to the wrong branch last week
Used to get errors running setup_pytest.py having python 3.10 installed on my pc (`sys_paths[-1]` was the system's python folder, not the blender's python).
basically now "edit profile" will be shown in BIM Tool UI and will work from shift+e hotkey if the active element's representation is mapped (for example, if it has openings)
The cool thing about it now that it will automatically create a new mesh for "unresolved" representation if element has openings, otherwise it'll stick to the same mesh representation as the type object.
This fixed a few bugs:
- similar to b9a9abd but during extrusion profile edit
- applying void to the occurence used to remove the type and other occurences. Apparently it occured after 744c08e - previously we seems to rely on `ifcopenshell.geom.create_shape(settings, element)` to unresolve the representations. Though before 744c08e there still was an issue - it would apply the same opening to the all occurences and the type meshes but wasn't removing them.
Probably fixed a few other similar issues.
I've found a bug that if you have some object that consists of extrusion and can be edited in profile edit mode, when you finish editing, it would remove the type object (and I guess the other occurences objects).
It happened because during edit mode it's using temporary mesh data and `switch_representation` would replace this temp mesh data with new representation and remove the old mesh data that might still used by the other occurences and the type.
The issue also was leading to a crash during `box.template_icon(icon_value=AuthoringData.data["type_thumbnail"], scale=5)` if you had BIM Tool thumbnail preview opened in the process - removing type object would make thumbnail icon become invalid leading to the crash.
Crash mentioned here: https://community.osarch.org/discussion/1753/bbim-two-door-types-with-connected-properties
Now it's possible to set in UI active system (currently it's done "select" button next to the system).
Also changed the elements that are going to be decorated with system decorator. Previously it was decorating all the mep elements in the projects which was very performance heavy on large projects.
Now stairs have should_add_representation=False when creating the IfcStairFlight, and the representation is updated explicitly, similar to how parametric doors and windows etc have their representations updated.
After d67eae5 delete_ifc_object is removing the meshes and it end up invalidating the unlinked object. Now mesh is copied before running delete_ifc_object
In IFC2X3 IfcZone is a subtype of IfcGroup but not subtype of IfcSystem (it become one after IFC4), therefore IfcZone wasn't presented anywhere in BBIM UI.
It's a bit confusing though to include IfcZone in systems when it's not actually a IfcSystem but having it in IfcGroups would be confusing too.
It was throwing an error because was failing to write a list to an excel cell, now it's explicitly converting the value to string.
Python: Traceback (most recent call last):
File "\blenderbim\bim\module\fm\operator.py", line 102, in execute
writer.write_xlsx(filepath)
File "\blenderbim\libs\site\packages\ifcfm\__init__.py", line 259, in write_xlsx
cell = worksheet.cell(row=r, column=c, value=col)
File "\blenderbim\libs\site\packages\openpyxl\worksheet\worksheet.py", line 247, in cell
cell.value = value
File "\blenderbim\libs\site\packages\openpyxl\cell\cell.py", line 218, in value
self._bind_value(value)
File "\blenderbim\libs\site\packages\openpyxl\cell\cell.py", line 187, in _bind_value
raise ValueError("Cannot convert {0!r} to Excel".format(value))
ValueError: Cannot convert ['USE TYPE CATALOG'] to Excel
previously it was switching to the first representation that matches the context, so it wasn't possible to switch to the second one if you had more than 1 representation in the same context
using always both element and representation in `geometry.import_representation` so it will import the exact representation and not the first one found by `ifcopenshell.geom.create_shape`
If there are multiple representations in the same subcontext, when it was searching for the representation for some specific subcontext, it would previously always switch to the first representation from the list, now it's going to prioritize the one that's already active.
Currently it allows only to either set all object's booleans to be marked as manual or all of them marked as automatic, can't change some specific boolean.
Short demo - https://imgur.com/a/bczv35N
Also fixed a bug adding boolean when pset is already added and representation type in add_boolean
```
File "\addons\blenderbim\tool\ifc.py", line 201, in execute
IfcStore.execute_ifc_operator(self, context)
File "\addons\blenderbim\bim\ifc.py", line 336, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "\addons\blenderbim\bim\module\model\opening.py", line 534, in _execute
data = json.loads(pset["Data"])
File "\addons\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 248, in __getitem__
if key < 0 or key >= len(self):
TypeError: '<' not supported between instances of 'str' and 'int'
```
replaced shapebuilder with general ifcopenshell code in `test_add_boolean` (the only place besides `test_shape_builder` where it was used), that way mathutils dependency in tests is localized only to `test_shape_builder.py`.
added test-safe option to makefile, so github workflow would ignore `test_shape_builder` tests for now and it wouldn't interrupt the entire workflow
The error was
Traceback (most recent call last):
File "\blenderbim\bim\module\model\covering.py", line 64, in poll
return element.is_a("IfcCovering")
AttributeError: 'NoneType' object has no attribute 'is_a'
added test that model.get_manual_booleans will ignore IfcBooleanClippings until we find some other solution to distinguish automatic and manual clippings. And some refactor along the way.
It wasn't detecting extrusion as part of IfcBooleanResult and was using default wall data as fallback.
Occured after 0044ef5
Solves #3831
Related to #3709
Added new operator bim.flip_object that flips the object by flipping two of its axes and keeps the original placement.
Currently it can be found either from F3 search or from Shift-F hotkey for IfcBeam and IfcColumn in BIM tools.
Previously it was conflicting with other possible groups assigned to the object. It's now even more important since we're actively using groups to save search queries.
Example error caused by this issue - during drawing activation if you had 2 IfcGroups on the drawing element:
draiwng's IfcGroup RelatedObjects attribute was updated, then inverse attrtibute `drawing.HasAssignments` order was updated too (DRAWING IfcGroup now would be positioned second after IfcGroup for search query) and it was leading to errors during filtering current drawing annotations
It wasn't passing the exclude_callback if attribute of the copied element wasn't a tuple, resulting in duplicated named profiles in case if you'd copy a IfcBooleanClippingResult #3810
For example, how copy_deep of IfcProductDefinitionShape with boolean clipping previously would work:
V IfcShapeRepresentation - copied with exlude_callback (part of .Representations[])
V IfcBooleanClippingResult - copied with exlude_callback (part of .Items[])
X IfcExtrudedAreaSolid - copied without exlude_callback becuase it's part of .FirstOperand (not an array) and we have IfcIShapeProfileDef duplicated
Case without booleanclippings:
V IfcShapeRepresentation - copied with exlude_callback (part of .Representations[])
V IfcExtrudedAreaSolid - copied with exlude_callback, since it's part of .Items[], IfcIShapeProfileDef not duplicated
Added to Purge Data section in Quality Control some tools - https://i.imgur.com/Nz3YoiH.png
1) Print unused elements - useful to investigate how much unused data you have in IFC file.
https://i.imgur.com/9Fkn0JD.png
2) purge unused elements by ifc class, it's doing it in pretty naive way and can be dangerous, so maybe it should be moved to debug section.
Error was:
TypeError: EnumProperty(..., default='cobie'): not found in enum members
Exception in module register(): \3.6\scripts\addons\blenderbim\__init__.py
Traceback (most recent call last):
File "\Blender\3.6\scripts\modules\addon_utils.py", line 369, in enable
mod.register()
File "\3.6\scripts\addons\blenderbim\__init__.py", line 42, in register
blenderbim.bim.register()
File "\3.6\scripts\addons\blenderbim\bim\__init__.py", line 190, in register
bpy.utils.register_class(cls)
ValueError: bpy_struct "BIMFMProperties" registration error: 'engine' EnumProperty could not register (see previous error)
Decoration data is now updating in live time, caching some parts in Data for performance. Real time update is needed because Data doesn't allow update on objects positions change and later will need real time update for viewport orientation data.
Now OverrideDuplicateMoveLinked allways will be in sync with OverrideDuplicateMove.
Also fixed the issue when DuplicateMoveLinked for non ifc elements worked the same was DuplicateMove (it was copying mesh data when it's not suppose to).
I think there is still some space to improve but it should cover the main problem with need going to array section to remove it
Demo - https://imgur.com/a/9Z3t5Q8
Traceback:
```
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\pset\operator.py", line 103, in execute
self.load_from_pset_data(pset)
File "\blenderbim\bim\module\pset\operator.py", line 226, in load_from_pset_data
value = prop.NominalValue.wrappedValue
AttributeError: 'NoneType' object has no attribute 'wrappedValue'
```
All it does currently it draws all MEP elements connections in viewport. It also highlights with green color all elements connected to the active object
Demo - https://imgur.com/a/haAQeWt
now it's getting parent guid from the currently active object, not from provided guid argument - so now it's possible to add those operators to quick favorites
Buttons located in addon preferences - https://i.imgur.com/Unp4P9L.png
Just waiting for this to break somehow...
It's not completely automatic now and it doesn't create assign special icon for IFC files yet.
Noticed a couple hundreds of orphaned IfcPropertyEnumeration in my .ifc like below 😁
IFCPROPERTYENUMERATION('Status',(IFCLABEL('NEW'),IFCLABEL('EXISTING'),IFCLABEL('DEMOLISH'),IFCLABEL('TEMPORARY'),IFCLABEL('OTHER'),IFCLABEL('NOTKNOWN'),IFCLABEL('UNSET')),$);
For example, there was a fitting from segment of type A to the segment of type B with start/end transition lengths equal a/b respectively.
And then if you'd try to create a transition from B to A and start/end transition lengths being equal to b/a, previously BBIM wouldn't be able to find that already existing fitting is still compatible.
Added operator to replace currently selected objects with occurences of the chosen type. I kept doing this from the code and thought it could be generally useful.
It's working pretty naive now and just replacing objects with occurences preserving the original transform (location/rotation/scale), nothing else is preserved.
Demo - https://imgur.com/a/qm8a6Ns
PS Hopefully I'm not reinventing the wheel and not missed some other similar operator
Also noticed in Sigma Dimensions video that every time user deletes a storey or applies new elevation the selection was jumping to the first storey. Now it's going to be more natural.
Before - https://imgur.com/a/gbn7ryQ
After - https://imgur.com/a/QX2RulF
Search for compatible fitting wasn't taking into account that maybe fitting used for the same segments but fitting's parameters are not the same (such as start_length, end_length, angle and offset between profiles).
I also forgot to promote transition angle to operator's property😬
Error traceback is below - it was trying to set IfcExtrudedAreaSolid.Position to None when in IFC2x3 Position wasn't optional, so now in IFC2X3 it's going to have some default position
RuntimeError: Error: Python: Traceback (most recent call last):
File "\bim\module\model\product.py", line 123, in execute
return IfcStore.execute_ifc_operator(self, context)
File "\bim\ifc.py", line 336, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "\bim\module\model\product.py", line 148, in _execute
if self.generate_layered_element(ifc_class, relating_type):
File "\bim\module\model\product.py", line 274, in generate_layered_element
obj = slab.DumbSlabGenerator(relating_type).generate()
File "\bim\module\model\slab.py", line 143, in generate
return self.derive_from_cursor()
File "\bim\module\model\slab.py", line 147, in derive_from_cursor
return self.create_slab()
File "\bim\module\model\slab.py", line 179, in create_slab
representation = ifcopenshell.api.run(
File "\libs\site\packages\ifcopenshell\api\__init__.py", line 66, in run
result = usecase_class(ifc_file, **settings).execute()
File "\libs\site\packages\ifcopenshell\api\geometry\add_slab_representation.py", line 42, in execute
[self.create_item()],
File "\libs\site\packages\ifcopenshell\api\geometry\add_slab_representation.py", line 58, in create_item
extrusion = self.file.createIfcExtrudedAreaSolid(
File "\libs\site\packages\ifcopenshell\file.py", line 337, in create_entity
e[idx] = arg
File "\libs\site\packages\ifcopenshell\entity_instance.py", line 260, in __setitem__
self.wrapped_data.setArgumentAsNull(idx)
File "\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4929, in setArgumentAsNull
return _ifcopenshell_wrapper.entity_instance_setArgumentAsNull(self, i)
RuntimeError: Attribute not set
It will make sure you'll be able to see the project's elements in viewport when it's loaded (same way as if you'd select all objects and hit "Numpad .").
Couldn't find any way to make it work without enablging / disabling selection - https://projects.blender.org/blender/blender/issues/112141
Added operator to create bend fittings between objects, it's still work in progress and now it only supports rectangular profiles.
Small demo - https://imgur.com/a/vM7hnJa
- Refresh viewer now reloads both screens by default
- Rename "add_namespace" to "add_brick_namespace"
- Fix error where "view_brick_class" was run instead of "brick.run_view_brick_class"
- Data is now stored regularly and parsed in props
- "get_convertable_brick_spaces" returns a set
- "export_brick_attributes" always returns a tuple of strings
For one particular, I removed "And I set 'scene.BIMRootProperties.new_brick_relation_type' to 'hasPart'". Although it should really be "https://brickschema.org/schema/Brick#hasPart" to begin with, it was still failing the test. So removing it as a work around.
If transition was really long comparing to segments length then DumbProfileJoiner.join_E would start change their their length in unexpected way - ATSTART when you'd still expect ATEND and vice versa.
Also fixed the bug when segments length was incorrectly calculated - it wasn't calculating it world space when it makes more sense here to calculate it by local segments Z axis.
- Adding/removing and edit productivity data is now easier (+ cleaner UI)
- Pressing calculate schedule work on a parent resource will default to calculating its nested resources schedule work.
- Show derived Schedule Work for a parent resource
- Improve apperance of Resource Tree Structure
Had this idea for awhile now and heard it multiple times from other people. Please give feedback if this feature gets in the way instead of helping.
Example - https://imgur.com/a/K4hz2FB
Previously when you renamed blender object it was requiring the "Ifc.../" prefix so it would also change the name for ifc element. So when you wanted to rename something you'd only select and change the name part without prefix.
Now you can just type the name right in after using F2 which seems a bit quicker by a few less clicks.
Before - https://imgur.com/a/Rn7a17W
After - https://imgur.com/a/a3lmxte
The problem was that bim.update_representation was assigning representation styles without taking into account that some styles may not be actually used in the mesh, so it was always assigning first style (blender material) to the first IFCPOLYGONALFACESET even though it might be using for example the 3rd style.
More - https://community.osarch.org/discussion/1636/materials-not-remembering-their-assigment
Remove line separation between code, but add comments
Add full URI to Brick relations
Fix typo where "system_uris" was written as "space_uris"
Remove unnecessary get of "distribution_elements = brick.get_convertable_brick_elements()" again
Now it's possible to identify blenderbim version from .ifc file which is useful for debugging
Example:
FILE_NAME('test.ifc','2023-08-22T18:07:07+05:00',(),(),'IfcOpenShell v0.7.0-fc50bdd3a','BlenderBIM 0.0.999999-64bc7af','Nobody');
Basically there are 3 methods to define the transition angle (https://i.imgur.com/AtCIJty.png). Before we supported only the second method, now we support 1 and 3 too.
- support transitions from and to circle profiles
- reworked transition length algorithm now it should be more accurate
- added support for creating transitions between profiles that are parallel but not collinear
1) It would stop if the first occurence would be connected to a segment without type
2) It would raise an error if one of the fitting's ports was not connected.
It was producing a bug with text rotation in elevation view
Added fix to make matrix normalization work for the cases when matrix is rotated and I've just found that mathutils.Matrix.normalize(d) is very conveniently ignoring 4th column (translation) (same for mathutils.Vector)
Also simplified create_text_tag a bit - now it adds fill_bg by just by copying text tags and adding fill_bg filter to them instead of going through the entire logic again.
- Important for Ifc External References and other data.
- Set predicate_uri of predicates of the Bnode to None, which is used to remove the ability to delete the relationship in the UI.
- Also added try/excepts to difficult edge cases such as the object_uri not having a "#" character in it (such as "<http://qudt.org/vocab/unit/>") and the object_uri not being a brick class, which breaks "view_brick_item".
- Removing a Bnode type from the entity's relation removes all relations of the Bnode also
Change from never show the operator if the relation is "type" to not showing it only if the "type" is the current class being viewed.
This may come in handy if other list views other than hierarchy are implemented.
It also implies why we don't want to show "view brick item" here: because we already viewing it.
It was producing orphaned IfcLocalPlacement if placement was parent to some other one. During edit_object_placement we were replacing all parent references with the new placement but wasn't removing the old one.
This means that if you created a curve body, you couldn't switch to it, or if you deleted everything, you ended up with an empty object. If you then tried to switch to that, it would "sync" the empty object and leave you with an empty cartesian point list. E.g:
1. Create cube and assign IFC element.
2. Remove all faces only (leaving edges and verts). Save changes.
3. Switch to representation (bug!)
4. Delete everything (no verts, edges, or faces). Attempt to save.
5. "Revert" switch will fail, leading to empty mesh.
6. Manually try to switch. Empty mesh will sync, creating an empty point list.
Turned out there are ODS files (and turned out we're producing them ourselves from ifccsv) where column styles are not defined and therefore no width/style assigned to each column which was resulting in errors on building schedule.
Now, instead of trying to be clever and regenerating filling locations and opening types, we simply copy the existing scenario. This also means it'll be more stable for weird fillings coming from proprietary apps.
Basically commented out automatic adjustment after 45f81b478 - now it's hapenning only when you decide to regenerate it.
It's adjusting connected segments extrusion and location, for all other elements besides segments it's adjusting only location. The idea is it will try to change as less as possible.
Demo - https://imgur.com/oZ1I2Bl
Created more UI for ports.
Now you can see the list of ports from UI and what objects they are connected to, you can quickly select any ports/connected objects or disconnect objects.
From port UI you can see what object's it located on and what object it's connected to and quickly jump across them.
Demo - https://imgur.com/a/Gu4Vz7V
Added simple operator to add transition between two mep segments (now only rectangular collinear segments are supported).
It also reuses the transition type that was previously used to connect segments of the same type.
Demonstration - https://imgur.com/a/c1AOxj1
IfcOpenShell is an open source ([LGPL]) software library for working with Industry Foundation Classes ([IFC]). Complete
parsing support is provided for [IFC2x3 TC1], [IFC4 Add2 TC1], IFC4x1, IFC4x2, and IFC4x3. Extensive geometric support
parsing support is provided for [IFC2x3 TC1], [IFC4 Add2 TC1], IFC4x1, IFC4x2, and [IFC4x3 Add2]. Extensive geometric support
is implemented for the IFC releases [IFC2x3 TC1] and [IFC4 Add2 TC1]. Extending with support for arbitrary IFC schemas
is possible at compile-time when using C++ and at run-time when using Python.
In addition to a C++ and Python API, IfcOpenShell comes with an ecosystem of tools, notably including IfcConvert (an application to convert IFC models to
other formats), the BlenderBIM Add-on (an add-on to Blender providing a graphical IFC authoring platform), and many
other libraries, CLI apps, and more. Support is also provided for auxiliary standards such as BCF and IDS.
In addition to a C++ and Python API, IfcOpenShell comes with an ecosystem of tools, notably including IfcConvert (an application
to convert IFC models to other formats), the BlenderBIM Add-on (an add-on to Blender providing a graphical IFC authoring platform),
and many other libraries, CLI apps, and more. Support is also provided for auxiliary standards such as BCF and IDS.
| Sponsor development on OpenCollective | [](https://opencollective.com/opensourcebim/) |
This means that there is no IfcStyledItem associated to the representation items and that the element does not have an IfcMaterial association with IfcMaterialRepresentation from which we can derive a style (colour) for the element.
The interactive session below shows how with this setting enabled you will get a default generated material from the IFC element entity type and material indices of 0 pointing to that. With this setting disabled the material index would be -1 to indicate a missing style. Note that there is one material index for every triangle in the list of `shp.geometry.faces`.
>>> import ifcopenshell, ifcopenshell.geom
>>> f = ifcopenshell.open("Duplex_A_20110907_optimized.ifc")
>>> s = ifcopenshell.geom.settings()
>>> c = f["3bXiCStxP6Fgxdej$yc50U"]
>>>
>>> shp = ifcopenshell.geom.create_shape(s, c)
>>> shp.geometry.material_ids
(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)
>>> [(m.name, m.diffuse) for m in shp.geometry.materials]
[]
>>>
>>> s.set(s.APPLY_DEFAULT_MATERIALS, True)
>>> shp = ifcopenshell.geom.create_shape(s, c)
>>> shp.geometry.material_ids
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
>>> [(m.name, m.diffuse) for m in shp.geometry.materials]
[('IfcCovering', (0.7, 0.7, 0.7))]
This is enabled by default for the IfcConvert serializers as they will not gracefully handle -1 material indices and allows users to quickly assign colours based on entity types in their modelling applications.
APPLY_LAYERSETS
---------------
This setting is available in IfcConvert as `--enable-layerset-slicing`.
For IfcWall and IfcSlab elements, takes the associated IfcMaterialLayerSet and builds a set of surfaces to segment the building element geometry.
Note that enabling this settings is computationally intensive as it involves 3D Boolean operations.
This setting is available in IfcConvert using `--building-local-placement`.
In the typical IfcSite > IfcBuilding > IfcBuildingStorey > ... hierarchy of elements, don't incorporate the ObjectPlacement of the IfcBuilding and above in the placement of elements in the output. This is useful when there is a large offset in this placement that reduces precision in further processing.
CONVERT_BACK_UNITS
------------------
This setting is available in IfcConvert using `--convert-back-units`.
Internally IfcOpenShell uses meters as the global length unit to do calculations. This setting restores the coordinate positions after conversion by multiplying the factor of the IfcUnit with UnitType=LENGTHUNIT into the output geometry coordinate values.
DISABLE_OPENING_SUBTRACTIONS
----------------------------
This setting is available in IfcConvert using `--disable-opening-subtraction`.
As in most viewer applications, IfcOpeningElement geometry is subtracted from their host elements. This setting disables this behavior.
Note that disabling this settings will reduce processing time and improve robustness as it involves 3D Boolean operations.
DISABLE_TRIANGULATION
---------------------
To be used in conjunction with `USE_BREP_DATA`. Do not apply the triangulation and - when `USE_BREP_DATA` is set - return a OpenCASCADE serialized TopoDS_Shape from `create_shape()` and `iterator`.
>>> import ifcopenshell, ifcopenshell.geom
>>> s = ifcopenshell.geom.settings()
>>> s.set(s.DISABLE_TRIANGULATION, True)
>>> s.set(s.USE_BREP_DATA, True)
>>> f = ifcopenshell.open("Duplex_A_20110907_optimized.ifc")
When `INCLUDE_CURVES` is true and geometric elements include curves (such as the wall axis), add arrow heads to the edges to indicate direction of the curve.
Exclude faces, shells and solids from geometrical output. Implied when using `--plan` without `--model` in IfcConvert.
FASTER_BOOLEANS
---------------
NOTE: Only applicable when using OCCT 6.9 and earlier.
This setting is available in IfcConvert using `--merge-boolean-operands`.
Fuse the collection of all boolean operands into a single union before applying the boolean subtraction, as opposed to doing individual subtractions. This likely improves performance. From OCCT 7.0 onwards the boolean operations with multiple arguments is used.
GENERATE_UVS
------------
This setting is available in IfcConvert using `--generate-uvs`.
Applies a box projection on the generated geometry for the element to obtain UV coordinates. This is purely generated, it does not involve texture coordinates stored in the IFC model.

INCLUDE_CURVES
--------------
This setting is available in IfcConvert using `--plan`.
Include edge and wire geometries in the geometric output.
LAYERSET_FIRST
--------------
This setting is available in IfcConvert using `--layerset-first`.
When not using APPLY_LAYERSETS, take the first material layer from the set to use as the material for the overall element.
NO_NORMALS
----------
This setting is available in IfcConvert using `--no-normals`.
Do not emit normals on geometric output
SEARCH_FLOOR
------------
Note: Only applicable to Collada .DAE output when used from IfcConvert.
This setting is available in IfcConvert using `--use-element-hierarchy`.
Include the spatial hierarchy in the elements.
SEW_SHELLS
----------
This setting is available in IfcConvert using `--orient-shells`.
Re-orient or sew connected face sets to have a consistent outwards orientation.
SITE_LOCAL_PLACEMENT
--------------------
This setting is available in IfcConvert using `--site-local-placement`.
See `BUILDING_LOCAL_PLACEMENT`, but exclude also the ObjectPlacement of the IfcSite.
USE_BREP_DATA
-------------
See `DISABLE_TRIANGULATION`.
USE_PYTHON_OPENCASCADE
----------------------
Note: Only available when an import of `OCC.Core.BRepTools` or `OCC.BRepTools` succeeds.
This implies `USE_WORLD_COORDS``USE_BREP_DATA` and `DISABLE_TRIANGULATION`. The serialized TopoDS_Shape of `USE_BREP_DATA` is deserialized by Python OpenCASCADE.
USE_WORLD_COORDS
----------------
Apply the ObjectPlacement of the building elements to the geometric output. This is implied when using the Wavefront .OBJ output in IfcConvert. Note that this also eliminates the possibility for geometric elements to point to the same interpreted geometry result.
VALIDATE_QUANTITIES
-------------------
This setting is available in IfcConvert using `--validate`.
Running IfcConvert with `--validate` will set a non-zero exit code when ever a log message with severity equal or greater than ERROR has been emitted.
Currently for internal use only. For every building element geometry converted, looks for an associated quantity set where the OwnerHistory's organization name is IfcOpenShell. And looks for the quantities "Total Surface Area", "Volume", "Shape Validation Properties.Surface Genus" and validates these according to the interpreted geometry definition. Emit Logger::Error when calculated values are outside of the tolerance range for the value stored in the model.
WELD_VERTICES
-------------
Note: In Python, this setting is *on* by default.
Note: This setting only affects triangulated output.
This setting is available in IfcConvert using `--weld-vertices`.
Discards normals and joins vertices solely based on position. This is useful when output is to be modified in a modeling application.
>>> import ifcopenshell, ifcopenshell.geom
>>> s = ifcopenshell.geom.settings()
>>> s.set(s.WELD_VERTICES, False)
>>> f = ifcopenshell.open("Duplex_A_20110907_optimized.ifc")
cd dist/working && wget https://files.pythonhosted.org/packages/c8/4b/d0a8c23b6c8985e5544ea96d27105a273ea22051317f850c2cdbf2029fe4/behave-1.2.6.tar.gz
@@ -582,56 +417,6 @@ endif
cd dist/working/parse_type-0.5.2/ && cp -r parse_type ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCCOBie for XLSX support
# TODO: see if we can replace this with openpyxl which does both read/write
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/0c/bc/82d6783f83f65f56d8b77d052773c4a2f952fa86385f0cd54e1e006658d7/XlsxWriter-1.2.9.tar.gz
cd dist/working && tar -xzvf XlsxWriter*
cd dist/working/XlsxWriter-1.2.9/ && cp -r xlsxwriter ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by IFCCOBie for ODS support
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/97/73/8ade73f6749177003f7ce3304f524774adda96e6aaab30ea79fd8fda7934/odfpy-1.4.1.tar.gz
cd dist/working && tar -xzvf odfpy*
cd dist/working/odfpy-1.4.1/ && cp -r odf ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by odfpy
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/a4/5f/f8aa58ca0cf01cbcee728abc9d88bfeb74e95e6cb4334cfd5bed5673ea77/defusedxml-0.6.0.tar.gz
cd dist/working && tar -xzvf defusedxml*
cd dist/working/defusedxml-0.6.0/ && cp -r defusedxml ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by augin
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/76/b4/b7baffbda025efd5dc8fcd8d2e953e3aa939c236a484084fa8f4c3588ee9/boto3-1.17.17.tar.gz
cd dist/working && tar -xzvf boto3*
cd dist/working/boto3-1.17.17/ && cp -r boto3 ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by boto3
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/7f/2e/e02fdfd0f0377c4e44e61de27b05d5cfe93575770661ef9ded80ed90fa88/botocore-1.20.17.tar.gz
cd dist/working && tar -xzvf botocore*
cd dist/working/botocore-1.20.17/ && cp -r botocore ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by boto3
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz
cd dist/working && tar -xzvf jmespath*
cd dist/working/jmespath-0.10.0/ && cp -r jmespath ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by boto3
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/08/e1/3ee2096ebaeeb8c186d20ed16c8faf4a503913e5c9a0e14cd6b8ffc405a3/s3transfer-0.3.4.tar.gz
cd dist/working && tar -xzvf s3transfer*
cd dist/working/s3transfer-0.3.4/ && cp -r s3transfer ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Provides IFCJSON functionality
mkdir dist/working
cd dist/working && wget https://github.com/IFCJSON-Team/IFC2JSON_python/archive/master.zip
cd dist/working && wget https://files.pythonhosted.org/packages/85/33/f91b96e9e8608ff65a003b692e8a9cdd60f2178f60617e5b1d21334c009c/olca-ipc-0.0.10.tar.gz
cd dist/working && tar -xzvf olca-ipc*
cd dist/working/olca-ipc-0.0.10/ && cp -r olca ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Provides Brickschema functionality
mkdir dist/working
# For now lets bundle the latest nightly schema
@@ -656,7 +434,7 @@ endif
# Required by brickschema
# This is a bit of a dodgy one, it should be provided by setuptools which Blender doesn't ship.
mkdir dist/working
cd dist/working && wget https://blenderbim.org/builds/pkg_resources.tar.gz
cd dist/working && wget https://github.com/IfcOpenShell/IfcOpenShell/raw/v0.7.0/src/blenderbim/scripts/pkg_resources.tar.gz
cd dist/working && tar -xzvf pkg_resources*
cd dist/working/ && cp -r pkg_resources ../blenderbim/libs/site/packages/
#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.);
#4=IFCSIMPLEPROPERTYTEMPLATE('2T$a4OFsv2LeD5JeBKEV4f',$,'IsNTS','Whether or not the scale is intended to be significant',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#10=IFCSIMPLEPROPERTYTEMPLATE('3Z0BXPSG5CWgtI33ioV7aj',$,'Include','Selector expression to include ifc elements in the drawing',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#11=IFCSIMPLEPROPERTYTEMPLATE('1RVts_g3PAw98PJA2yL3bO',$,'Exclude','Selector expression to exclude ifc elements in the drawing',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#19=IFCSIMPLEPROPERTYTEMPLATE('0joEq0Rd10cxweEh0NeHT6',$,'JoinCriteria','Comma separated selection keys which determine what cut objects are to be joined.',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#5=IFCSIMPLEPROPERTYTEMPLATE('2T$a4OFsv2LeD5JeBKEV4f',$,'IsNTS','Whether or not the scale is intended to be significant',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#11=IFCSIMPLEPROPERTYTEMPLATE('3Z0BXPSG5CWgtI33ioV7aj',$,'Include','Selector expression to include ifc elements in the drawing',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#12=IFCSIMPLEPROPERTYTEMPLATE('1RVts_g3PAw98PJA2yL3bO',$,'Exclude','Selector expression to exclude ifc elements in the drawing',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#20=IFCSIMPLEPROPERTYTEMPLATE('0joEq0Rd10cxweEh0NeHT6',$,'JoinCriteria','Comma separated selection keys which determine what cut objects are to be joined.',.P_SINGLEVALUE.,'IfcText',$,$,$,$,$,.READWRITE.);
#2= IFCSIMPLEPROPERTYTEMPLATE('2HBOdOfz5E3hZ7IBLCq$$D',$,'Status','Status of the element, predominately used in renovation or retrofitting projects. The status can be assigned to as "New" - element designed as new addition, "Existing" - element exists and remains, "Demolish" - element existed but is to be demolished, "Temporary" - element will exists only temporary (like a temporary support structure).',.P_ENUMERATEDVALUE.,'IfcLabel',$,#3,$,$,$,.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.);
#10=IFCSIMPLEPROPERTYTEMPLATE('3i6SH_GbT7zhKea$wVE56A',$,'StartArrowSymbol','Custom symbol for the start of the section marker arrow. Need to make sure it''s present in "symbols.svg".',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#11=IFCSIMPLEPROPERTYTEMPLATE('1DtsPn5a9FG8$zXHDDMavY',$,'ShowEndArrow','Display end arrow.',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#12=IFCSIMPLEPROPERTYTEMPLATE('2$6U0mLI9AiPRWeBabdY3u',$,'EndArrowSymbol','Custom symbol for the end of the section marker arrow. Need to make sure it''s present in "symbols.svg".',.P_SINGLEVALUE.,'IfcLabel',$,$,$,$,$,.READWRITE.);
#13=IFCSIMPLEPROPERTYTEMPLATE('1naFqntIL7igCY7hCaE7kq',$,'HasConnectedSectionLine','Connect or disconnect section markers with line (by default = True).',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#25=IFCSIMPLEPROPERTYTEMPLATE('1rL2AbQsXD8RbpoWH5pYOV',$,'ShowDescriptionOnly','Hide the measurement values and show only annotation description',.P_SINGLEVALUE.,'IfcBoolean',$,$,$,$,$,.READWRITE.);
#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.);
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.