Taking into account that now we have error messages if user will try to remove the last material layer which would make layer set invalid ifc.
FAILED test/bim/test_feature.py::test_remove_material_set_layer - AssertionError: Failed to run operator bpy.ops.bim.remove_layer(layer=IfcStore.get_file().by_id(93).MaterialLayers[...
Some bim test was failing because of it
FAILED test/bim/test_feature.py::test_assign_material__material_profile_set - AssertionError: No material Default found in profiled materials: []
FAILED test/bim/test_feature.py::test_export_ifc__with_basic_contents_and_saving_as_a_relative_path - AssertionError: Value is C:\IfcOpenShell\src\blenderbim\test\files\temp\export.ifc
Duplicated objects were not able to have their own collection after 586707dd2
Also fixed bim test
FAILED test/bim/test_feature.py::test_copy_a_storey - AssertionError: assert 'IfcBuildingStorey/My Storey.001' in ['IfcBuildingStorey/My Storey']
Unlinking was using copied object name for the unlinked object instead of the original one.
So it worked like Cube -> IfcWall/Cube -> Cube.001 and bim test was failing:
FAILED test/bim/test_feature.py::test_unlink_object - AssertionError: The object "Cube" does not exist
1) Explicitly set empty ifc project not to load demo library - was still loading because it was using my default scene which caused errors.
2) typo in dimension check assertion message
Fixed error that was occuring if you try to import .ifc file where spatial element contains only grid and will use advanced mode, filter mode = "IFC Class" and check "Filter Spatial Elements".
Error occured because spatial element was filtered out but then when ifc grid was created and importer to find a spatial element based collection for the grid it couldn't find it.
Traceback:
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 595, in execute
ifc_importer.execute()
File "\blenderbim\bim\import_ifc.py", line 260, in execute
self.place_objects_in_collections()
File "\blenderbim\bim\import_ifc.py", line 1494, in place_objects_in_collections
self.place_object_in_collection(self.file.by_id(ifc_definition_id), obj)
File "\blenderbim\bim\import_ifc.py", line 1498, in place_object_in_collection
self.place_object_in_decomposition_collection(element, obj)
File "\blenderbim\bim\import_ifc.py", line 1517, in place_object_in_decomposition_collection
return self.place_object_in_spatial_decomposition_collection(element, obj)
File "\blenderbim\bim\import_ifc.py", line 1545, in place_object_in_spatial_decomposition_collection
self.collections[container.GlobalId].children.link(grid_collection)
KeyError: '33AiKftFj2aAf2MqQr5Gs7'
In ifc2x3 IfcProject is not IfcContext because there is no IfcContext in ifc2x3 and it was causing the error below on .ifc import with filtered spatial elements.
Also added small refactor
Traceback:
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\project\operator.py", line 595, in execute
ifc_importer.execute()
File "\blenderbim\bim\import_ifc.py", line 253, in execute
self.create_spatial_elements()
File "\blenderbim\bim\import_ifc.py", line 688, in create_spatial_elements
self.create_generic_elements(self.spatial_elements)
File "\blenderbim\bim\import_ifc.py", line 698, in create_generic_elements
products = self.create_products(elements)
File "\blenderbim\bim\import_ifc.py", line 717, in create_products
iterator = ifcopenshell.geom.iterator(settings, self.file, multiprocessing.cpu_count(), include=products)
File "\blenderbim\libs\site\packages\ifcopenshell\geom\main.py", line 99, in __init__
raise ValueError("include and exclude need to be an aggregate of IfcProduct?")
ValueError: include and exclude need to be an aggregate of IfcProduct?
Example - https://i.imgur.com/f4Yi3MR.png
Now changing style type should be a bit more intuitive - previously there were no button and it wasn't possible to change style type for all selected objects / changing style type for the entire scene were hidden in N-panel Miscellaneous section.
Now it also able to change style type for all blender materials, even the ones that don't have any objects using them (wasn't possible before 7c0c934b4)
`ifcmerge` is asymmetrical. When both branches have new entities, either
local or remote step Ids need to be renumbered to resolve the merge
conflict.
If the remote branch is 'origin/main' or 'main' we preserve remote Ids,
otherwise we preserve local Ids.
This should support a workflow where a local 'main' branch is kept
pristine, but other local branches are treated as disposable; it should
also support a workflow where multiple authors access a shared 'origin'.
Unfortunately I couldn't find a way to make it work with areas that user created during current blender session. But new areas will have this feature too after blender restart
also found a way to switch shade graph for two materials without juggling active materials and active objects - it was necessary to make it work on import without adding temporary active object
Procedure to merge a pull request would be: Add Remote, select the added
remote in the pull-down, Fetch from remote, select the added remote
branch in the pull-down, Merge, delete remote
Added support for external blender styles that will be saved to ifc.
What it basically means that you can append material from external .blend file as a style that can be loaded in your blender material anytime.
1) External style can be added in Material Tab
https://i.imgur.com/BYfesi5.png
Note that you select material name at the right side of file selecting panel:
https://i.imgur.com/mvqaaod.png
2) After adding external style you can switch between external and other surface styles:
https://i.imgur.com/YtCz8an.png
3) There is also option to switch styles to External for all objects in the scene:
https://i.imgur.com/u3zTcX9.png
Some other changes:
- some ui adjustments
- moved functions that create blender shaders to tool.Loader (they also reset shader graph now so it's possible to use them on non-default blender materials)
- some new tools for copying node graph from one material to another, appending data blocks
- new operator for browsing external styles can be reused later to append other data blocks
Now we add some prefix based on drawing id to each id in the drawing and also add this prefix as a class and add it to all css selectors.
Reason for that so each drawing on the sheet can have it's own set of styles that won't be affecting other drawings.
Example - https://i.imgur.com/kqRCwJW.png
* You can now edit profile based representations with TAB
* Minor fix
* Minor fix
* You can now edit parametric railing paths with TAB
Still not sure about the implementation though
* use shortcut instead of direct link to railing edition
* Add utility to check if a mesh is profile based or its representation is a swept solid
* Fix bug when trying to edit an empty object
* Prevent editing door, window and stair modifiers since they're fully parameterized by the modifier properties
* You can now edit roof modifier, railing modifier and various profile based objects
* You can now edit axis profile based objects
Now blender curves segments saved in IfcIndexedPolyCurves instead of creating individual polygons.
Also changed ShapeBuilder.polyline - now it will try to store points in IfcLineIndex where it's possible (previously it was storing just 2).
Was getting this error at project start:
Traceback (most recent call last):
File "\scripts\addons\blenderbim\bim\module\project\operator.py", line 332, in execute
return IfcStore.execute_ifc_operator(self, context)
File "\scripts\addons\blenderbim\bim\ifc.py", line 410, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "\scripts\addons\blenderbim\bim\module\project\operator.py", line 345, in _execute
self.import_type_from_ifc(element, context)
File "\scripts\addons\blenderbim\bim\module\project\operator.py", line 374, in import_type_from_ifc
collection_obj = collection.BIMCollectionProperties.obj
AttributeError: 'LayerCollection' object has no attribute 'BIMCollectionProperties'
Git merges usually transfer the commit history, but when we resolve a
conflict with a 'mergetool' (ie. ifcmerge), this history is lost,
everything is squashed into a single commit. Now a summary of the
merged changes is appended to the merge message.
For some reason there is also was missing PrimaryUnit in IFC2X3. But it's unrelated to the changes from this commit (generating pset templates before this commit already has PrimaryUnit there).
It works exactly the same as schedules - you add some .svg file, path to it stored in ifc and you can attach it to the sheet.
UI - https://i.imgur.com/tGbCGBb.png
Still need to add some tests for references
Short demonstration - https://github.com/IfcOpenShell/IfcOpenShell/assets/9417531/90c9b458-0bae-40a2-9eee-d748e57c24a3
Curently it doesn't have any special representation in viewport and it doesn't have any customisable parameters.
You might get come across error "Revision cloud edges must form just 1 polygon" - it means your edges either don't form any polygon or form 2 or more, both cases are not supported.
Git auto text detection seems to fail with IFC files, possibly due to
long lines. So we now force detection as text which ensures conversion
from CRLF to LF when adding to the repository. We also convert the local
IFC file to LF otherwise Git thinks that the local file is out-of-sync
with the repo version ¯\_(ツ)_/¯
Currently "type" attribute in selector returns something like "#71=IfcWallType('20jY5HfLH4LBwMrDEoTdML',$,'WAL100',$,$,$,$,$,$,.NOTDEFINED.)" when the code was expecting the class name like "IfcSlab" or "IfcWall". Changed it to "class" atribute that returns just class name.
Added it because there was no error handling here anyway and later there was another UnboundLocalError:
for attribute in declaration.all_attributes():
UnboundLocalError: local variable 'declaration' referenced before assignment
You can now 'clone' a remote repository and 'push' to it. There is no 'pull'
functionality because this can fail badly, so there is a 'fetch' which
retrieves all remote branches without merging (and never fails). The
user can then select the remote branch in the branch pull-down and merge
it.
Sometimes railing could consist just of one IFCSWEPTDISKSOLID then it will be considered native swept disk solid and imported as a curve.
But when user create BBIM railing they edit it as a mesh and curve might look a bit different. Therefore we detect it now at import to make sure it's going to be reprsented the same way as it was saved.
Previously there was an error if you remove all drawings:
```
Traceback (most recent call last):
File "\addons\blenderbim\bim\module\drawing\ui.py", line 182, in draw
DrawingsData.load()
File "\addons\blenderbim\bim\module\drawing\data.py", line 106, in load
"active_drawing_pset_data": cls.active_drawing_pset_data(),
File "\addons\blenderbim\bim\module\drawing\data.py", line 134, in active_drawing_pset_data
drawing = ifc_file.by_id(bpy.context.scene.DocProperties.active_drawing_id)
File "\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 326, in by_id
return self[id]
File "\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 314, in __getitem__
return entity_instance(self.wrapped_data.by_id(key), self)
File "\addons\blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4517, in by_id
return _ifcopenshell_wrapper.file_by_id(self, id)
RuntimeError: Instance #1 077 not found
```
Also added description and more clear name for `bim.open_sheet`
Error was:
```
Error: Python: Traceback (most recent call last):
File "\addons\blenderbim\bim\module\drawing\operator.py", line 82, in execute
IfcStore.execute_ifc_operator(self, context)
File "\addons\blenderbim\bim\ifc.py", line 410, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "\addons\blenderbim\bim\module\drawing\operator.py", line 1177, in _execute
del raster_references[reference.Location]
TypeError: list indices must be integers or slices, not str
```
Can be easily called with `pytest .\test\bim\test_feature.py -k "issue"`
Commented some lines out to make sure it doesn't interrupt someone's test process.
Need to uncomment `When I press "bim.create_drawing"` if you want to see if it freezes for you.
You can also uncomment `And I save sample test files and open in blender` to see the freeze manually in Blender client.
Before that commit if you created those types of annotations and then reopened .ifc file (without .blend) then you would lose their z coordinate and therefore would lose their value (because they were created previously as 2d annotations).
Now those annotations created as 3d to avoid that problem. I've also added temporary fallback that will turn your existing annotations to 3d next time you edit them.
Now angle annotation edges (not the arc itself) are greyed out when you're not editing them - that way they won't draw unnecessary attention. When you're in edit mode they'll appear white and the angle arc will appear blue.
Demo - https://imgur.com/a/lsgp9G4
Bug appeared after 046940f but it was there before - it was just kind of compensated by the other bug.
Because of that bug blender text size value was reupdated before saving it to pset therefore pset never received a new value.
Also added some refactor, planned to write some test to get this error covered.
What I've found that sometimes you might get into situation (especially if .ods was created / processed in Excel) you might get a lot unnecessary columns and rows (in fact excel always seems to save 1048576x16384 table) and trying to print this kind of table results in investing a lot of RAM into it and possible system freeze.
Now there is a check if table has more than 10000 cells (number is completely made up 😁) then it would require user to define print range in the table to prevent the issue.
Now it supports
1) print ranges - in svg you'll get only the part that's included in print-range.
2) children styles - sometimes cells inherit center alignment from column styles and before that commit text wouldn't be centered in svg in that case
3) repeating rows support
Now shading styles are stored in ifc. It's actually stored in json file (by default it's in projects "assets/shading_styles.json") and the path to it saved in `EPset_Drawing.ShadingStyles`.
Current shading styles is stored in `EPset_Drawing.CurrentShadingStyle`.
This change could potentially cause problems but I've added some temporary fallback to make sure `EPset_Drawing.ShadingStyles` will be set to some default path and default shading styles will be copied to the project's folder.
Previously saved templates wouldn't work now, they need to be either recreated or modified to make them work.
Example of old template format:
`["Name", "class", "type.Name"]`
Example of new template format:
`{"expression": ".IfcDoor", "attributes": ["Name", "class", "type.Name"]}`
Note that this would work too:
`{"attributes": ["Name", "class", "type.Name"]}`
Migrated all shaders from geometry shaders to builtins (all geometry data now calculated in python before passing to shader) to make them more reliable and support Metal backend on Mac M1 (tested that it works - both annotations and gizmo).
The current downside is that there is no more custom frag shaders too - meaning we do not support dashed lines in the annotations (currently Hidden and Grid just use a bit less bright annotation color).
Updating extrusion_depth, length and x_angle on active object change. Shouldn't be too expensive and that way it'll be more consistent with Blender UI.
We were discarding some styles that didn't have any style properties and then we always needed to keep it in mind later on, now we just create empty dict for those.
Before - https://i.imgur.com/dJPQ788.png
After - https://i.imgur.com/T1FtI8H.png
For it to work make sure you have word wrapping in ods.
It's still very naive since it's taking constant font width which could vary depending on font type, font size, font lettering. The proper way would be is to either find some svg way to do it (couldn't find any stable one) or to render text to identify it's width (could be done with PIL but seems overkill, atleast for now).
Error was:
File "\addons\blenderbim\bim\module\geometry\operator.py", line 775, in _execute
obj.select_set(True)
AttributeError: 'NoneType' object has no attribute 'select_set'
1) last polyline point was failing on Consecutive rule causing validation errors
2) Fixed wrong ifc class for dishwasher (was used occurence class instead of type)
In BIM Tool it looks like this right now - https://i.imgur.com/JWVPssg.png (note the units)
Previously it was displaying value like this - https://i.imgur.com/244aYTN.png
The benefit is that you can specify other units in that kind of property and it will automatically convert to current project's unit.
For example if you have millimeters as project's unit you can still type "10m" instead of "5000" and it will automatically convert it to 5000mm.
Or type in inches like 5" 11'.
Fixed text annotation rotation in viewport for the views rotated by multipel axis.
Changed text direction calculation to be the same in both viewport and svg.
Added option to suppress zero inches in the dimension annotation text through SuppressZeroInches property of BBIM_Dimension property set.
Previously by default suppressing zero inches was enabled. Now by default it is disabled.
SupressZeroInches On - https://i.imgur.com/nrhELnA.png
SupprezZeroInches Off - https://i.imgur.com/gIuO2GW.png
Also added more precision to inPerFoot in helper.format_distance to avoid this a bit annoying precision problem where format function keeps adding 1/256"
Without precision - https://i.imgur.com/D9WYjvJ.png
With precision - https://i.imgur.com/3XgOFSH.png
Checkboxes affect the drawings that will be used when you shift click "Create drawing", "Open Drawing", "Remove Drawing". Previously those opeartors were always applying the action to all drawings.
Also added option to remove selected drawings with shift+click to "Remove Drawing" and added new operator "Select all drawings" to select drawings in one click (you can shift click it to delsect all drawings).
Example - https://i.imgur.com/GAGghu5.png
Error was occuring because macros doesn't have `is_registered` attribute.
Error: Traceback (most recent call last):
File "C:\Software\Steam\steamapps\common\Blender\3.5\scripts\modules\addon_utils.py", line 421, in disable
mod.unregister()
File "\scripts\addons\blenderbim\__init__.py", line 45, in unregister
blenderbim.bim.unregister()
File "\scripts\addons\blenderbim\bim\__init__.py", line 192, in unregister
if cls.is_registered is not False:
AttributeError: type object 'OverrideDuplicateMoveMacro' has no attribute 'is_registered'
Still getting some other error on disabling the addon, seems to happen due ongoing drawing system restructure.
Error: Traceback (most recent call last):
File "C:\Software\Steam\steamapps\common\Blender\3.5\scripts\modules\addon_utils.py", line 421, in disable
mod.unregister()
File "\addons\blenderbim\__init__.py", line 45, in unregister
blenderbim.bim.unregister()
File "\addons\blenderbim\bim\__init__.py", line 177, in unregister
if bpy.data.scenes['Scene'].BIMProperties.module_visibility['drawing'].is_visible:
KeyError: 'bpy_prop_collection[key]: key "drawing" not found'
Including or excluding elements from the drawing using EPset_Drawing.Include/Exclude now also works for IfcAnnotation elements. Both in viewport (on "activate view") and on svg print.
Related change - annotation decorations are now hidden in viewport if their object is hidden.
Reworked annotation and gizmo shaders to work without `bgl` and support smooth lines.
Moved LIB_GLSL and DEF_GLSL to shaders module since it's basically the same code and this way it'll be easier to keep track of it.
- Display nested task resources/task inputs of the active task
- Show list of tasks related to the current object selection
- Highlight, in the WorkSchedule panel, tasks related to the current object selection
Added operator to change title block of currently selected sheet, it's located right after "Add sheet" button.
The way it works - you select the sheet, select the desired titleblock from dropdown menu and it overrides current titleblock from the sheet with the new one.
Error occured because ShapeBuilder was assigning "Curve2D" representation type for elevation view curves when the correct type is "Curve3D".
It use to occur for both doors and windows created with ifc modifier.
```
Validation error text:
2023-04-03:18:21:28,879 ERROR [rule_executor.py:154] On instance:
#135=IfcShapeRepresentation(#21,'Profile','Curve2D',(#134))
Rule IfcShapeRepresentation_CorrectItemsForType:
(IfcShapeRepresentationTypes(self.RepresentationType,self.Items))
Violated by:
False
+ where False = IfcShapeRepresentationTypes('Curve2D', (#134=IfcIndexedPolyCurve(#133,(IfcLineIndex((1,2)),IfcLineIndex((2,3)),IfcLineIndex((3,4)),IfcLineIndex((4,1))),$),))
+ where 'Curve2D' = #135=IfcShapeRepresentation(#21,'Profile','Curve2D',(#134)).RepresentationType
+ and (#134=IfcIndexedPolyCurve(#133,(IfcLineIndex((1,2)),IfcLineIndex((2,3)),IfcLineIndex((3,4)),IfcLineIndex((4,1))),$),) = #135=IfcShapeRepresentation(#21,'Profile','Curve2D',(#134)).Items
```
It caused errors because it was expecting mesh object to be selected - when it's not necessary that active_object is the one that mesh belongs to and sometimes no objects can be selected at all.
Error occured when you were editing annotation mesh and tried to switched from EDIT mode
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\geometry\operator.py", line 838, in invoke
elif element.HasOpenings:
File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 153, in __getattr__
raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcAnnotation' has no attribute 'HasOpenings'
Crash was caused by some change in Blender Python API in 3.5.
The code below resulted in `ValueError: bpy_struct: item.attr = val: MeshPolygon.vertices: array length cannot be changed to 4 (expected 0)`
```
obj.data.polygons.add(1)
p1 = obj.data.polygons[-1]
p1.vertices = (v1.index, v2.index, v3.index, v4.index)
```
Now adding STAIR_ARROW annotation is a bit more clever - if you have IfcStairFlight selected when adding this type of annotation it will automatically:
1) define stair as it's parent;
2) add the stair as it's product;
3) place itself along the stair (it's assumed that stair direction is X+)
Example - https://i.imgur.com/Ze9DoK2.png
It was causing an error below on opening BIM Tool and probably in some other places.
```
Traceback (most recent call last):
File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 35, in draw
self.draw_tool_settings(context)
File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 48, in draw_tool_settings
tool = ToolSelectPanelHelper.draw_active_tool_header(
File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_toolsystem_common.py", line 809, in draw_active_tool_header
draw_settings(context, layout, tool)
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 67, in draw_settings
BimToolUI.draw(context, layout)
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 89, in draw
AuthoringData.load()
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\data.py", line 52, in load
cls.load_ifc_classes()
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\data.py", line 109, in load_ifc_classes
cls.data["ifc_classes"] = cls.ifc_classes()
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\data.py", line 196, in ifc_classes
+ tool.Ifc.get().by_type("IfcDoorStyle")
File "\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 364, in by_type
return [entity_instance(e, self) for e in self.wrapped_data.by_type(type)]
File "\Blender\3.5\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\ifcopenshell_wrapper.py", line 4499, in by_type
return _ifcopenshell_wrapper.file_by_type(self, *args)
RuntimeError: Entity with name 'IfcDoorStyle' not found in schema 'IFC4X3'
Traceback (most recent call last):
File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 35, in draw
self.draw_tool_settings(context)
File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_view3d.py", line 48, in draw_tool_settings
tool = ToolSelectPanelHelper.draw_active_tool_header(
File "C:\software\Steam\steamapps\common\Blender\3.5\scripts\startup\bl_ui\space_toolsystem_common.py", line 809, in draw_active_tool_header
draw_settings(context, layout, tool)
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 67, in draw_settings
BimToolUI.draw(context, layout)
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 92, in draw
cls.draw_header_interface()
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 351, in draw_header_interface
cls.draw_type_selection_interface()
File "\Blender\3.5\scripts\addons\blenderbim\bim\module\model\workspace.py", line 367, in draw_type_selection_interface
if AuthoringData.data["ifc_classes"]:
KeyError: 'ifc_classes'
```
Added support for sliding doors in IFC Door Modifier.
The main differences are 2d representation (https://i.imgur.com/VyEH569.png) and the door panel being placed before the lining, not after
Because of jumping between modes "bim.set_arc_index" doesn't remove newly created vertex groups on undo which resulted in error in decorator.
File "\blenderbim\bim\module\model\decorator.py", line 134, in __call__
if group_index in vertex[deform_layer]:
AttributeError: BMElem[key]: invalid key, must be a BMLayerItem
Switching from EDIT mode acts like canceling editing which seems intuitive.
Now it's also possible to add similar thing to other use of decorators - beware of the possible Blender bug - mentioned it in `ProfileDecorator.install description`
Added this change to editing of profiles, extrusion axis, roof and railing paths, extrusion profiles.
How it works:
1) You add Roof Modifier to some object that represents roof footprint.
2) Start editing path (Shift-E in BIM Tool).
3) Then you can select any edge and specify roof angles manually for each edge (Shift-R in BIM Tool)
to make side gabled you just need to set angle to 90 degrees. Preview will update automatically. You can set it back to 0 for angle to be defined automatically.
Some other changes:
- refactored decorator.py, in decorator now it's possible to supply some custom bmesh function that will be called on redraw, decorator now also can draw faces;
- changed colors for selected verts / edges to less bright, now it in more contrast to selected verts / edges color and seems much more readable;
1) Leaders text decorator wasn't changed after adding support for multiple literals
2) added drawing data update on toggling viewport annotations - so user would see correct values right away; also fixed similar thing on updating product
1) changed first ifc saving handler from save_pre to save_post so that in the situation when you just created with .blend file and started ifc project on save dialog would suggest the same name for the .ifc file and for .blend file (previously it was always suggesting ".ifc" and you had to type it in manually).
2) suggested default ifc project named changed from `<blend_filename>.blend.ifc` to `<blend_filename>.ifc` for simplicity.
PS save_pre didn't really work anyway - by the time "save ifc dialog" file was invoked and appeared .blend file was already saved anyway.
Added option to store multiple literals inside 1 Ifc text object.
If multiple literals share the same `BoxAlignment` then only the first one will be displayed in viewport
to prevent visual clutter (although added small asterisk symbol to indicate that there are still multiple literals).
Added option for aggregated text annotations. Example - "door-tag" symbol.
If you create text, specify "door-tag" symbol in EPset_Annotation.Symbol
\and add two literals to it then they'll automatically will fit to that door-tag in the svg drawing
(https://i.imgur.com/OXaIlWe.png).
The way it works - you define symbol in symbols.svg (or in your own symbols svg file)
and then add the `<text>` fields where text from literals will fit right in.
The imporant note: `<text>` tag must have attribute `data-type="text-template"` for it to work.
For example: `<text text-anchor="middle" dominant-baseline="middle" data-type="text-template"></text>`
The issue occurs because of svg pretty formatting - indent spaces <text> tag treats as actual spaces. Because of that use some css magic to remove those spaces from <text> tag and assign class to it's children <tspan> tags.
Altough trying to solve this issue I've tried to disable svg pretty format and got empty svg as a result (only templates, styles, no annotations) for some reason.
Refactored a code a bit and replaced literal parsing with `text_obj.BIMTextProperties.text` since it's already done beforehand in `tool.Drawing.update_text_value()`.
TestExportTextLiteralAttributes and TestImportTextAttributes was failing because now we're assuming that BoxAlignment will have 1 of values from the list below and not "BoxAlignment"
"top-left", "top-middle", "top-right", "middle-left", "center", "middle-right", "bottom-left", "bottom-middle", "bottom-right"
Added drop down menu to Ifc Text section in object properties where you can change text's size and it will automatically change it in `EPset_Annotation.Classes`. You can also preview it in viewport and it will write in IFC only after you finish editing.
Still need to investigate `annotation.Annotator.resize_text(context.active_object)` in `refreshFontSize`.
1) Puts IFC Text only on top of ifc panels to make it easier to change it's text
2) I guess it could be a good practive to set `bl_order = 1` by default so it will be possible later to prioritize something since by default blender sets `bl_order = 0` and then even `bl_order = -1` wouldn't help.
3) May not work in previously created files
Currently it causes an error if you run it in object mode and doesn't really work in edit mode either because you may have no vertices selected. Will fix soon.
Now it's possible to set custom markers in section annotation.
To do so you need to add BBIM_Section pset to the annotation and then you can either toggle displaying some marker with ShowStartArrow/ShowEndArrow or you can write the id of some custom symbol in StartArrowSymbol/EndArrowSymbol (need to make sure the symbol is included in symbols.svg).
Other changes:
- removed vertex sorting in decoration.py so that start and end points will be the same thing both in svg and in viewport representation (previously the sorting was needed of the direction the arrow in shader wasn't inverted));
- fixed bug when in svg section arrow symbols wouldn't rotate if you move individual verts of the annotation, not the entire object (I guess this bug sneaked in after adapting elevation annotation)
Here's the example - https://i.imgur.com/db09OVF.png
To make it work need to add BBIM_Section property set to the annotation and set "HasConnectedSectionLine" to False (by default it's True).
Also added preview for this feature in viewport.
Otherwise it always returned a list with 1 empty string like `[ "" ]` which resulted in messy class names in svg like "-87IfcAnnotation0LtaLiEpzAOxEqmIvCV27EFALLSLOPEANGLE".
Added fall annotation - they appear both in viewport and svg.
There are three types of annotations (SLOPE_ANGLE, SLOPE_FRACTION, SLOPE_PERCENT) you can switch them by changing annotation's ObjectType to one of those values.
By default it uses angle representation.
Small fix to allow setting cad_tool even if operators were called not from viewport and to avoid warnings like "Warning: Tool 'bim.cad_tool' not found for space 'PROPERTIES'"
Changes:
1) Added editing railing / roof path as hotkey to bim / cad tools.
2) Added profile decorator
3) Some switching modes and tools for convenience
4) Fixed nasty bug in tool.Blender.apply_bmesh - method wasn't updating current mesh if it was in edit mode.
Added Ifc Roof modifier (also added it to shift-a menu and type manager). It works similar way to railing modifier - you define roof profile and then roof is generated.
Currently it has only 1 type of roof - HIP_ROOF (it utilizes bim.generate_hipped_roof operator).
Added Ifc Railing modifier (similarly to stair, window, door modifiers...).
You can start working with it either creating some edge based path and adding this modifier or by creating Railing for Shift+A menu (it will create some simple path to start with).
In railing modifier you can switch two edit modes - editing main railing properties and editing path. Editing path will show only the railing path, you can edit it and save it. You cannot edit the railing pass if you're not in this mode.
Noticed bug trying to edit "Data" in psets from ifc modifiers and fixed it.
Traceback:
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\pset\operator.py", line 94, in execute
self.load_from_pset_data(pset)
File "\blenderbim\bim\module\pset\operator.py", line 206, in load_from_pset_data
metadata.set_value(value)
UnboundLocalError: local variable 'value' referenced before assignment
Currently it's always set to the same thickness and doesn't update from pset value.
It's currently using zigzag pattern to indicate batting because some techincal limitation of the shader (Error: C6033: Hardware limitation reached, can only emit 256 vertices of this size)
Also added batting to the annotation tool panel.
Added batting pattern to line annotations.
The way to use it is:
1) Add "Line" Annotation;
2) Change object type to "BATTING"
3) Add object property set "Pset_BBIM_Bating" (also added in this commit) to specify the batting thickness.
Currently there is no preview for batting in viewport.
Other changes:
- EPset_Annotation.ifc -> Psets_BBIM_Annotation.ifc (more general psets ifc library for the future use)
So basically now when you move windows or doors attached to the wall, their openings positions will also be updated if you hit "regenerate" for the wall.
Created some simple undo tests.
This "flip wall and ctrl-z" test actually is crashing blender if I do it manually - so I guess undo in background mode is still kind of different.
1) Window bug (#2792) - lining_offset wasn't converted from ifc units during window properties editing
2) Openings bug - OveallWidth/OverallHeight based openings was converted to ifc units even though their dimensions were already in ifc units.
`sequence.feature` - Added `[:]` to make errors more readable values in errors (for example, (0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0) instead of `<bpy_float[4], Object.color>`
`test_feature.py` - fixed `FAILED test/bim/test_feature.py::test_animate_the_consumption_of_a_wall - AssertionError: Value is <bpy_float[4], Object.color>`
Test was failing because of float garbage in object.color (the comparison was (0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0) <> [0.2, 0.2, 0.2, 1] )
After that fix all tests now are passed 🥲
Solves test_enable_editing_material_set_item test error
```
FAILED test/bim/test_feature.py::test_enable_editing_material_set_item - RuntimeError: Error: Python: Traceback (most recent call last).
RuntimeError: Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\material\operator.py", line 587, in execute
self.mprops.profiles = str(material_set_item.Profile.id())
TypeError: bpy_struct: item.attr = val: enum "107" not found in ('79', '98')
Location: C:\software\Steam\steamapps\common\Blender\3.4\scripts\modules\bpy\ops.py:113
```
The problem was `bim.enable_editing_material_set_item"` was trying to set `MaterialsData` profiles and wasn't able to set unnamed profile because `MaterialsData.profiles()` was discarding unnamed profiles (which is seems contradictory because `profiles()` is also handling unnamed profiles anyway).
- add check of OverallHeight and OverallWidth for creating openings for doors and windows;
- OverallHeight, OverallWidth update for all the occurences of the type for doors and windows;
- new tool.Ifc method - get_all_element_occurences
Prevents couple `pyrna_enum_to_py` warnings that occured using BIM Tool
```
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class_browser'
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'relating_type_id'
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class'
```
API for docs works the same way as it worked for ifc2x3 and ifc4.
Besides changing `doc.py` and adding `.json` schemas added `ifc4x3dev_scrape_data_for_docs.py` (it's kind of hacky now and relies on `server.py` code from the further mentioned repo) that's used to parse some entities descriptions from https://github.com/buildingSMART/IFC4.3.x-development for later use in `doc.py`.
When an inner boundary cut an outer boundary in an IfcCurveBoundedPlane
which is invalid in IFC schema then ifcopenshell fails to create
geometry.
See #635
1) do not create new ifc representation if editing was canceled (similar to 25c650f4c)
2) plan and profile representations now are optional (similar to 50d71d5ea)
The error was:
```
Error: Python: Traceback (most recent call last):
File "\blenderbim\bim\module\model\window.py", line 337, in execute
element = blenderbim.core.root.assign_class(
NameError: name 'blenderbim' is not defined
```
The bug occured when you created a window/door type and some instance of it and then would try to update modifier.
There were two problems:
1) Because `remove_representation` removes all the meshes of the representation, representation has to be switched before removing the old one.
2) `switch_representation` parameter `is_global` was set to `False` and it wasn't affecting all instances of the type which led to errors during representation switch later on.
Also:
- refactored window modifier code - part of it is now reused building a door and can be used by other module in the future
- fixed bug with window lining intersecting frame when lining_depth < panel_depth
- simplified the way lining is built in ifc - previously it was using 4-6 extrusions, now it's 1-2 which is also better for 2D drawings
* Bug when switching representations when active object not selected.
* Bug when switching to a non MODEL_VIEW body representation would load the MODEL_VIEW one instead all the time.
* Add support for plan body representations.
1) The bug occured if you would try to remove ifc window modifier and add it back again. Now adding new window checks if window was previously added
2) Second bug occured if you import .ifc project with window and some props were not used before (for example window was without transom), then newly added props would have incorrect units.
- when calculating quantities of an object, assign base qto to object if none exists.
- optimise core and tool functions so it's faster for many selected objects
Remove association to every completed CI workflow. High frequency of releases makes it better to keep this at a fixed interval given it's so compute intensive
* Delete unuseful functions and improve speed
* Delete active object function, cleaning around and improve performance
* Better functions names and prevent user defined qto use
`ShapeBuilder` class is used to programmatically create 2d and 3d ifc shapes and representations. It's inspired by the way OpenSCAD language is designed - the goal was to create a readable and easy way to create new shapes. The class can be imported from `ifcopenshell.util.representation` module.
Examples of things created with `ShapeBuilder` can be found in `shape_builder_examples.py` or `generate_furniture_library.py` / `Non_structural_assets_library.ifc`.
Also added ifc library of non structual assets (furniture etc) - `Non_structural_assets_library.ifc`. All assets are using most common dimensions for them - it makes it good for prototyping. Related to https://community.osarch.org/discussion/1192
1) pasing ID references
2) bugs in create_entities, where number of representations couldn't be updated
3) by_id node updated to current workflow
... other small fixes
- refactor work schedule visualisation operator
- Fix text handler
- Improve durations UI for task times (proposal to replicate for all durations)
- Simplify durations ( P32H as P4D or P1D8H)
- Implement years/months in various datetime calculations
- Feature to customise animation colors per construction task type
- Feature to add Visual task bars
- Feature to customise Visual task bar material colors
- Move helper functions from blenderbim.bim.module.sequence to ifcopenshell.util.sequence
* temp reasonable state, missing rule_head contents
* better state, with init() and rule_id, but some missing parameters
* performance; embed root in dict; fix lookup
* Add ast_utils
* Fixes related to listnode and typo
* First steps with code gen
* Finalize first steps towards working code generation
* Backwards compat
* Rule execution, error formatting, test cases
* Where rule: support indexing, more expressions, test plane angle measure
* positive length measure test cases
* Venture into entity rules, test actor role
* Fixed for not unary op and address test cases
* Test group qualifier and air terminal type
* typeof() implementation and test annotation curve occ
* Flexible handling of expression, type set intersection, IfcAnnotationSurface test cases
* Functions, derived attrs, fix branch order, allow to terminate branches, apply -1 to index
* Implement express query(), test cases for 2x3 bspline curve
* Function args, if-else, repeat, entity instance construction, cshape test cases
* Multiple function call arguments and other small but influential changes. IfcDotProject() almost working except for variable case
* Make lowercase and fix assignment to qualified lhs
* Entity instance schema without file, aggregate assignment workaround, range fix, lowercase instance locals, extruded area direction test cases
* Enumeration item handling, query() robustness, arbitrary profile test cases
* Empty aggregate_initializer, xor and instance equality, nested expression fix in IfcCrossProduct, axis2-3d test cases
* Numeric stable sort with indices greater then 10, get ast node parent, redeclared derived support, nested expression robustness, define entity functions, case statements, xor, mod, bool literals, nvl, unknown, conversion based unit test cases
* Safeguard for schema name case norm, case norm query variable_id
* free instance comparison, supertype serialization fix, include inherited attributes in locals, proper elif-else in case stmt, loindex, shape rep test cases
* Union operator on set, retain general_aggr_types in parse tree, test cases for property set
* Escape stmt, rule locals and statements
* Return calculated values for redeclared derived attributes
* fix for rules without stmt, add derived and inverse attributes to locals, filter unused locals, wrap exists() arg with lambda to catch indexerror, support repeated aggr init element, typeof() none check, enum namespace uppercase
* Regen 2x3 rules
* Rule test filter only on basename
* Update fixtures for compliance with full body of rules
* Add rule support to ifcopenshell.validate
* Implement usedin() function, test cases for IfcWallSC MLS
* blength
* Run code generation on all schemas
* Try to eliminate runtime pyparsing dep
* Try to eliminate runtime pyparsing dep
It's located in "Modifiers" section of the properties (the same way as IFC Array or IFC Stair).
It requires Sverchok addon to be enabled (it's lazy importing it when it's needed, so there is no new constant dependency).
What you can now do with it:
1) Add sverchok graphs to this modifier and store simple data from sverchok in IFC ("Update data from sverchok). The "output" node of the sverchok graph has to be type of "Viewer Draw" and it's name should start with "ifcoutput" (no case-sensitive).
2) Import/export json of sverchok graphs.
Fixed bug where the angle was drawn in svg only for the first two edges of the curve.
Now it takes into account all edges - first angle = edge0 + edge1, second angle = edge1 + edge2 etc.
Added ReloadSelectedIfcFile operator and added it to IFC Quality Control -> IFC Debug, it's useful when you're debugging and doing a lot of iterations on the same file.
Transparently write any .ifc | .ifcXML | .ifcZIP formatted file
with any extension :
- by guessing format from its extension
(eg. .zip | .ifczip | .ifcZIP | .ifcXML | .ifcxml | .IFC | .ifc)
zipped file can file can be of any supported format
- by specifying a format
- by specifying if it should be zipped
Transparently open any .ifc | .ifcXML | .ifcZIP formatted file
with any extension :
- by guessing format from its extension
(eg. .zip | .ifczip | .ifcZIP | .ifcXML | .ifcxml | .IFC | .ifc)
zipped file can file can be of any supported format
- by specifying a format
Added c- and z-profiles with lips to IFC AU Steel profile library (based on data from https://github.com/boltsparts/boltsparts/pull/15).
For z-profiles I've created simple 2D curve generation function that can be reused later - it requires list of points and list of points with fillets and the results are list of curve points, segments and IfcIndexedPolyCurve.
Example:
points, segments, ifc_curve = create_simple_curve_from_coords(coords,
fillets = (0, 1, 4, 5, 6, 7, 10, 11),
fillet_radius=(r+t, r+t, r, r, r+t, r+t, r, r),
closed=True, ifc_file=ifc_file)
Added new stair type "Wood / Steel" to IFC Stair modifier. It's less sophisticated than "Concrete" stair type - it acts more like a "Dumb stair" operator we have.
1) Added "IFC Stair" to object modifiers - it works in similar way as "IFC Array". It creates a stair from current object (if it's IfcStairFlight) and writes it's parameters to property set "BBIM_Stair" and also to IfcStairFlight parameters.
Then you can edit it - modifying stair parameters and immediately see the changes, then you can save those changes or discard them.
2) "Clever Stair" operator (in Shift+A menu) works a bit different now - it creates new IfcStairFlight with IFC Stair modifier activated.
1) Updated AU profiles based on more correct data (https://github.com/boltsparts/boltsparts/pull/4) - also added welded i-beam profiles
2) Added inner and outer fillet radius to hollow profiles since this data was added to https://github.com/boltsparts/boltsparts
3) Added more data to ifc profiles that was available on bolts: FilletRadius for I-beams, C-beams; FilletRadius and EdgeRadius for I-beams. Sovles #2556
4) Set names IfcProfileDef names too. Solves #2556
+ Add explicit numerical constraint members to attribute class #2562
+ Fix error in numerical value callback #2562
+ Fix error in setting attribute values because of wrong type cast
* fix: add conditional #include <windows.h> for certain files breaking with boost v1.78+
* Revert "fix: add conditional #include <windows.h> for certain files breaking with boost v1.78+"
This reverts commit 7cd5c6292b.
* fix: add only `BOOST_REGEX_NO_W32` to fix issues boost v1.78+
This new proposed readme makes it more obvious to readers that there is a large collection of tools available, a brief glance of what they do, and directs users to the dedicated websites and documentation for further instructions on installation and so on.
commit 7fb4cdaa16
Author: Gorgious <nathan.hild@gmail.com>
Date: Mon Oct 31 09:35:06 2022 +0100
Fix#2546 : Editing a material now automatically ends the edition of its material set item if necessary
commit 427411e758
Author: Dion Moult <dion@thinkmoult.com>
Date: Mon Oct 31 19:04:57 2022 +1100
You can now edit arbitrary profiles in the profile manager
commit cc056d5d53
Author: Gorgious <nathan.hild@gmail.com>
Date: Mon Oct 31 08:52:11 2022 +0100
Fix#2553 : Right click documentation is now only available for Blender 3.3+
Also fix an error in the console when right clicking a button
commit 31600033bf
Author: ArturTomczak <artomczak@gmail.com>
Date: Sun Oct 30 23:16:08 2022 +0100
add BCF reporter to IDS (#2552)
* grammar
* reason not always a list
* extend readme with instruction
* remove microseconds from date
* add BCF reporter
commit 0338825175
Author: Dion Moult <dion@thinkmoult.com>
Date: Sun Oct 30 23:26:59 2022 +1100
You can now add new profile definitions in the profile manager
commit d9f8aa4e7b
Author: Andrej730 <azhilenkov@gmail.com>
Date: Sun Oct 30 11:29:42 2022 +0600
Added ifc types schema for Ifc2x3 and Ifc4
Types schema located in separate json file, it's structure:
{ ifc_type_name: {"description": type_description, "spec_url": type_spec_url} }
I've also added new API function to get type data - `get_type_doc(version, ifc_type)`
commit 6803788676
Author: Dion Moult <dion@thinkmoult.com>
Date: Sun Oct 30 11:02:18 2022 +1100
Load thumbnails in a paginated manner to allow to scale to larger models
commit d421cc0bbb
Author: Massimo Fabbro <79401028+maxfb87@users.noreply.github.com>
Date: Sun Oct 30 00:07:56 2022 +0200
No mapped quantities in qto calculator has None value (#2549)
commit bf57c8b1bf
Author: Dion Moult <dion@thinkmoult.com>
Date: Sat Oct 29 23:45:04 2022 +1100
Refactor profile module to use data class
commit 9a25db6584
Author: Andrej730 <azhilenkov@gmail.com>
Date: Sat Oct 29 18:31:40 2022 +0600
get_attribute_doc get_entity_doc now use recursive method by default
commit 17ccd0adf7
Author: Andrej730 <azhilenkov@gmail.com>
Date: Sat Oct 29 18:27:51 2022 +0600
Simplified getting entity parent information for schema api
Removed unnecssary parent information from json schema - now API is getting it from ifcopenshell schema.
commit 937f39c898
Author: Andrej730 <azhilenkov@gmail.com>
Date: Sat Oct 29 17:35:43 2022 +0600
Added information about parent entity to schema
Added information about parent entity to schema (it's located in "parent_entity" entity parameter inside schema), both for Ifc2x3 and Ifc4.
Modified get_entity_doc and get_attribute_doc - now you can use additional optional parameter `recursive=True` with those functions - then parent entities attributes will be included to the list of entity's attributes. For example IfcWindow will also have attributes from IfcBuildingElement, IfcElement, IfcProduct etc...
commit 0b5ccd88a5
Author: Andrej730 <azhilenkov@gmail.com>
Date: Sat Oct 29 16:31:54 2022 +0600
Added descriptions for psets and qsets to ifc2x3, ifc4 schema
Example of getting pset description: `get_property_set_doc("IFC4", "Pset_ZoneCommon")['description']`
commit ebf3cd8909
Author: Andrej730 <azhilenkov@gmail.com>
Date: Sat Oct 29 10:32:26 2022 +0600
Added IFC libraries for AU and EU profiles
Also added script that was used to generate those libraries (the script is using data from https://github.com/boltsparts/BOLTS).
Types of steel profiles included:
I profiles, Z profiles, C profiles (known as U profiles in IFC), L profiles (both equal and unequal), hollow profiles (circle, square and rectangular).
commit 08afec3461
Author: Dion Moult <dion@thinkmoult.com>
Date: Fri Oct 28 22:32:15 2022 +1100
Support material layer set usage negative direction sense for parametric walls
commit 4408a23873
Author: Dion Moult <dion@thinkmoult.com>
Date: Fri Oct 28 22:30:43 2022 +1100
Merge duplicate types IfcPatch recipe can now merge based on any attribute
Types schema located in separate json file, it's structure:
{ ifc_type_name: {"description": type_description, "spec_url": type_spec_url} }
I've also added new API function to get type data - `get_type_doc(version, ifc_type)`
Added information about parent entity to schema (it's located in "parent_entity" entity parameter inside schema), both for Ifc2x3 and Ifc4.
Modified get_entity_doc and get_attribute_doc - now you can use additional optional parameter `recursive=True` with those functions - then parent entities attributes will be included to the list of entity's attributes. For example IfcWindow will also have attributes from IfcBuildingElement, IfcElement, IfcProduct etc...
Also added script that was used to generate those libraries (the script is using data from https://github.com/boltsparts/BOLTS).
Types of steel profiles included:
I profiles, Z profiles, C profiles (known as U profiles in IFC), L profiles (both equal and unequal), hollow profiles (circle, square and rectangular).
- Constraint type
- Material type
- ObjectMaterial type
- Actor class and type
- Structural load type and boundary condition type
- Style type
- System type
- Relating type
- Unit type
* Add IsGroupedBy in function get_decomposition
selector example : "@ .IfcZone & .IfcSpace"
* Update element.py
* Change name function get_group
get_group to get_grouped_by
* Add info mode toggle in addon prefs
* Add documentation property to Attribute
* Add webbrowser open operator
* Populate attribute doc on import
* Add attribute doc popup operator
* use path_resolve instead of eval
* Rename operator
* Add description field
* Panel UI is managed by operator
* Revert "Panel UI is managed by operator"
This reverts commit a7bbd06865.
* Revert "Revert "Panel UI is managed by operator""
This reverts commit d62115bf63.
* Add info popup to ifc class panel in object properties
* Implement fetching doc for non-ifc classes from jsonlike format
* Draw doc from non ifc classes
* Add utility function to draw info button on a given layout
* Add info buttons in the create project UI
* Display entity descriptions as tooltips in enum items
* Move predefined types fetching to data class
* Remove leftover prop code
* Use tool to get schema
Previous batch scripts was resulting in broken sym links (probably because mklink and some other comands were expecting full paths). New script provide required full paths and also use 1 line to set up blenderbim location.
Now you can access Doc API functions directly (like `ifcopenshell.util.doc.get_entity_doc(...)`) without setting up DocAPI class.
To make it work I've set up singleton DocDatabase class and made all paths relative to module location.
The schema for IFC4 the same as it was for IFC2x3.
Properties schema for IFC4 includes both quantity and propety sets.
Also cleaned up entities description for IFC2x3 from HTML code and IFC tags.
* IFC v2.3 json schema and parsing tool to regenerate it
Added entities and propeties schema in json format.
ifc2x3_entities.json format:
entity_name -> description, url, attributes;
attributes format: attribute_name -> attribute_descrption
ifc2x3_properties.json format:
property_set_name -> property_name -> description, children
children format: child_property_name -> child_property_description.
Also added doc.py script that can generate the same json schema files but requires docs IFC 2.3 docs in the same folder (https://github.com/buildingSMART/IFC/tree/Ifc2.3.0.1)
* Moved all json schema files to /util/schema
* Moved json files back to /util/, changed doc.py export location
* Added specification urls for entities and properties
Added specification urls for entities and properties.
Also added a function to parse actual property sets domain from the website to generate specification urls (domain on website and on github do not match).
Schema structure was changed:
ifc2x3_entities.json format:
entity_name -> description, spec_url, attributes;
attributes format: attribute_name -> attribute_descrption
ifc2x3_properties.json format:
property_set_name -> properties, spec_url
properties format: property_name -> description, children_properties
children_properties format: child_property_name -> child_property_description.
ifc2x3_property_sets_domains.json format:
property_set_name -> ifc_domain
* Now gross volume calculation doesn't consider related voids
* Qto gross volume calculation minor fixes
* No need to create a new entity and better mesh creation
* Use bmesh to calculate volume so it's not necessary to create a new object
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
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.
| Sponsor development on OpenCollective | [](https://opencollective.com/opensourcebim/) |
For IfcConvert to be able to write tessellated Collada (.dae) files
* [SWIG](http://www.swig.org/) and [Python](https://www.python.org/) - *optional*
For building the IfcOpenShell Python interface and the Blender add-on
* [3ds Max SDK](http://www.autodesk.com/products/3ds-max/free-trial) - *optional*
For building the 3ds Max plug-in.
All recent versions of 3ds Max (2014 and newer) are 64-bit only, so a 64-bit installation is assumed.
Building IfcOpenShell
---------------------
Note 1: The path where the source code is cloned to can contain spaces but non-ASCII characters are very likely to cause problems with the build.
Note 2: If you had not used `git clone --recursive https://github.com/IfcOpenShell/IfcOpenshell.git`, update the submodules by running `git submodule init & git submodule update`.
Note 3: Be careful with special characters is the path when using the nix or win build scripts, because the OpenCASCADE build will fail on paths containing ++ and likely other situations.
### Compiling on Windows
The preferred way to fetch and build this project's dependencies is to use the build scripts
in win/ folder. **See [win/readme.md] for more information**.
#### Using Visual Studio
Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**):
> cd IfcOpenShell\win
> build-deps.cmd
> run-cmake.bat
NB: `build-deps.cmd` need to be ran from the directory containing it, i.e. the `./win` folder.
You can now open and build the solution file in Visual Studio:
> ..\build-vs2015-x64\IfcOpenShell.sln
As the scripts default to using the `RelWithDebInfo` configuration, and a freshly created solution by CMake defaults
to `Debug`, make sure to switch the used build configuration. Build the `INSTALL` project (right-click -> Project
Only) to deploy the headers and binaries into a single location if wanted/needed.
Alternatively, one can use the utility batch file(s) to build and install the project easily from the command-line
(installing a project will build it also, if required):
> install-ifcopenshell.bat
#### Using MSYS2 + MinGW
Start the MSYS2 Shell and then:
$ cd IfcOpenShell/win
$ ./build-deps.sh
$ ./run-cmake.sh
$ ./install-ifcopenshell.sh
#### Using Bash on Ubuntu on Windows
Start Bash on Ubuntu on Windows and follow the instructions below. Compiling on Ubuntu 14.04.4 LTS using GCC 4.8.4
or Clang 3.5 has been confirmed to work.
### Compiling on *nix
The following instructions are for Ubuntu, modify as required for other operating systems. [nix/build-all.py] script
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
meant to be used for a typical IfcOpenShell workspace setup.
Note 1: It is recommended to use OCCT for IfcOpenShell. You could use OCE as well, but sometimes it may lag behind OCCT and
therefore not compile with the latest IfcOpenShell.
Note 2: where `make -j` is written, add a number roughly equal to the amount of CPU cores + 1.
**1)** Install most of the prerequisites and dependencies:
This guide provides a Dockerfile and sample code to help you run an AWS Lambda function written in Python and utilizing IfcOpenShell library.
Prerequisites
-------------
Make sure you have Docker installed on your machine. You can download Docker from the official website: [Docker Instalation](https://docs.docker.com/engine/install/)
Getting Started
---------------
1.**Clone this repository to your local machine:**
2.**Customize the Lambda function code:**
- Replace the sample Lambda function code in the `example_handler` directory with your own code.
- Update the import path in the Dockerfile's `CMD` instruction to match your Lambda function's handler function.
3.**Install the required Python packages:**
- Edit the `requirements.txt` file and add any additional dependencies required by your Lambda function.
4.**Build the Docker image:**
```shell
$ docker build -t lambda-ifcopenshell .
```
5. **Run the Docker container:**
```shell
$ docker run lambda-ifcopenshell
```
6.**Test lambda locally**
Follow the steps in this [guide](https://docs.aws.amazon.com/lambda/latest/dg/images-test.html)
7.**Deploy to lambda**
This is beyond the scope of this example. Please refer to AWS documentation. Some tools that could be useful are - AWS CloudFormaton, AWS CDK, pulumi or terraform
---------
> Note: This is a superficial guide, in order to make this work for your usecase you will need a good understanding of other AWS services like SQS, S3, API Gateway etc.
For more information on building lambda containers refer to this [guide](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html).
run([bash,"./autogen.sh"],cwd=os.path.realpath(os.path.join(cwd,"..")))# only run autogen.sh in the directory it is located and use cwd to achieve that in order to not mess up things
# Using `sh` over `bash` fixes issues with building swig
comment="This is an unmodified topic at the uppermost hierarchical level.\nAll times in the XML are marked as UTC times.",
guid="07ccdba0-1736-47e1-807d-67dc6f3addaa",
),
mdl.Comment(
date=XmlDateTime(2015,8,31,14,0,1),
author="dangl@iabi.eu",
comment="This comment was a reply to the first comment in BCF v2.0. This is a no longer supported functionality and therefore is to be treated as a regular comment in v2.1.",
guid="a12766c2-61bc-40b4-ab19-e9f45fd0b0bf",
),
mdl.Comment(
date=XmlDateTime(2015,8,31,13,7,11),
author="dangl@iabi.eu",
comment="This comment again is in the highest hierarchy level.\nIt references a viewpoint.",
# Provides Mustache templating in construction documentation
# TODO: remove this dependency, it seems overkill and we seem to get by with str replaces
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/3f/e7/8750ba6c6101d6aa5ceeb20c013adf2c6f3554a12c71d75654b468404bfa/pystache-0.6.0.tar.gz
cd dist/working && wget https://files.pythonhosted.org/packages/11/bc/5afb61dd5d863e5cf77cd952445c50c17e65953405986f19e97e4389692a/elementpath-3.0.2.tar.gz
@@ -334,10 +376,20 @@ endif
cd dist/working && cp *.whl shapely.zip && unzip shapely.zip
# 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*
@@ -563,35 +619,9 @@ endif
# Provides Brickschema functionality
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/ca/37/8309da9a72407d2f5eb5489c197ac3cfe96ee3ccba1902d2a0ecc7843f92/brickschema-0.5.1.tar.gz
cd dist/working && tar -xzvf brickschema*
# This is an evil hack because we don't want to bundle flask
cd dist/working/brickschema-0.5.1/ && cp -r brickschema ../../blenderbim/libs/site/packages/
# For now lets bundle the latest nightly schema
cd dist/working && wget https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
cd dist/working && cp Brick.ttl ../../blenderbim/bim/schema/Brick.ttl
rm -rf dist/working
# Required by brickschema
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/c7/22/37bb938be8e5c20d443b0c9ba0a243573b671b01739efb0a19f81bc5b470/pyshacl-0.17.2.tar.gz
cd dist/working && tar -xzvf pyshacl*
cd dist/working/pyshacl-0.17.2/ && cp -r pyshacl ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by brickschema
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/d2/a7/be8244688bfcee37c23733ab4fe8e6afa6d4403bd2674a3ae7bd2cecc77b/rdflib-6.0.2.tar.gz
cd dist/working && tar -xzvf rdflib*
cd dist/working/rdflib-6.0.2/ && cp -r rdflib ../../blenderbim/libs/site/packages/
rm -rf dist/working
# Required by brickschema
mkdir dist/working
cd dist/working && wget https://files.pythonhosted.org/packages/7d/c7/208aece36279e4f1236e437119358786e39530ecc1719d4e1afeddba5288/owlrl-6.0.2.tar.gz
cd dist/working && tar -xzvf owlrl*
cd dist/working/owlrl-6.0.2/ && cp -r owlrl ../../blenderbim/libs/site/packages/
cd dist/working && cp Brick.ttl ../blenderbim/bim/schema/Brick.ttl
rm -rf dist/working
# Required by brickschema
@@ -602,6 +632,20 @@ endif
cd dist/working/ && cp -r pkg_resources ../blenderbim/libs/site/packages/
rm -rf dist/working
# Required for hipped roof generation
mkdir dist/working
cd dist/working && wget https://github.com/prochitecture/bpypolyskel/archive/refs/heads/master.zip
text,tspan{/* 2.5mm */fill:black;stroke:none;font-family:'OpenGost Type B TT','DejaVu Sans Condensed','Liberation Sans','Arial Narrow','Arial';font-size:4.13px;}
var g = new JSGantt.GanttChart(document.getElementById('GanttChartDIV'), 'day');
g.setOptions({
vCaptionType: 'Caption', // Set to Show Caption : None,Caption,Resource,Duration,Complete,
vQuarterColWidth: 36,
vDateTaskDisplayFormat: 'day dd month yyyy', // Shown in tool tip box
vDayMajorDateDisplayFormat: 'mon yyyy - Week ww',// Set format to dates in the "Major" header of the "Day" view
vWeekMinorDateDisplayFormat: 'dd mon', // Set format to display dates in the "Minor" header of the "Week" view
vLang: 'en',
vShowTaskInfoLink: 1, // Show link in tool tip (0/1)
vShowEndWeekDate: 0, // Show/Hide the date for the last day of the week in header for daily
vUseSingleCell: 10000, // Set the threshold cell per table row (Helps performance for large data.
vFormatArr: ['Day', 'Week', 'Month', 'Quarter'], // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers,
vShowRes: false, // Disable the resource column.
vShowComp: false, // Disable the completion column.
vShowDur: false, // Disable the duration column, because jsgantt doesn't calculate durations the way we want.
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.