Compare commits

...

2939 Commits

Author SHA1 Message Date
Thomas Krijnen 55657a5c07 Rework memory mngmt 2024-05-22 13:03:27 +02:00
Thomas Krijnen c32dd8ba7d Merge remote-tracking branch 'origin/v0.8.0' into tfk-shared-pointer-storage 2024-05-20 14:33:59 +02:00
Thomas Krijnen b08a550519 Some more compatibility and continue working on wrapper 2024-05-20 14:32:34 +02:00
Thomas Krijnen fbb51a6705 Rerun codegen 2024-05-18 15:11:46 +02:00
Thomas Krijnen b2db755879 nix build --lto flag 2024-05-12 20:32:38 +00:00
Thomas Krijnen 3bb651fbd5 No longer disable optimizations in schema_class, not so relevant anymore 2024-05-12 21:19:32 +02:00
Thomas Krijnen 3df46abbc3 Rerun codegen 2024-05-12 19:36:01 +02:00
Thomas Krijnen 1e60454951 centralize attribute setting templates for size object reduction 2024-05-12 19:36:01 +02:00
Thomas Krijnen 6a62bf8493 Use latebound enum definition for resolving early bound enum names 2024-05-12 19:36:01 +02:00
Thomas Krijnen fb72fdca9c String pooling and modern initialization in schema 2024-05-12 19:36:01 +02:00
Thomas Krijnen 69afcce8e5 Rerun codegen 2024-05-12 19:36:00 +02:00
Thomas Krijnen e9b69b4b26 Reduce number of externs 2024-05-12 19:36:00 +02:00
Richard Brice 507e4a8211 Fixes problem with constant cant 2024-05-08 10:28:01 -07:00
Thomas Krijnen c1fb953a82 Initial attempt at shared pointer storage of instances and weap ptr access in python 2024-05-08 10:26:24 +02:00
Richard Brice a0b4c24224 Updates taxonomy::piecewise_function so it's immutable and implements internal caching. Adds new evaluate2 method that returns loop and vector of distance along for each loop point. 2024-05-07 10:24:46 -07:00
Richard Brice e0a9f44c13 Fixes transition code of last segment of vertical alignment 2024-05-06 12:27:32 -07:00
Thomas Krijnen 9de173dd3b #4605 fix segfault in absence of profile placement 2024-05-06 12:00:00 +02:00
Richard Brice a130601969 A few more tweaks to the alignment examples 2024-05-05 13:17:55 -07:00
Richard Brice e4625bd71e Fixes parabolic curves in IfcAlignment examples and helper functions 2024-05-05 11:40:02 -07:00
Richard Brice 648ca4d477 Resolves IfcSegmentCurve parent curve parameterization for line and clothoid 2024-05-04 18:07:09 -07:00
Richard Brice 6cb511b681 Removed IfcPolyLine as a parent curve for IfcCurveSegment. 2024-05-04 16:14:15 -07:00
Richard Brice 4dec319333 Re-write of IfcCurveSegment to eliminate recursion problem and provides a more standardized approach for all parent curve types 2024-05-04 16:03:36 -07:00
Richard Brice c93704f097 Fixes problem with IfcCurveSegment.Placement direction for parabolic vertical curves 2024-05-02 16:00:59 -07:00
Thomas Krijnen 7af9944c27 find_openings() on representation as a hint for hybrid kernel 2024-04-29 21:29:34 +02:00
Thomas Krijnen 405fe4097d Preliminary attempt at hybrid kernel 2024-04-29 21:03:33 +02:00
Thomas Krijnen 6f540e61ac Remove outdated todo note 2024-04-29 21:03:09 +02:00
Thomas Krijnen 710f19af08 Prevent stackoverflow on long alignments in adjustments 2024-04-29 21:02:31 +02:00
Thomas Krijnen e6cc500227 Some basic code to lookup lengths for pre ADD2 schemas 2024-04-29 21:00:59 +02:00
Thomas Krijnen 4e35e7455f Also lookup style association on solids 2024-04-29 20:57:09 +02:00
Thomas Krijnen 6fdf46f151 Add back support for IfcSphere 2024-04-29 20:56:37 +02:00
Thomas Krijnen ae2600afb9 Set style name 2024-04-29 20:51:17 +02:00
Thomas Krijnen d382cf7e23 Fix WeldVertices default in IfcConvert 2024-04-29 20:49:11 +02:00
Thomas Krijnen aef2d05364 Add back IFC4X3 sec schema to default in cmake 2024-04-29 20:48:43 +02:00
Andrej730 82a0c6396c BBIM support importing IfcRelAdheresToElement #4565 2024-04-26 11:44:52 +05:00
Andrej730 fabebb4ff6 use IFC4X3_ADD2 for ifcopenshell.schema_by_name
as it is the main IFC4X3 schema
2024-04-22 17:31:49 +05:00
Andrej730 aeb64acc07 util.doc - use release schema version for IFC4X3
As it will be more like to be available in the ifcopenshell package. Related to #4565
2024-04-22 17:31:49 +05:00
Andrej730 f94aecbbff typing 2024-04-22 17:31:49 +05:00
Andrej730 d33fdbba69 small optimization 2024-04-22 17:31:49 +05:00
Andrej730 0ddbcd98ea use column-major reshape for matrices #4565 2024-04-22 17:31:16 +05:00
Thomas Krijnen 133b420a54 Preliminary changes to blenderbim for v0.8 #4565 2024-04-21 13:35:18 +02:00
Thomas Krijnen 4f9f3d1856 Work around for obtaining instance id that blenderbim expects for materials 2024-04-21 13:34:25 +02:00
Thomas Krijnen 71c9066dc7 Fallback to C++ impl of IfcAxis2PlacementLinear #4565 2024-04-21 11:27:22 +02:00
Thomas Krijnen 0793ae539e Merge remote-tracking branch 'origin/v0.7.0' into v08attempt1 2024-04-21 11:26:06 +02:00
Thomas Krijnen 595ef3f009 Allow passing setting enums as naked int 2024-04-21 10:19:17 +02:00
Thomas Krijnen 889ed3bb07 Change 'template template' to param pack to make clang happy 2024-04-20 13:22:13 +02:00
Thomas Krijnen 053c80a577 Uncomment debugging code 2024-04-20 13:21:50 +02:00
Bruno Postle 3ef823db23 Regenerate missing sheets #4462
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.
2024-04-20 11:56:22 +01:00
Thomas Krijnen dafc321ea1 template and typename keywords to keep gcc happy 2024-04-19 21:44:54 +02:00
Thomas Krijnen 9272a9ed1f Missing template keyword 2024-04-19 20:40:59 +02:00
Thomas Krijnen 29998e3f57 Option to convert placements via convert_shape() #4565 2024-04-19 20:23:59 +02:00
Andrej730 60a70f5236 support IfcAxis1Placement and warn on IfcAxis2PlacementLinear #4565 2024-04-19 17:11:56 +05:00
Andrej730 757a010172 typing 2024-04-19 16:18:57 +05:00
Andrej730 447625bffd fix failing test in util.selector.format with imperial_length
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
2024-04-19 16:18:46 +05:00
Andrej730 25edaa9b89 update broken url for ladybug tools
temporarily use fork repo
2024-04-19 16:07:29 +05:00
Andrej730 9da4215bac ifcopenshell.util.selector.filter_elements - inherited predefined types
mentioned by @theoryshaw on osarch - https://community.osarch.org/discussion/comment/20126/#Comment_20126
2024-04-19 16:05:33 +05:00
Ryan Schultz 6ddf91fb52 bim.select_aggregate(select_parts=True) - selects all the host aggreg… (#4552)
- 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
2024-04-18 21:08:46 -05:00
Dion Moult 28eb2cd628 Fix dateutil dependency 2024-04-19 08:51:55 +10:00
Thomas Krijnen d24d781674 Merge remote-tracking branch 'origin/v0.7.0' into v08attempt1 2024-04-18 21:39:33 +02:00
Thomas Krijnen c2a47e95ce Merge commit '5a8209e2ad6873374452' into v08attempt1 2024-04-18 21:39:05 +02:00
Thomas Krijnen ffe1442974 Fixes after settings rework 2024-04-18 21:36:45 +02:00
Thomas Krijnen 29fd32be75 Fixes after settings rework 2024-04-18 21:15:40 +02:00
Dion Moult fa4239159d Fix incorrect dateutil dependency 2024-04-18 23:39:25 +10:00
Ryan Schultz ea6f0b054a fixes: #4563 2024-04-17 21:42:51 -05:00
Andrej730 3b637a0234 ifcsverchok - autogenerate node categories from index 2024-04-17 15:24:47 +05:00
Andrej730 45dacc3612 migrate docs urls 2024-04-17 15:18:45 +05:00
Andrej730 f93d79dce0 entity_instance.is_a overload typing 2024-04-17 15:18:45 +05:00
Gorgious56 6f8dcc637f #4532 : You can now store clipping planes to a json file and restore them
The file is stored along the ifc file
2024-04-17 11:52:00 +02:00
Andrej730 a748dda378 mention IfcSverchok in docs 2024-04-17 12:33:03 +05:00
Andrej730 b158a83644 update ifcsverchok builds 2024-04-17 12:32:42 +05:00
Andrej730 31cd20c61b more user-friendly errors enabling ifcsverchok 2024-04-17 12:10:18 +05:00
Andrej 0a542e6957 ci-ifcsverchok-build.yml 2024-04-17 11:38:18 +05:00
Andrej730 89d29cf133 ifctester.reporter.Ods - option for safe excel export #4427
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.
2024-04-16 16:40:05 +05:00
Andrej730 6ee7502920 ifctester.reporter.Txt small fix 2024-04-16 16:39:55 +05:00
Andrej730 708ee7350b ifctester - fix bug adding second .ods extension 2024-04-16 16:39:55 +05:00
Andrej730 836293504c ifctester typing 2024-04-16 16:39:55 +05:00
Andrej730 b458aea6b9 ifctester docs for command line use 2024-04-16 15:17:49 +05:00
Andrej730 e1e169ece8 fix bug in d6e69bd6e 2024-04-16 15:17:49 +05:00
Andrej730 aeea9dfb5e fix test after ac64d0c40 2024-04-16 15:17:49 +05:00
Andrej730 9a9be821d1 constraint.unassign_constraint - support batching #4474 2024-04-16 15:17:49 +05:00
Andrej730 c808382154 constraint.assign_constraint - support batching #4474 2024-04-16 15:17:49 +05:00
Andrej730 81608b0cee ifcopenshell.util.get_constrained_elements 2024-04-16 15:17:49 +05:00
Andrej730 02ae838c45 util.constraint - typing and docs 2024-04-16 15:17:49 +05:00
Andrej730 f1f8b3da6b spatial.dereference_structure - support batching #4474 2024-04-16 15:17:48 +05:00
Andrej730 8ac0d22a95 spatial.reference_structure - support batching #4474 2024-04-16 15:17:48 +05:00
Andrej730 3b6f79cc75 black format 2024-04-16 12:18:05 +05:00
Dion Moult 1e41561fe8 Fix #4345. Removing grid axes are now handled specially. 2024-04-16 16:43:02 +10:00
Dion Moult 23abf674f3 Minor fix 2024-04-16 14:54:36 +10:00
Dion Moult ac64d0c400 Fix #3581. Invalid new document references. 2024-04-16 08:06:10 +10:00
Dion Moult 0983f9e66d Fix bug where saved drawing filters didn't load in the UI. 2024-04-15 23:33:10 +10:00
Dion Moult 5725ed867f Don't unnecessarily update NTS or scale pset data 2024-04-15 23:33:10 +10:00
Dion Moult 4174a78bb5 #4553 2024-04-15 23:33:10 +10:00
Andrej730 96b0a241d9 add tests for get_referenced_structures 2024-04-15 17:24:31 +05:00
Andrej730 ff76850a54 ifcopenshell.util.element.get_structure_referenced_elements 2024-04-15 17:24:31 +05:00
Andrej730 9954e073fa constraint.assign_constraint to handle owner history 2024-04-15 17:24:31 +05:00
Andrej730 5da68721d6 document.unassign_document - support batching #4474 2024-04-15 17:24:31 +05:00
Andrej730 097f44284f document.assign_document - support batching #4474 2024-04-15 17:24:31 +05:00
Andrej730 1f605484d9 library.unassign_reference - support batching #4474 2024-04-15 17:24:31 +05:00
Andrej730 81dcad6a14 library.assign_reference - support batching #4474 2024-04-15 17:24:31 +05:00
Andrej730 03af1013a0 add tests for util.element.get_referenced_elements 2024-04-15 17:23:25 +05:00
Andrej730 144831f9ee classification.remove_reference - support batching #4474 2024-04-15 17:23:24 +05:00
Andrej730 d6e69bd6e9 classification.add_reference - support batching #4474 2024-04-15 17:23:14 +05:00
Andrej730 7d6fd03eb4 rename tests for consistency with api 2024-04-15 17:21:10 +05:00
Andrej730 75c854da01 ifcopenshell.util.get_referenced_elements 2024-04-15 17:21:10 +05:00
Andrej730 01ddf8e769 util.classification small optimization 2024-04-15 14:47:32 +05:00
Andrej730 0a9c9f2a28 typing 2024-04-15 14:47:32 +05:00
Andrej730 919dcbe2d9 black format 2024-04-15 14:47:32 +05:00
Dion Moult 5e237a1670 Fix #4553. 2024-04-15 17:22:12 +10:00
Dion Moult acf6628f23 Fix #4547. Handle both null inherited predefined types and disable editing predefined types on occurrences which inherit from a type. 2024-04-15 11:53:37 +10:00
Dion Moult 8a62558575 Fix #4484. Clarify inheritance rules of predefined types. 2024-04-15 09:27:58 +10:00
Dion Moult 0e0861c84b Further clarification of type vs occurrence psets/qtos.
Previously even if you had a type selected it would still say occurrence.
2024-04-15 09:27:00 +10:00
Dion Moult 5a8209e2ad Fix #4549. Drawing decorators are now refreshed like the rest of the UI after operations. 2024-04-15 00:01:42 +10:00
Dion Moult 50b41f5af6 Fix #4486. Sync camera properties from IFC on both drawing load as well as drawing activation.
Also there are now defaults in case pset values don't exist.
2024-04-14 15:18:23 +10:00
Dion Moult fc6678f5ce Fix #3402. 2024-04-14 14:41:37 +10:00
Dion Moult ee1183481f Fix #4525. Fix #4546. Specify dependencies for ifcopenshell and ifcpatch.
No longer optional for a better first experience. They aren't huge deps.
2024-04-14 08:52:19 +10:00
Dion Moult 6ddf7dae01 See #4546. Fix docs link to filtering elements query syntax. 2024-04-14 08:34:49 +10:00
Dion Moult 8232c9fa24 See #4541. Clarify how to use include args for IfcConvert 2024-04-14 08:33:23 +10:00
Dion Moult 07b6c95f54 Fix #4550. Update doc urls. 2024-04-14 08:11:57 +10:00
Andrej730 ca2f683af3 Update BBIM version in docs 2024-04-13 10:59:56 +05:00
Andrej730 eb46de9658 material.unassign_material - support batching #4474 2024-04-12 17:41:37 +05:00
Andrej730 59cc9c0a16 material.assign_material - support batching #4474 2024-04-12 17:41:37 +05:00
Andrej730 32d2f1d629 material.assign_material - update owner history 2024-04-12 17:41:37 +05:00
Andrej730 38a73d6510 ifcpatch - add ifc2x3 tests and test for MergeDuplicateTypes 2024-04-12 17:41:36 +05:00
Andrej730 59b496d4b5 typing 2024-04-12 17:41:36 +05:00
Dion Moult e56aa45a82 Fix #4526. Bug when exporting IfcTester results to BCF due to new "failures" attribute. 2024-04-12 10:09:52 +10:00
Dion Moult a3c99b8362 See #4541. Add documentation examples on how to use include filters in IfcConvert. 2024-04-12 10:09:52 +10:00
Andrej730 e66ac3d7db system.unassign_system - support batching #4474 2024-04-11 17:50:31 +05:00
Andrej730 6b48e8b4b9 system.assign_system - support batching #4474 2024-04-11 17:50:31 +05:00
Andrej730 3d243b5eee system.add_system - fix failing default agrument in ifc2x3 2024-04-11 17:50:31 +05:00
Andrej730 fa0dbac914 new util method ifcopenshell.util.element.get_groups 2024-04-11 17:50:30 +05:00
Andrej730 49e7abb4dc type.unassign_type - support batching #4474 2024-04-11 17:09:41 +05:00
Andrej730 5098550399 assign_type not to remap if it's type was assigned previously 2024-04-11 17:09:41 +05:00
Andrej730 e12c05eea0 typing 2024-04-11 17:09:41 +05:00
Andrej730 39433fb5a5 remove unused lines from tests 2024-04-11 17:09:41 +05:00
Andrej730 1ea80016cd fix bug generating profiles on assign_type after df4943205 2024-04-11 17:09:41 +05:00
Vukas Pajic 58b39d3926 fix: address test fails 2024-04-11 13:03:13 +02:00
Vukas Pajic 946c868388 fix: cascade_schedule correctly handles timelag with IfcRatioMeasure 2024-04-11 11:35:34 +02:00
Andrej730 df4943205a type.assign_type - support batching #4474 2024-04-10 18:58:44 +05:00
Andrej730 ba4eb2a891 fix bug in nest.assign_object 2024-04-10 18:58:44 +05:00
Andrej730 90bb2f0e16 unify tests for ifc4 and ifc2x3 2024-04-10 18:45:37 +05:00
Andrej730 c2840d92c2 fix test files names 2024-04-10 18:45:37 +05:00
Andrej730 81ff9c168e nest.assign_object to support ifc2x3 2024-04-10 18:45:37 +05:00
Andrej730 239ab5b587 get_pset() fix bug getting inherited psets with psets_only/qtos_only = True 2024-04-10 18:45:37 +05:00
Andrej730 37a33d62d5 further ifcopenshell.util.element optimization
and readibility for props addressed by the index
2024-04-10 18:45:37 +05:00
Andrej730 13c6fdd3c6 maintain verbosity getting complex property subproperties 2024-04-10 18:45:36 +05:00
Andrej730 e69597f72b typing 2024-04-10 18:45:36 +05:00
Andrej730 9c633c8b6c black format 2024-04-10 18:17:19 +05:00
Alper Kantarci 4d906578c7 Use "gltf" instead of "gtlf" (#4538)
- Fix "gtlf" typo
2024-04-10 21:02:56 +10:00
Dion Moult de744dddda Fix #4290. You can now format custom thousands separators and decimal separators in IfcCSV. 2024-04-10 17:32:39 +10:00
Dion Moult 0a04b88a52 Document how MacOS users using Blender from Steam should still use Mac Intel 2024-04-10 14:30:38 +10:00
Dion Moult bee1e21f0e Fix #4490. Fix fundamental bug where get_pset would return none for inherited props with a boolean False value. 2024-04-10 12:57:52 +10:00
Dion Moult f5c5fba151 Fix issue where the underlay cache option was not yet implemented and ignored. 2024-04-10 11:09:58 +10:00
Dion Moult 4f9badc063 Fix issue where reloading the drawing list would cause drawing names to be synced
It would run useless sync / API calls to edit psets on potentially hundreds of drawings.
2024-04-10 11:07:17 +10:00
Dion Moult b61d870922 See #4481. Defer setting render visibility to drawing generation to speed up switching between drawings.
Doing obj.hide_render = True/False in a loop is slow and there is no bulk set command.
2024-04-10 10:37:33 +10:00
Andrej730 153389fe4a ifcopenshell.util.element optimization
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).
2024-04-09 18:36:55 +05:00
Andrej730 965a45d65b ifcopenshell.util.element.get_nest test 2024-04-09 18:33:26 +05:00
Andrej730 06b84cfa24 nest.unassign_object - support batching #4474 2024-04-09 18:33:25 +05:00
Andrej730 97db95085a nest.assign_object - support batching #4474 2024-04-09 18:33:25 +05:00
Andrej730 d1bcec7a6a typing 2024-04-09 18:33:25 +05:00
Andrej730 7b46c6a443 black format 2024-04-09 17:05:36 +05:00
Andrej730 6db0c14fa8 ifcopenshell.api.run optimization
cache usecase classes instead of importing their modules and getting them each time, makes empty api call twice as fast
2024-04-09 16:18:11 +05:00
Andrej730 d03f9237e2 deprecate spatial.remove_container in favor of spatial.assign_container
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`.
2024-04-09 16:09:04 +05:00
Dion Moult 24716a0089 See #4481. Faster implementation of object hiding and toggline viewport visibility. 2024-04-09 18:39:41 +10:00
Andrej730 437d19e1f5 normalize line endings in CCI(EN).ifc (was commited as CRLF, not LF) 2024-04-09 12:43:50 +05:00
Dion Moult bd5fd3539a Fix #4497. Drawing text annotations are now based on actual line breaks. 2024-04-09 15:56:16 +10:00
Dion Moult bcc67ecb31 See #4497. Show invisible newlines and allow newline editing in attributes. 2024-04-09 15:25:10 +10:00
Dion Moult c50810a24a Fix #4533. Add convenience link to launch type manager when no types exist. 2024-04-09 14:10:01 +10:00
Benoit DAMAY 7f9ce37a98 Inline help feature (#4409)
* 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>
2024-04-09 11:50:08 +10:00
ppaawweeuu ac23d08717 Update CCI(EN).ifc
added last two rows with ending markers
2024-04-09 11:45:34 +10:00
ppaawweeuu a8211ed592 Add CCI Classification schema
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.
2024-04-09 11:45:34 +10:00
Gorgious e38f3beb91 New UI List in Sandbox panel to access, flip, remove, add, edit clipping planes
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
2024-04-08 21:31:23 +02:00
Andrej730 f14bf8557a aggregate.unassign_object - support batching #4474 2024-04-08 17:49:48 +05:00
Andrej730 cd11d2de27 aggregate.assign_object - support batching #4474 2024-04-08 17:49:48 +05:00
Andrej730 d764c0af23 temporary support for deprecated api arguments #4531 2024-04-08 17:49:48 +05:00
Andrej730 d24e5df7c1 typing 2024-04-08 17:27:41 +05:00
Andrej730 de5075aafe black format 2024-04-08 17:27:36 +05:00
Andrej730 9474d17867 fix test after 7dd0d7601 2024-04-08 16:28:05 +05:00
Andrej730 abe6dbdfc9 layer.unassign_layer - support batching #4474 2024-04-08 16:28:05 +05:00
Andrej730 7ecec973dd layer.assign_layer - support batching #4474 2024-04-08 14:51:07 +05:00
Andrej730 f34aef1ebf validate - add examples 2024-04-08 13:56:52 +05:00
Andrej730 3253bdf7aa fix possible infinite recursion in bim.debug_active_drawing #4500
also fixed the issue with mixed up results at the end of the operator execution
2024-04-08 12:19:57 +05:00
Dion Moult 8e2f9d2bb5 Fix #4509. Don't show scary error message if you haven't specified a filter query. 2024-04-08 17:19:17 +10:00
Dion Moult 7dd0d7601a Fix #3759. IFC4X3 files should use ADD2 identifier. 2024-04-08 12:34:59 +10:00
Dion Moult 5bd53b973f Fix #4303. Declare dependencies for ifctester. 2024-04-08 11:57:21 +10:00
Dion Moult 911cfe010e Publish IfcClash to PyPI 2024-04-08 11:19:13 +10:00
Dion Moult 35dd03664a Publish IfcCSV to PyPI 2024-04-08 10:55:59 +10:00
Dion Moult c89b84ff57 Whoops again 2024-04-08 10:31:37 +10:00
Dion Moult cda13af7a3 See #4529. Publish IfcPatch to PyPI. 2024-04-08 10:24:04 +10:00
Dion Moult 6e84eb0acc Add bSDD makefile 2024-04-08 10:09:58 +10:00
Dion Moult b9ede5c739 Whoops 2024-04-08 10:08:01 +10:00
Dion Moult 44b980c1e0 Publish bSDD to PyPI 2024-04-08 10:06:28 +10:00
Dion Moult 08f4dea47f Materials with no style colours now default to Blender's default colour when linking models 2024-04-08 08:33:18 +10:00
Dion Moult 8f2a7be903 Fix #4521. 2024-04-08 08:32:28 +10:00
Dion Moult 63b541917e Minor fix in doc utility for entities which have no predefined types 2024-04-06 23:48:14 +11:00
Dion Moult c8706bddc9 Fix bug where drawing psets were needlessly updated and random objects would get drawing psets added on them
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.
2024-04-06 23:37:42 +11:00
Dion Moult e969d407d3 Fix #4524. Update README.md 2024-04-06 22:21:16 +11:00
Dion Moult 066b198ac9 Fix #4492. Refix bug where there was an extra equal sign when loading saved queries. 2024-04-06 21:42:49 +11:00
sebphi 5d6119e542 Fix import of ifcopenshell.util.unit in Python <3.10 #4520 2024-04-05 17:46:55 +02:00
Andrej730 845e229a9c group.unassign_group - support batching #4474 2024-04-05 17:31:13 +05:00
Andrej730 cefa088b59 spatial.unassign_container - support batching #4474 2024-04-05 17:31:13 +05:00
Andrej730 109787d869 spatial.assign_container - support batching #4474 2024-04-05 17:28:30 +05:00
Andrej730 78abca16e6 black format 2024-04-05 16:47:14 +05:00
Andrej730 02aaf1b409 typing 2024-04-05 16:47:13 +05:00
Andrej730 02e102f2d2 Collector.sync skip_unlinking option #4500
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.
2024-04-05 16:30:44 +05:00
Andrej730 ec0dcb7f8c documentation and small refactor 2024-04-05 16:30:43 +05:00
Andrej730 ba63ed81a1 small optimizations
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
2024-04-05 15:55:01 +05:00
Dion Moult fb6660361d See #4518. Fix pypi python version requirements. 2024-04-05 21:13:24 +11:00
Dion Moult ecae9943e2 Add missing build dep 2024-04-05 21:12:27 +11:00
Thomas Krijnen 104e896531 #4278 Update cd.yml bump ubuntu version 2024-04-05 09:27:33 +02:00
Dion Moult 6555e56647 Fix evil hacks in ifcopenshell pip dist packaging and support py312 on PyPI 2024-04-05 16:54:29 +11:00
Dion Moult f9a590a22c Ship py39 to py312 for PyPI 2024-04-05 16:49:14 +11:00
Dion Moult ad4a1576d3 Allow manual workflow dispatch of ci-ifcopenshell-pypi.yml 2024-04-05 16:44:53 +11:00
Dion Moult c35c3f06b5 Fix #4504. Extract CAD layers when linking in models. 2024-04-05 15:03:47 +11:00
Dion Moult fada808a2f See #4504. Extract material data for linked models. 2024-04-05 14:53:11 +11:00
Dion Moult e221e6fa6a See #4508. Update example code to serialise to obj. 2024-04-05 08:25:59 +11:00
jaymeandretta 725dac04d0 Updates links to BlenderBIM and IfcOpenShell documentation in README 2024-04-05 08:12:43 +11:00
Andrej730 5c365990b9 bim.debug_active_drawing debug operator #4500
Operator can help narrow down failing elements when drawing is failing with "RuntimeError: An unknown error occurred".

it's located in debug section - https://i.imgur.com/b03jmkZ.png

The output is noisy but the results are highlighted:
https://i.imgur.com/0ZA0u60.png
https://i.imgur.com/oXzqIXU.png
https://i.imgur.com/Y0nMRMz.png
2024-04-04 16:42:00 +05:00
Andrej730 797e2e41a5 bim.create_drawing to sync only once if printing multiple drawings
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
2024-04-04 16:41:59 +05:00
Andrej730 57fe40839b black format, cleanup, notes
bim.generate_global_id - forgot to remove it previously, this operator isn't intended for debug section
2024-04-04 16:21:10 +05:00
Andrej730 b4c5ad1e35 typing 2024-04-04 16:07:31 +05:00
Dion Moult 635ddce93d Autodetect CSG representation types in shape builder 2024-04-04 18:28:26 +11:00
Dion Moult 24e807cac7 Detect binary data types in util.attribute 2024-04-04 18:28:26 +11:00
Massimo Fabbro 33ceba38a8 Qto_Calculator more consistent calculation about the PredefinedType 2024-04-03 22:26:50 +02:00
Massimo Fabbro 90ed1f9b28 improve the flooring height object quantity calculation 2024-04-03 22:26:50 +02:00
Massimo Fabbro e431cb205c improve the ceiling height object quantity calculation 2024-04-03 22:26:50 +02:00
Massimo Fabbro 09bb45f5bc fix add ceiling from walls elevation bug 2024-04-03 22:15:11 +02:00
Andrej730 7087452cde log external styles names when they fail to load 2024-04-03 17:37:38 +05:00
Andrej730 af4b58444d typing 2024-04-03 17:37:38 +05:00
Andrej730 711423cae5 use default shading_styles.json in case if project's file is missing
to make it consistent with how we use in similar cases default styles, symbols, etc
2024-04-03 17:37:38 +05:00
Andrej730 eb8b6062b4 move override panel methods to tool.Blender
to keep them close, so it will be easier to keep them in sync
2024-04-03 17:37:38 +05:00
Andrej730 5ac96cb5b9 change .poll for overridden panels instead of creating new classes
Needed to avoid errors disabling addons that have overridden panels
2024-04-03 17:37:38 +05:00
Andrej730 c462fc9337 move scene panels from different addons to "Blender Properties"
now we also automatically get list of default blender scene panels instead of hardcoding them
2024-04-03 17:37:38 +05:00
Andrej730 95f7a2bcde override blender ui panels when should_setup_workspace = False
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
2024-04-03 17:37:38 +05:00
Dion Moult 04cf9c870b Fix bug when linking in models with no chunks 2024-04-03 21:24:03 +11:00
Andrej730 bf9bddc867 ifcopenshell.validate to check unique guids (IfcRoot.UR1) 2024-04-02 17:17:23 +05:00
Andrej730 20a2fda066 typing 2024-04-02 15:45:42 +05:00
Andrej730 f03afb20f3 validate.py - black format 2024-04-02 15:45:42 +05:00
Gorgious56 e0df22ffec The button to remove an inherited pset is no longer enabled on instances
Previously it would fail silently if clicked
2024-04-02 09:52:43 +02:00
Andrej730 96302a5c07 Return of the missing button for regenerating global id
Was about to implement to find that we already have "bim.generate_global_id" and it just was lost at some point. Returned it to the attributes UI. It also allows Updating guids for all selected elements on Shift+Click.

This also can be useful to solve MergeProject and other guids conflicts, see example issue in https://community.osarch.org/discussion/2062/bbim-mergeproject-patch-not-separating-elements-in-different-buildings

Example - https://imgur.com/a/mvRtyER
2024-04-02 12:44:06 +05:00
Andrej730 38afce1628 RegenerateGlobalIds - tests 2024-04-02 12:32:36 +05:00
Andrej730 cd5afacc97 Fix test after cf9a94a79 2024-04-01 17:22:49 +05:00
Andrej730 c2623e5dce prevent reloading reference annotations on loading .ifc #4478
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
2024-04-01 17:06:20 +05:00
Andrej730 42ecd7e127 typing 2024-04-01 17:04:00 +05:00
Andrej730 c80a7cfcc9 fix typo 2024-04-01 16:00:18 +05:00
Andrej730 6d8f1a3980 experimental svg to dxf conversion for drawings
Example - https://imgur.com/a/AkvLlbZ
2024-04-01 15:50:43 +05:00
Andrej730 5c4c61bb15 fix issue with prohibited facets in 0065c5f, add a test 2024-04-01 13:49:42 +05:00
Andrej730 d8af8b58bb ifctester.Specification.set_usage convenience method
sets minOccurs and maxOccurs according to the agreement mentioned in the latest ids.xsd
https://github.com/buildingSMART/IDS/blob/6d71cdf3547a0383c6cfbbead81a7cef7521ac3a/Development/ids.xsd#L67-L72
2024-04-01 12:26:07 +05:00
Andrej730 3c0405249b typing 2024-04-01 12:26:07 +05:00
Dion Moult 7f57649d10 Whoops. 2024-04-01 17:49:44 +11:00
Dion Moult fbde23870e Fix #4321. The PurgeData recipe now also works on IFC2X3. 2024-04-01 17:00:47 +11:00
Dion Moult 7b968030ca Fix #4060. The colour by property panel now shows the number of results in the legend. 2024-04-01 15:45:34 +11:00
Dion Moult b5d672ba42 Fix #4069. IfcClash Blender interface now uses the new filter UI. 2024-04-01 15:28:34 +11:00
Dion Moult efa8da83ba Bump IOS. 2024-04-01 10:19:40 +11:00
Dion Moult 64cf7237db IfcDiff now uses the new selector syntax with the new UI 2024-04-01 10:16:30 +11:00
Dion Moult cf9a94a799 Fix #4306. Remove superseded selector UI. 2024-04-01 09:44:50 +11:00
Ryan Schultz 46c1a8c8ff added search for styles - in BIM_PT_representation_items 2024-03-31 11:57:55 -05:00
Thomas Krijnen ac7f2aeb62 #4450 todo note 2024-03-31 15:16:30 +02:00
Dion Moult 9378a763f3 Fix #4328. Fix incorrect documentation about how to use the imperial_length formatting function. 2024-03-31 22:32:07 +11:00
Dion Moult 0bc83fedae Use indices instead of WorkTimeDatesInterface
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.
2024-03-31 22:11:17 +11:00
Thomas Krijnen f7c03db752 #4450 don't fail on empty bbox in prefiltering 2024-03-31 11:25:56 +02:00
Dion Moult b6b8c21741 See #4484. Editing predefined type attributes now enforces valid combinations of userdefined and object/element type 2024-03-31 15:50:31 +11:00
Dion Moult c8af51cfd2 Fix #4323. Bug where running a filter could fail if you tried to compare values which had incompatible types. 2024-03-30 23:07:06 +11:00
Dion Moult 77de3820e7 More minor doc changes and polish 2024-03-30 23:06:07 +11:00
Dion Moult adc5bea4e9 Fix #4265. Bug where when loading a saved filter it showed an unnecessary = comparison (which is by default). 2024-03-30 23:05:37 +11:00
Dion Moult 1eddcb9ee0 Minor doc fixes 2024-03-30 17:37:50 +11:00
Dion Moult eae542f90f Fix #4461. Write documentation on how to build and edit documentation. 2024-03-30 17:37:14 +11:00
Dion Moult fab0d05279 Fix #4483. 2024-03-30 17:14:13 +11:00
Dion Moult d2e495a69f Fix #4318. Theme docs to match website branding and add edit button, footer links, and icons. 2024-03-30 16:47:56 +11:00
Dion Moult 02058efa4d Fix #4286. IfcCSV summaries are now formatted the same as the rows. 2024-03-30 15:40:02 +11:00
Dion Moult ed79cbb1cc Fix bug where loading drawings didn't correctly link shared meshes (e.g. from a type of an annotation) 2024-03-30 15:05:49 +11:00
Dion Moult 0065c5fba8 Fix incorrect handling of prohibited specifications 2024-03-30 00:13:02 +11:00
Andrej730 1ab24e8362 import referenced drawings activating the current drawing #4478 2024-03-29 15:13:40 +05:00
Andrej730 232b4ec34d typing 2024-03-29 15:11:47 +05:00
Thomas Krijnen 75e6147dbc #4474 Commented out code perhaps for future use 2024-03-29 10:46:25 +01:00
Dion Moult 8d7b293381 Fix #4305. Bug where importing spreadsheets into IFC didn't intelligently cast attribute data types 2024-03-29 20:37:34 +11:00
Andrej730 19c8afb652 Fix #4477 2024-03-29 11:51:14 +05:00
Dion Moult 84dcee6b36 Fix #4368. Update to latest Brickschema alpha to cut dep size 2024-03-29 15:48:52 +11:00
Dion Moult dadcf03f55 See #4473. Cull entourage library.
We haven't confirmed the legality of the other assets.
2024-03-29 15:33:47 +11:00
Dion Moult 413886ac6b Fix #4411. Fallback to absolute paths if relative paths fail. 2024-03-29 15:29:19 +11:00
Dion Moult 377f68c020 Run black on IfcTester 2024-03-29 15:28:33 +11:00
Dion Moult b718a37db2 Fix #4427. Failures are now stored in single dictionary.
There was a missing clear() call to failed_reasons which could lead to incorrect reporting. It also makes no sense to store them separately.
2024-03-29 15:06:59 +11:00
Dion Moult e21043b038 Fix #4465. Update IfcTester to IDS 0.9.7 2024-03-28 22:47:48 +11:00
Andrej730 395598d8e3 Fix invalid profiles after subdividing edges near arcs #4471 2024-03-28 14:02:03 +05:00
Andrej730 813518bcb5 use blender units subtype for cad props 2024-03-28 14:02:03 +05:00
Andrej730 4ce7a898c9 typing, format 2024-03-28 14:02:02 +05:00
Thomas Krijnen 78f235ea7c #4273 ignore degenerate triangles in mesher output 2024-03-28 09:06:41 +01:00
Vukas Pajic bda2f50f9d sync with latest 2024-03-28 17:15:58 +11:00
Vukas Pajic 5e5ba5b3d4 Additional metadata as property set #4425
https://github.com/IfcOpenShell/IfcOpenShell/issues/4425
2024-03-28 17:15:58 +11:00
Dion Moult 22b0e9dcc5 Minor doc fixes to refer to Mac intel and silicon 2024-03-28 17:13:50 +11:00
Dion Moult 68420d43ea Clash results now are sorted and show text overlays of clash type and distance 2024-03-28 17:11:46 +11:00
Dion Moult 924e337c90 Don't consider borderline points to be inside a shape for more robust protrusion results 2024-03-28 16:57:54 +11:00
Dion Moult 04599a10d2 Change precision check of "is point on line" to be 0.01mm
Precision::Confusion() is 1e-7 which is too small apparently when doing this math. There are plenty of results which are things like 5e-7.
2024-03-28 16:57:54 +11:00
Dion Moult 84c931bb5f Fix bug where hidden elements weren't selected sometimes 2024-03-28 16:52:30 +11:00
Dion Moult 572aedb3eb Fix #4269. Include dateutil for ifcopenshell on pypi 2024-03-28 10:48:19 +11:00
Dion Moult 1db86c24e3 Bump IfcOpenShell and remove py37 py38 from installation docs 2024-03-28 10:47:44 +11:00
Andrej730 74adde3030 ExtractElemenets - add some tests 2024-03-27 17:52:18 +05:00
Andrej730 f68e8f0e00 ExtractElements - fix bug where IfcElementAssembly elements wasn't added to the spatial tree
Example issue - https://community.osarch.org/discussion/2054/bbim-extractelements-patch-and-missing-elements-in-ifcelementassembly
2024-03-27 16:59:10 +05:00
Andrej730 98386984f3 Fix tests involving changes in Blender 4.1 (will fail on Blender <4.1)
Basically in Blender 4.1 they've changed a way renaming IDs works if name already existed before and those tests will stop working on Blender <4.1, see https://projects.blender.org/blender/blender/issues/119955
2024-03-27 15:23:46 +05:00
Andrej730 7b35ed97ca tests - reduce precision to our usual Cad tool precision to fix some tests 2024-03-27 15:07:49 +05:00
Andrej730 b3302ed679 Fix test in 1c1035e
tag @brunoperdigao for information
2024-03-27 15:07:49 +05:00
Andrej730 e12f060af8 black format 2024-03-27 15:07:49 +05:00
Dion Moult 6d4f47a2ca New entourage library including people and cars 2024-03-27 20:23:44 +11:00
Thomas Krijnen e49ab7e0cc #4070 don't increment aggregate length on invalid members 2024-03-27 09:36:05 +01:00
Dion Moult ccfe7ab80a Optimise property / quantity checks for IDS and other purposes 2024-03-27 16:09:13 +11:00
Dion Moult 7b95358975 Forgot to commit clash tool 2024-03-27 16:06:47 +11:00
Dion Moult bcc50aaadc Switch over clash to latest add_element signature 2024-03-27 16:06:15 +11:00
Dion Moult 30f63b7d67 Minor note about which OCCT version is currently supported 2024-03-27 15:59:25 +11:00
Dion Moult ead13e23bc Write docs about new geometry tree clash functions 2024-03-27 15:59:25 +11:00
Thomas Krijnen 24257d2a85 checkout v0.7.0 -- src/ifcgeom_schema_agnostic/IfcGeomRepresentation.cpp 2024-03-26 15:13:36 +01:00
Dion Moult 5c4dbb924d Reinclude missing max_protrusions_ 2024-03-26 15:13:36 +01:00
Thomas Krijnen 88e1b3d2f9 Fix is_manifold(), sorry :( 2024-03-26 15:13:36 +01:00
Thomas Krijnen f67b80c6a6 Integrate @Moult's add_element(TriangulationElement*) 2024-03-26 15:13:36 +01:00
Dion Moult c7fd42f2cf Clash detection features 2024-03-26 15:13:36 +01:00
Thomas Krijnen bed03bf83c #4307 2024-03-26 12:27:05 +01:00
Andrej730 1e49400e93 fix styles tests 2024-03-26 16:12:13 +05:00
Andrej730 608c0dc05d Fix tests, clean up file creating empty project
To fix tests changed bim.unlink_object not to unlink original blender materials as they might be used elsewhere.
2024-03-26 15:59:23 +05:00
Andrej730 921dbe9dae restore accidentally unregistered operator in 9be7d95 (caused issue in tests) 2024-03-26 15:54:46 +05:00
Andrej730 a7e0837f96 small optimization
not to calculate each quantity twice
2024-03-26 15:54:46 +05:00
Andrej730 071c80f845 fix tests 2024-03-26 15:54:46 +05:00
Andrej730 06d823b9d8 typing 2024-03-26 15:54:45 +05:00
Andrej730 b15e33e5e9 fix test after 7634e71 2024-03-26 14:32:16 +05:00
Thomas Krijnen 55885f7a24 #4329 Don't accept non-finite floats 2024-03-26 10:23:14 +01:00
Ian e5fd6d9152 Update build-deps.cmd 2024-03-26 19:32:56 +11:00
Gorgious56 4dda7e84a0 You can now select only the aggregate or the aggregate and all its part using the interface 2024-03-26 08:33:18 +01:00
Dion Moult bb6be4d52d Blender IfcClash interface now supports new IfcClash modes
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.
2024-03-26 15:24:47 +11:00
Dion Moult 01d487f585 Upgrade IfcClash to use new clash capabilities (currently unmerged from feature-clash2) 2024-03-26 15:22:56 +11:00
Andrej730 67a17ddd1b Fix hiding annotation objects without repr on drawing activation 2024-03-25 14:44:51 +05:00
Andrej730 f916edce1e typing 2024-03-25 14:43:53 +05:00
Andrej730 b0d810199b fix duplicated function names in test_feature 2024-03-25 14:18:35 +05:00
Andrej730 515a72cec9 fix linked ifc selectability toggle 2024-03-25 14:01:08 +05:00
Andrej730 7464f7519f fix load/unload linked ifc tests 2024-03-25 14:01:08 +05:00
Andrej730 f0dde4f825 fix linked ifc visibility toggle tests 2024-03-25 14:01:08 +05:00
Andrej730 54fefb3684 fix linked ifc wireframe mode toggle 2024-03-25 14:01:08 +05:00
tim 628fcb2999 Remove object text from subheadings (#4445)
https://github.com/IfcOpenShell/IfcOpenShell/issues/4312
2024-03-25 13:37:11 +05:00
Thomas Krijnen 22f830b053 #4130 setOnlyValid() option that skips and logs invalid topology 2024-03-24 16:45:31 +01:00
Bruno Postle 579c72fc69 Drawings panel: fix select_all_drawings operator
Previously it always deselected all drawings, now works as advertised
2024-03-24 10:31:47 +00:00
Andrej730 642a0f7084 black format 2024-03-22 17:46:21 +05:00
Andrej730 7cd5aab1c5 Fix ifc linking tests 2024-03-22 17:44:38 +05:00
Andrej730 4b15535c9c Fix issue removing material set
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'
2024-03-22 16:54:42 +05:00
Andrej730 b978da24d9 fix ui error getting active styles for non IfcMaterial materials
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'
```
2024-03-22 16:54:42 +05:00
Andrej730 7132c4e9bf typing and small refactor 2024-03-22 16:54:42 +05:00
Andrej730 5aa6123806 Blender 4.1 - fix errors due to renamed type manager icon 2024-03-22 15:58:45 +05:00
FabioPiccinini e48299cb3f Update sample.css (#4459)
Changed unescaped ; with , because it may cause problems if the style is included in svg
2024-03-22 11:51:57 +01:00
FabioPiccinini c65088a7a7 Unescaped ; was causing problems in Inkscape (#4456)
* Update default.css

An unescaped ; was causing problems when opening svgs that included this style with Inkscape

* Update default.css
2024-03-22 10:06:57 +01:00
Thomas Krijnen 4f53d8c5f1 #4452 release gil in ifcopenshell.open() and read() 2024-03-21 14:11:34 +01:00
Andrej730 424b2589d9 add macos py3.11-3.12 to docs 2024-03-21 16:59:53 +05:00
Andrej730 05f6ed1084 bump ifc version #4174 2024-03-21 15:10:57 +05:00
Andrej730 9ec80cee0d TesselateElements - avoid processing queries that affect no elements
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
2024-03-21 15:06:32 +05:00
Andrej730 a5daf4177a add_mesh_representation - option to force faceted breps 2024-03-21 15:06:32 +05:00
Andrej730 1b1eccb0c1 typing 2024-03-21 15:06:32 +05:00
Andrej730 ece9e5c834 grammar 😬 2024-03-21 11:57:42 +05:00
Andrej730 6005ff641b Clarifying info message saving guids to the text inside .blend #4446
Example - https://i.imgur.com/YtuQ9YA.png
2024-03-21 11:55:28 +05:00
Andrej730 fa603244b9 black format 2024-03-21 11:55:20 +05:00
Andrej730 6d6010be3b typing 2024-03-21 11:32:53 +05:00
Andrej730 3691052f06 bim.select_similar_type optimization
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
2024-03-21 11:23:45 +05:00
Thomas Krijnen e38eafd034 #4447 build-all.py 2024-03-20 14:58:06 +01:00
Andrej730 976eeaef20 make spatial elements unselectable from viewport by default
It seems most of the time they only get in the way trying to select some objects at scene origin.

fyi @theoryshaw
2024-03-20 17:30:58 +05:00
Andrej730 09da42d649 typing 2024-03-20 17:30:58 +05:00
Andrej730 97b23a9ac6 unload decorations on unlinking ifc file 2024-03-20 17:30:58 +05:00
Andrej730 5e8a57f089 fix issue with removing collections and scenes unlinking .ifc
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)
2024-03-20 17:30:58 +05:00
Andrej730 7f34d18bbf hide "no object selected" label when there are no linked ifc files 2024-03-20 17:30:58 +05:00
Andrej730 97cc19ed43 Remove appending occurrences from library in favor of fcaac6b 2024-03-20 17:30:57 +05:00
aothms d49faf7412 #4174 debug osx install of py311 and 312 2024-03-20 06:22:33 -04:00
Andrej730 fcaac6bd98 Append IfcElements from linked IFC files
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).
2024-03-19 17:45:48 +05:00
Andrej730 c35cdcfcad util.selector.set_element_value to work w/o preassigned placement #4439 2024-03-19 17:45:21 +05:00
Andrej730 205da63d8e util.selector.set_element_value ignore values within tolerance #4439 2024-03-19 17:45:21 +05:00
Andrej730 3f529ae21b collector.sync note 2024-03-19 17:45:21 +05:00
Andrej730 89f7105e9c typing 2024-03-19 17:45:20 +05:00
Andrej730 e5dd06c461 Fix for loading IFC files with non-IfcElement based IfcRelNests
Example is below, it was using IfcAlignment to aggregate IfcAnnotations and IfcReferents.

I've added support loading collections for IfcPositioningElements besides IfcGrid (grids already handled separately).

https://community.osarch.org/discussion/2034/ifc-not-visible-after-loaded-in-blender-bim
2024-03-19 15:25:38 +05:00
Andrej730 ec7af4e719 typing 2024-03-19 15:24:14 +05:00
Andrej730 a755ec99f9 small fix 2024-03-18 17:08:39 +05:00
Andrej730 812389bce2 ifccsv - support for assigning x/y/z coordinates from csv 2024-03-18 17:06:00 +05:00
Andrej730 b67b5e8d9f typing 2024-03-18 17:05:55 +05:00
M!l!nd e2a06e10b6 fixed qsets to display separately (#4423)
* 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>
2024-03-18 15:14:15 +05:00
Ryan Schultz 7fa26b2d60 small fix to cdd332d1ee, for clarity 2024-03-17 14:37:38 -05:00
Ryan Schultz cdd332d1ee fixes #4434 2024-03-17 14:20:27 -05:00
Thomas Krijnen 22f21a3f0b Wait for threads in iterator destructor 2024-03-15 13:57:44 +01:00
Andrej730 ee27bc3b74 fix error loading representation without styles
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.
2024-03-15 15:55:23 +05:00
Andrej730 8307bf5877 typing 2024-03-15 15:50:38 +05:00
Andrej730 09e473a0dc python code style docs 2024-03-15 12:02:43 +05:00
Benoit DAMAY abeefeeee7 removing debug print from previous commit 2024-03-15 14:05:09 +11:00
Benoit DAMAY d949180461 replacing os.rename() by shutil.move in ifcpatch 2024-03-15 14:05:09 +11:00
Jordan McManus 708bd3207e changed type comparison to GlobalId 2024-03-15 14:04:53 +11:00
Jordan McManus 68d9d04e5b changed comparison for type relationships 2024-03-15 14:04:53 +11:00
jgunstone 7c7bd3dc53 add get_properties test validating that offset and limit are correctly applied 2024-03-15 14:03:58 +11:00
jgunstone 24d2b59a2e add limit and offset to client functions 2024-03-15 14:03:58 +11:00
Andrej730 ac2684af8d fix bug after 8291a0ca6 2024-03-14 20:21:52 +05:00
Andrej730 8291a0ca6a viewport decorations for IfcAnnotation/MULTI_SYMBOL 2024-03-14 16:50:17 +05:00
Andrej730 b72b23741e common method for getting annotation symbol 2024-03-14 16:46:22 +05:00
Andrej730 858692f3f5 Indicate rotated/scaled symbols in viewport 2024-03-14 16:46:22 +05:00
Andrej730 c74bfa24d2 Support for rotated and scaled symbols with IfcAnnotation/SYMBOL
See: https://community.osarch.org/discussion/2027/bbim-rotation-of-ifcsymbol
2024-03-14 15:33:19 +05:00
Andrej730 66c29f0da1 black format 2024-03-14 15:07:11 +05:00
Andrej730 f20fd3357f typing 2024-03-14 14:50:34 +05:00
Andrej730 e4eb76d4e0 indicate IfcText symbol rotation in viewport 2024-03-13 17:21:10 +05:00
Andrej730 22c95828ce BBIM IfcTester - option to generate ODS report
https://i.imgur.com/0JyXVK6.png
2024-03-13 16:16:50 +05:00
Andrej730 e87ca960e8 Fix #4421
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
2024-03-13 15:32:42 +05:00
Andrej730 6881e7d220 utils.filter_elements docs and tests 2024-03-13 15:32:42 +05:00
Andrej730 28b54c869a typing 2024-03-13 15:32:42 +05:00
Andrej730 9596117953 small fixes 2024-03-13 15:32:42 +05:00
Sigma Dimensions (Yass) 8dbeb928e3 fix construction schedule import without IfcProject #4412 2024-03-13 03:15:27 +00:00
Andrej730 4fdb78aebc spatial.workspace - add hotkeys using add_layout_hotkey 2024-03-12 15:04:49 +05:00
Andrej730 01724913e1 bim.decorate_boundaries to decorate all boundaries in the scene
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
2024-03-12 15:04:49 +05:00
Andrej730 44dd07547e Fix issue with drawing same boundaries multiple times
If you'd hit alt+b in space tool multiple times it would redraw them again and again instead of switching between hiding and showing.
2024-03-12 12:12:12 +05:00
Andrej730 cc157239a2 model.space.py - small fixes 2024-03-12 12:10:56 +05:00
Andrej730 0576914e07 small fixes after d209cc9ff, added a test 2024-03-11 15:15:17 +05:00
Andrej730 a064173ffe BBIM - option to append occurrences from the other ifc files
Example - https://imgur.com/a/yASjbs8
2024-03-11 15:15:17 +05:00
Andrej730 8e502c9bb7 util.unit.py - black format 2024-03-11 15:15:17 +05:00
Andrej730 4d23706145 more typing 2024-03-11 15:15:17 +05:00
Geert Hesselink 6e8de292c6 Redundant closing symbol ' (#4413)
* scale placeangleunit

* add radian si_conversions

* return conversion value of planeangleunit

* Update unit.py

* redundant closing

* redundant closing
2024-03-11 11:12:23 +01:00
Geert Hesselink d209cc9ff4 Scale placeangelunit unit type (#4406)
* scale placeangleunit

* add radian si_conversions

* return conversion value of planeangleunit

* Update unit.py
2024-03-11 08:54:20 +01:00
Andrej730 ddfaf3308b fix error reloading representation for objects without representation 2024-03-11 11:39:18 +05:00
Andrej730 301ddab1ee commented out apil.run settings serialization as it's not used currently 2024-03-11 11:39:18 +05:00
Andrej730 1160d20d33 small fixes 2024-03-11 11:39:18 +05:00
Ryan Schultz 28099ddc8f Add parameter for angle tolerance, and change 'deg' to '°' 2024-03-09 09:53:21 +11:00
Andrej730 c1bca22638 add test for util.unit.calculate_unit_scale 2024-03-08 16:40:43 +05:00
Andrej730 3d5d868812 fix error in typing 2024-03-08 16:40:30 +05:00
fescale b015647543 Replace the specific "libpython3.8" debian package dependency for the generic "libpython3-dev". 2024-03-07 09:59:58 +01:00
Ryan Schultz c54f2131af added python version for Blender 4.1 2024-03-07 09:34:13 +11:00
Andrej730 2a832202fa Fix bug joining multiple extruded profiles in non-meters projects
Demo if someone missed that feature - https://imgur.com/a/JywJHyc
2024-03-06 17:30:55 +05:00
Andrej730 a3d970e014 shape_builder.create_axis2_placement_3d utility method and docs 2024-03-06 17:30:55 +05:00
Andrej730 24912bb827 Fix bug resetting rotations after editing profile axis
Before - https://imgur.com/a/czjAoSb
After - https://imgur.com/a/ajiNcdK
2024-03-06 16:22:15 +05:00
Adrian Insaurralde Avalos 1cd0bc9e7d occt 7.8 compatibility 2024-03-06 09:01:01 +01:00
Dion Moult 8880ab0fe9 Aggressively remove pandas test files 2024-03-06 17:11:33 +11:00
Andrej730 1c052d1417 fix demo library references after 7a7c89e 2024-03-06 10:53:19 +05:00
Dion Moult 20cb6ab007 See #4368. Don't ship with mostly unused and bloaty boto3 dep. Augin users can install boto3 with new debug tool. 2024-03-06 16:46:26 +11:00
Dion Moult e854447714 Little debug tool for people to easily install pip packages graphically
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.
2024-03-06 16:44:32 +11:00
Dion Moult 7f394a5807 Purge hppfcl in preparation for new clash features 2024-03-05 23:16:47 +11:00
Andrej730 c80b437682 load clipping planes decorator reopening .blend file 2024-03-05 15:01:23 +05:00
Andrej730 b793ab63cc fix poll errors for clipping plane gizmo #4392 2024-03-05 14:37:30 +05:00
Andrej730 8c28f52e6a fix duplicated ifcstyleditems using append_asset
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.
2024-03-05 14:18:18 +05:00
Benoit DAMAY 9d71b7483f Merge pull request #4397 from bdamay/v0.7.0
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 !
2024-03-05 09:14:06 +01:00
Benoit DAMAY e6e71adba7 Removing unnecessary comment lines 2024-03-05 08:53:56 +01:00
Benoit DAMAY 7ab8a5921b Merge branch 'v0.7.0' of https://github.com/bdamay/IfcOpenShell into v0.7.0 2024-03-04 17:11:54 +01:00
Benoit DAMAY d68d4d54a9 Replaced panel row with operator descriptor 2024-03-04 17:10:19 +01:00
Andrej730 bce0f0d8d4 fix typing loading issues 2024-03-04 18:14:50 +05:00
Andrej730 50648fd350 append_asset - keep preexisting contexts valid #4280
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.
2024-03-04 18:04:24 +05:00
Andrej730 b7e26bacea typing 2024-03-04 18:02:49 +05:00
Andrej730 a2fdd93e6b Optimise patch - lazy import toposort
to fix empty Optimise patch description in BlenderBIM
2024-03-04 18:02:49 +05:00
Dion Moult aef00a4dfc See #4389. Accommodate null pset values when serializing to SVG. 2024-03-04 17:53:53 +11:00
Dion Moult efae8ebdcd Add tree species to tree library 2024-03-04 17:51:48 +11:00
Dion Moult 61403fcf42 See #4389. Accommodate null metadata. 2024-03-04 17:51:07 +11:00
Benoit DAMAY badee8fdc5 Fix proposition to 3515 - extra empty lines removed from previous commit 2024-03-03 19:29:02 +01:00
Benoit DAMAY 36e779e32f Fix proposition to 3515 2024-03-03 19:23:51 +01:00
M!l!nd c50ac3db4f Update Makefile 2024-03-03 23:10:27 +11:00
Dion Moult b17c261344 Minor fix to shape aspects because not everything has a mesh (e.g. text annotations) 2024-03-03 23:09:40 +11:00
Dion Moult 956aae37a8 Fix #4377. Add support for adding filled elements in AXIS3 layered elements. 2024-03-03 23:09:17 +11:00
Dion Moult 48d6cc8a28 Fix #4383. Demo library should use Model/Annotation/MODEL_VIEW for text annotations so that they can be used anywhere, not just on plans. 2024-03-03 16:12:18 +11:00
Dion Moult cf9d3026f4 Fix #4384. Accommodate null values when getting data from pset. 2024-03-03 15:46:55 +11:00
Dion Moult e2f0b1ed5c Fix #4336. Close #4337. Remove rounding for more accurate fills. 2024-03-03 15:36:19 +11:00
Dion Moult b833cffbd3 Minor fixes to IfcCSV documentation 2024-03-03 15:25:15 +11:00
Dion Moult 7a7c89e475 Separate project templates and libraries and provide dropdown to built-in libraries to aid discoverability. 2024-03-03 15:24:46 +11:00
Dion Moult 01b0164e0d Fix #4385. Probably a mistake in the bool argument for removing datablocks. 2024-03-03 14:25:55 +11:00
Dion Moult 13f26d9b70 Tweak generated tree parameters and add manual trees to landscape library thanks to SavyGust27 2024-03-02 22:59:12 +11:00
jgunstone 8a88b0b3a1 🔧update pip install command assuming that this branch will be merged back 2024-03-02 10:56:20 +11:00
jgunstone a15e293db5 update license and version 2024-03-02 10:56:20 +11:00
jgunstone 9509f07da8 📝add docs about so to install and develop this package standalone 2024-03-02 10:56:20 +11:00
jgunstone 37b15de3e4 add simple tests to ensure the package is working as expected 2024-03-02 10:56:20 +11:00
jgunstone 66b4509b06 🐛 add limit and offset kwargs to get_classes. TODO- I think this needs doing throughout... 2024-03-02 10:56:20 +11:00
jgunstone 41dcb83bdb add version 2024-03-02 10:56:20 +11:00
jgunstone 0bda41710c 🔧 add pyproject.toml and __init__.py 2024-03-02 10:56:20 +11:00
Dion Moult cbd85fafda Fix #889. Write docs for how to do translations. 2024-03-01 23:16:05 +11:00
Andrej730 dc7ebab0d1 Clipping planes with cappings
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
2024-03-01 16:22:58 +05:00
Andrej730 0c2a3ff400 remove_data_block - option to skip some checks to speed it up 2024-03-01 16:22:58 +05:00
Dion Moult 6af6fda799 See #4380. Remove support for EOL Python 3.6 2024-03-01 21:04:09 +11:00
Dion Moult 2c9e443425 Fix #4300. You can now select spatial elements by their location too. 2024-03-01 20:02:15 +11:00
Dion Moult 2bede1cdf0 Fix #4340. Indicate user needs to setup IFC2X3 user/app when using API directly. 2024-03-01 19:46:50 +11:00
Dion Moult 4f3397a04e Fix #4333. Ensure order of info is correct for valid IDSes. 2024-03-01 16:42:38 +11:00
Dion Moult 9b8adad8c8 See #4380. Standardise filepaths when linking in IFCs. 2024-03-01 16:32:41 +11:00
Dion Moult c48bccf727 You can now specify a false origin when linking in a model 2024-03-01 15:02:01 +11:00
Dion Moult 5d41336342 Add Python3.12 to installation docs 2024-03-01 12:39:39 +11:00
Dion Moult b8628cc9df See #4380. Bump IOS. 2024-03-01 12:23:42 +11:00
Dion Moult 519cb86163 New cable carrier and cable tool grouped into MEP tool submenu 2024-03-01 12:12:35 +11:00
Dion Moult 0008d8bd2a Add icon and convenience functions for walk and set orbit center in explore tool 2024-03-01 12:12:35 +11:00
Andrej730 bc7946091a bump svgfill 2024-02-29 16:22:08 +05:00
ChristophMellueh ac2db7b4c9 add missing Props request 2024-02-29 21:23:23 +11:00
Dion Moult 0b57d5fc5f You can now flip clipping planes 2024-02-29 20:39:29 +11:00
Dion Moult 82af25d09a New clipping planes feature. 2024-02-29 16:49:23 +11:00
Dion Moult 4a82525bdb You can now query data about a linked object from a SQLite cache. 2024-02-29 16:48:46 +11:00
Dion Moult 002112dd50 Fix #4279. You can now link in IFCs directly with efficient chunking instead of having to first create blend files 2024-02-29 16:42:54 +11:00
Dion Moult 844a9842cf See #4279. Viewport object culling feature to increase FPS when navigating large models. 2024-02-29 16:40:48 +11:00
Dion Moult 3a098e55c4 New IfcPatch recipe to extract flattened properties and relationships to SQLite for simple queries 2024-02-29 16:23:21 +11:00
Dion Moult e186b81f0c Fix #4335. Fix compilation error. 2024-02-29 16:22:39 +11:00
patrick.joerg 527d16c5f0 Small doc change to direct readers to advanced mode 2024-02-28 23:54:05 +11:00
Andrej730 8c1b33e1d5 Fix issues with accessing invalid entities in bim.reassign_class #4371
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
2024-02-28 16:54:11 +05:00
Andrej730 e46f18f686 type.py - some typing 2024-02-28 16:54:11 +05:00
Andrej730 931fd9cc9f reassign_class - cover with tests 2024-02-28 16:54:11 +05:00
Andrej730 aebc073416 fix pass-valid-selected-enumeration.ifc after 5270045
.ifc was failing during test_validate.py
1) Changed schema to rc2 as rc3-4 doesn't have IfcBridgePart
2) PredefinedType and UsageType were mixed up
3) With just `.DECK.` it was failing with error below
```
With attribute:
    <attribute PredefinedType: <select IfcFacilityPartTypeSelect: (<enumeration IfcBridgePartTypeEnum: (ABUTMENT, DECK, DECK_SEGMENT, FOUNDATION, NOTDEFINED, PIER, PIER_SEGMENT, PYLON, SUBSTRUCTURE, SUPERSTRUCTURE, SURFACESTRUCTURE, USERDEFINED)> | <enumeration IfcFacilityPartCommonTypeEnum: (ABOVEGROUND, BELOWGROUND, JUNCTION, LEVELCROSSING, NOTDEFINED, SEGMENT, SUBSTRUCTURE, SUPERSTRUCTURE, TERMINAL, USERDEFINED)> | <enumeration IfcMarinePartTypeEnum: (ABOVEWATERLINE, ANCHORAGE, APPROACHCHANNEL, BELOWWATERLINE, BERTHINGSTRUCTURE, CHAMBER, CILL_LEVEL, COPELEVEL, CORE, CREST, GATEHEAD, GUDINGSTRUCTURE, HIGHWATERLINE, LANDFIELD, LEEWARDSIDE, LOWWATERLINE, MANUFACTURING, NAVIGATIONALAREA, NOTDEFINED, PROTECTION, SHIPTRANSFER, STORAGE, USERDEFINED, VEHICLESERVICING, WATERFIELD, WEATHERSIDE)> | <enumeration IfcRailwayPartTypeEnum: (DILATATIONSUPERSTRUCTURE, LINESIDESTRUCTURE, LINESIDESTRUCTUREPART, NOTDEFINED, PLAINTRACKSUPESTRUCTURE, SUPERSTRUCTURE, TRACKSTRUCTURE, TRACKSTRUCTUREPART, TURNOUTSUPERSTRUCTURE, USERDEFINED)> | <enumeration IfcRoadPartTypeEnum: (BICYCLECROSSING, BUS_STOP, CARRIAGEWAY, CENTRALISLAND, CENTRALRESERVE, HARDSHOULDER, INTERSECTION, LAYBY, NOTDEFINED, PARKINGBAY, PASSINGBAY, PEDESTRIAN_CROSSING, RAILWAYCROSSING, REFUGEISLAND, ROADSEGMENT, ROADSIDE, ROADSIDEPART, ROADWAYPLATEAU, ROUNDABOUT, SHOULDER, SIDEWALK, SOFTSHOULDER, TOLLPLAZA, TRAFFICISLAND, TRAFFICLANE, USERDEFINED)>)>>
Value:
    DECK
Not valid
```
2024-02-28 16:54:11 +05:00
Andrej730 56e00d059b fix error removing pset from material or profile 2024-02-28 16:54:11 +05:00
Andrej730 8a6b4aa5fb fix tests after a971860 2024-02-28 16:54:11 +05:00
Andrej730 46bee8aed9 fix errors in tests
they were failing because import_reference_attributes were failing to get docs for unset schema version since ifc file wasn't attached to Blender
2024-02-28 16:54:11 +05:00
Thomas Krijnen eaa2aa05a4 Add buffer (bytestring) accessors to material colors - plus small fixes 2024-02-28 11:12:17 +01:00
Thomas Krijnen abfa6edc5c Add buffer (bytestring) accessors to geometry data 2024-02-27 16:18:40 +01:00
Andrej730 e3a1c29593 Fix #4365
Allowing to add new properties with None values if should_purge is not set to True (and it's False by default)
2024-02-27 17:33:56 +05:00
Thomas Krijnen e6691989dc #4283 convert closed wires to faces prior to processing in svg serializer 2024-02-26 13:27:36 +01:00
Thomas Krijnen 83845bdd6d Disable building 3.6.x - due to from __future__ import annotations 2024-02-26 13:20:19 +01:00
Andrej730 0f4c19fd2d black format 2024-02-26 11:51:52 +05:00
Andrej730 ce8bdffe57 show occurrence name function in prefs only for custom name style 2024-02-26 11:35:28 +05:00
Andrej730 53e052eb77 Fix #4363 2024-02-26 11:35:21 +05:00
Dion Moult f21b472cfe Update Makefile 2024-02-26 17:10:36 +11:00
Dion Moult 324b440f5c Create blender_manifest.toml 2024-02-26 17:09:31 +11:00
Bruno Perdigão 37a7049a61 UI for linked aggregate (#4271)
* 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
2024-02-23 14:56:28 -06:00
Bruno Perdigão 1c1035e251 Linked aggregate preserve names (#4135)
* 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
2024-02-23 14:55:18 -06:00
Ryan Schultz d83924b73e Selects all the instances from selected instances that have different types 2024-02-23 12:51:16 -06:00
Massimo Fabbro a04542dfd1 New button hide all spaces in spatial tool 2024-02-23 18:16:15 +01:00
Massimo Fabbro 066616707a Now generate space and generate spaces from walls are always visible in the UI so users understand better that are different procedures 2024-02-23 18:16:15 +01:00
Andrej730 c1cd228911 Fix #4342 2024-02-22 16:19:19 +05:00
Andrej730 515830e52d update representation item style on editing/removing shape aspect
Example - https://imgur.com/a/2SxgSRH
2024-02-22 15:24:09 +05:00
Andrej730 a971860094 style.assign_representation_styles to replace previously assigned styles
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
2024-02-22 13:41:34 +05:00
Andrej730 f872906e0c MaterialCreator - minor refactor for code readibility 2024-02-22 12:26:12 +05:00
Andrej730 0597100356 fix error in data.py occurring if object has no material 2024-02-21 16:13:56 +05:00
Andrej730 d5feaaa1af show error message removing material that is used in material sets
previously it wasn't showing anything when you would try to remove a material
2024-02-21 15:58:17 +05:00
Andrej730 caca209c8f BBIM - update related representations on assigning style to material 2024-02-21 15:58:17 +05:00
Andrej730 2e45d4a57e unassign_material_style to handle constituents 2024-02-21 15:15:03 +05:00
Andrej730 0d8c86a0f6 api.unassign_representation_styles 2024-02-21 15:14:28 +05:00
Andrej730 7f0df72fec assigning material styles to reuse existing styled item + tests 2024-02-21 15:14:28 +05:00
Andrej730 863a8248af assign_representation_styles to reuse existing styled item + tests 2024-02-21 12:36:06 +05:00
Andrej730 bdc991856c style.assign_material_style small optimization 2024-02-21 11:32:48 +05:00
Andrej730 1a38b7f5c6 set previous active style and context values editing material's style 2024-02-20 16:02:50 +05:00
Andrej730 91199308a9 descriptive error for missing user or application in ifc2x3 #4340 2024-02-20 15:21:48 +05:00
Andrej730 1f7930c5c8 fixed bug migrating attributes to older ifc version (after 8728fa3) 2024-02-20 14:19:10 +05:00
Andrej730 54c7f355ff black format 2024-02-20 12:38:29 +05:00
Andrej730 551f3b0d8d Fix issues editing work time in ifc4x3 #4295 2024-02-20 12:38:29 +05:00
Andrej730 049c796629 IFC4.3 test bootstrap 2024-02-20 12:38:29 +05:00
Andrej730 412700c8fd Default Blender filepath hotkeys for .ifc filepath
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.
2024-02-20 12:01:43 +05:00
Andrej730 96a8c1e8ae style.assign_material_style to assign style to related shape aspects 2024-02-19 18:08:18 +05:00
Andrej730 602e18a262 promote get_shape_aspects to util.element method 2024-02-19 18:08:18 +05:00
Andrej730 9e30e1ad31 get material constituents from cache and filter active element material 2024-02-19 18:08:18 +05:00
Andrej730 b6f939f1b1 disable editing rep item style if it comes from material constituent through shape aspect 2024-02-19 18:08:18 +05:00
Thomas Krijnen d964f924d7 CMakeLists.txt pre 2.37 compat 2024-02-19 09:26:18 +01:00
Ryan Schultz 36b702630d Merge pull request #4291 from IfcOpenShell/Assign_Product_In_Any_Order
Select in any order, when assigning relating_product
2024-02-18 13:02:45 -06:00
Thomas Krijnen ccf70c7aad #4012 #2138 #2044 #4032 IfcConvert --keep-bounding-boxes option, default is now exluded. 2024-02-18 14:02:07 +01:00
Andrej730 a2ff63f9ec Fix issue editing object placement that shares it's axis placement with other placements
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.
2024-02-16 18:04:09 +05:00
Andrej730 a82b0f30b0 fix errors getting layer assignments in ifc2x3 #4330 2024-02-16 18:04:09 +05:00
Andrej730 bc2fd232d0 sort representation items in ui based on shape aspect
- display shape aspect along with the repsentation type
- sort representation items based on shape aspects name, items without shape aspects come last
2024-02-15 16:05:14 +05:00
Andrej730 5d7b6ad998 Fix #4319
StringProperty search keyword was introduced only in Blender 3.3
2024-02-15 14:53:11 +05:00
Gorgious56 0e0678b926 Fix section cut planes not working anymore on Blender < 4.0.0 2024-02-15 08:41:42 +01:00
krande 1d4dfd0eb3 add missing typename 2024-02-14 21:49:43 +01:00
Gorgious56 65179db444 #4308 : Fix section cutaway shader links incorrectly linking when removing a section 2024-02-14 14:15:07 +01:00
Gorgious56 5457ee3a40 Fix #4308 : Section cutaway shader : Update API for 4.0 breaking changes + draw line decorator for more than one section cutaway 2024-02-14 13:43:27 +01:00
Andrej730 4f3ba7ae22 some typing 2024-02-14 14:25:55 +05:00
Andrej730 a33a1700dc Fix bug in ExtractElements recipe adding a lot unrelated products
if you'd add a type product and it had material that were used in bunch of ther products
example - https://community.osarch.org/discussion/1965/error-extracting-ifcslab-or-ifccolumn
2024-02-14 14:23:50 +05:00
Massimo Fabbro 8a48769760 Minor fix 2024-02-13 17:15:25 +01:00
Andrej730 7e55872ca8 fix bugs in c5c7363a9 2024-02-13 17:58:12 +05:00
Andrej730 edbe1d80bf fix project name for IfcAdvancedHouse 2024-02-13 13:50:29 +05:00
Andrej730 bd093303c4 UI info message when patch execution was finished 2024-02-13 12:33:36 +05:00
Andrej730 c5c7363a93 ifctester Attribute.filter not to check subtypes attributes
if attribute is already found in the super type
2024-02-13 12:25:32 +05:00
Andrej730 5014fef129 Fix #4314
It was looking for IFC entities with the attribute from Attribute.name but wasn't considering ifc subclasses that inherit from that entity.
2024-02-13 12:24:58 +05:00
Andrej730 d710a01df5 ifctester - some typing 2024-02-13 12:24:58 +05:00
Andrej730 23c65742e1 CMake - disable optimization for RelWithDebInfo with ENABLE_BUILD_OPTIMIZATIONS=Off 2024-02-12 14:23:21 +05:00
Andrej730 d8f52afa6c Fixed #4310 2024-02-12 12:15:27 +05:00
Andrej730 29ce8d5d80 Fix bug removing relating object of IfcRelNests
it was unlinking current collection of the related object and related objects were missing after
2024-02-12 12:01:04 +05:00
Andrej730 5e5de0bbd8 root.remove_product - fix some cases producing invalid ifc #4313
always remove IfcRelNests
1) if product is RelatingObject
2) if product is the only RelatedObject
2024-02-12 11:40:25 +05:00
Ryan Schultz b9b58f5726 proposed fix for #4311 2024-02-11 13:36:23 -06:00
Massimo Fabbro 5c7271ddc8 See #4007. Now clone opening works also when a opening hosts a window or a door 2024-02-11 14:43:12 +01:00
Massimo Fabbro 2db35556e9 Clone opening now deletes also old opening placement 2024-02-11 14:43:12 +01:00
Massimo Fabbro 2449656311 Small refactor clone opening operator in order to better understand and reuse it rebase 2024-02-11 14:43:12 +01:00
Gorgious56 c66cf0a22b Assigning an ifc class to an object now displays a message if the object is not in OBJECT mode 2024-02-09 17:26:48 +01:00
Andrej730 e1a1ba62c5 add fallback to the previous schema versions for docs and mappings
before it was breaking part of BlenderBIM UI if we would open IFC4X1 file
2024-02-09 12:12:02 +05:00
Andrej730 6489f4dc1d bump py version in run-cmake.bat after c0d84713b 2024-02-08 16:39:27 +05:00
Andrej730 beab99bb0d Fix issue building IfcOpenHouse for IFC4 2024-02-07 13:34:19 +01:00
Andrej730 8b50f1bcd6 Fix bug in IfcHierarchyHelper.addRelatedObject
Noticed that `file.addRelatedObject<IfcSchema::IfcRelDefinesByType>(door_style, door);` was resulting in list with `door` assigned as RelatingObject and `door_style` assigned as RelatedObjects.
2024-02-07 17:10:16 +05:00
Andrej730 4617834578 MergeDuplicateTypes - fix error occuring if ifcopenshell.api is not imported
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'
2024-02-07 12:20:11 +05:00
Andrej730 426dcbee43 ifcopenshell installation notion about compiling only specific schemas 2024-02-07 12:20:11 +05:00
Andrej730 2a12151c07 cmake - clean up trailing spaces 2024-02-07 12:16:55 +05:00
Andrej730 c08958c1bd fix cmake warning with CMP0144 policy
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.
```
2024-02-07 12:16:55 +05:00
Andrej730 e355a33d48 bump required cmake version to remove deprecation warning
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.
2024-02-07 12:16:55 +05:00
Andrej730 ece9e2fdd1 build-deps - bump boost version to avoid "missing .b2 issue"
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.
```
2024-02-07 12:16:54 +05:00
Andrej730 c0d84713bc bump python version in windows build dependencies
they seem to switch to .exe from .msi starting from 3.5+, changed amd prefix. Also fixed version parsing line for two digits minor versions
2024-02-07 12:16:54 +05:00
Andrej730 ca9f165b6a ifcpatch.execute - make input attribute optional
e.g. MergeDuplicateTypes  doesn't use it in the code either way
2024-02-07 12:16:54 +05:00
dependabot[bot] 8f9c97a663 Bump fastapi from 0.101.0 to 0.109.1 in /src/opencdeserver/api/app
Bumps [fastapi](https://github.com/tiangolo/fastapi) from 0.101.0 to 0.109.1.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](https://github.com/tiangolo/fastapi/compare/0.101.0...0.109.1)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 09:31:38 +11:00
marwiss 4ed8310b93 Correct protocol to encrypted HTTPS 2024-02-06 09:55:11 +11:00
marwiss 31be899dc9 Replace existing code in src/opencdeserver with code from the "Kontroll OpenCDE API:s server" POC project on https://github.com/marwiss/Kontroll 2024-02-06 09:55:11 +11:00
Ryan Schultz 4463dd8af9 deleted extraneous variables 2024-02-04 17:35:40 -06:00
Ryan Schultz 95c0ac901f Select in any order, when assigning relating_product 2024-02-04 15:28:18 -06:00
Andrej730 6d7a6eeda7 fixed bug removing representation item
if you'd click on "remove item" button for some item it wouldn't remove the corresponding item but would go for removing active item instead
2024-02-02 14:53:10 +05:00
Andrej730 c520e0eeb5 some refactor for bbim drawings svg serialization
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.
2024-02-02 12:56:06 +05:00
Andrej730 73817acdff add a note on get_info_2() #4270 2024-02-01 17:19:35 +05:00
Andrej730 3d7e8d7c6c Fixed #4259
Result of DeepDiff contain ordered sets. Also added fallback for usual sets to lists just in case, should be safe.
2024-01-30 15:41:08 +05:00
Andrej730 a701840826 Fixed error adding a boolean
It occured if active object was IFC object and second selected object was just Blender object.
2024-01-30 14:40:07 +05:00
Andrej730 5de2ac9042 black format 2024-01-30 14:36:35 +05:00
Andrej730 573e2626ad Fix test Model.get_manual_booleans after we added pset to store them 2024-01-30 14:36:35 +05:00
Andrej730 9de59afd49 Fix #4267 and add tests
Crash was caused by unmark_manual_booleans accessing boolean element after they were deleted from IFC
2024-01-30 14:36:35 +05:00
Andrej730 74a9671075 Update ui.py 2024-01-30 14:36:35 +05:00
Andrej730 799658ff41 display active representation presentation layer in UI
example - https://i.imgur.com/mpnoqPH.png
2024-01-30 14:36:35 +05:00
Andrej730 bd64f42a54 remove_representation to consider representation item's layers too
and purge layers if they are out of items as they become invalid
2024-01-30 14:36:35 +05:00
Andrej730 8eab7f155e Small presentation layers UI fixes 2024-01-30 14:36:35 +05:00
Andrej730 5351966430 access layer assignments from inverse attribute instead of going through representation inverses 2024-01-30 14:36:35 +05:00
Andrej730 2663c079f4 test for removing representation items 2024-01-29 16:47:17 +05:00
Andrej730 6747bd9c8f UI to remove representation items
example - https://i.imgur.com/jJDpIQP.png
2024-01-29 16:47:16 +05:00
Andrej730 6ece295be4 tests for creating shape aspects and adding items 2024-01-29 15:52:40 +05:00
Andrej730 64a9f85f25 create new shape aspects from UI
example - https://i.imgur.com/BJJZWrC.png
2024-01-29 15:52:39 +05:00
Andrej730 d8fa853308 edit shape aspect attributes from UI
example - https://i.imgur.com/SzUEn6r.png
2024-01-29 15:52:39 +05:00
Andrej730 ce37c49624 Fix #4262 after 0da3270c7 2024-01-29 11:13:22 +05:00
Andrej730 0da3270c7f UI for changing representation item's shape aspect
Example - https://imgur.com/a/tN7hCYz
2024-01-26 17:32:46 +05:00
Andrej730 fda6fc6c48 geometry.remove_representation documentation 2024-01-26 17:20:39 +05:00
Andrej730 3865f01df9 operator to remove representation item from shape aspect 2024-01-26 17:20:39 +05:00
Andrej730 6bf61d7163 Simple UI to display repr item shape aspect
Example - https://i.imgur.com/YEAE9zU.png
2024-01-26 15:27:05 +05:00
Andrej730 b8ad73668f BBIM to print console errors in case IFC file is failed to load 2024-01-26 14:54:51 +05:00
Andrej730 b7a3dd4164 black format 2024-01-26 14:54:50 +05:00
Bruno Postle 566fd443db IfcGit avoid leaving stray .git/config.lock files 2024-01-25 23:30:00 +00:00
Andrej730 51b5a507cf shape builder docs 2024-01-25 16:46:38 +05:00
Andrej730 a44357dad5 shape builder polyline example and tests 2024-01-25 16:46:34 +05:00
Andrej730 8e792ebb50 UI for changing styles for representation items
Example - https://imgur.com/a/SQh6rR2
2024-01-25 15:17:44 +05:00
Andrej730 352321364c fix couple building docs errors / warnings 2024-01-24 16:38:53 +05:00
Andrej730 2ab32e41b2 shape builder docs fixes 2024-01-24 16:38:53 +05:00
Andrej730 3fbd9d7cdf IFC4 Landscape Library
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
2024-01-24 16:38:52 +05:00
Dion Moult 7a7fde0a2a See #4247. Loading models now skips excessively voided objects for performance. 2024-01-24 10:39:31 +11:00
Ryan Schultz 7992bd9902 Give user additional feedback when trying to duplicate an IFCproject and Drawing. Also deselects the object to prevent inadvertently moving it. 2024-01-23 08:04:12 -06:00
Dion Moult 3182fe9c15 Fix bug where merging by type when loading broke if a type didn't have a name 2024-01-23 19:45:31 +11:00
Dion Moult e8858aeeb3 Fix bug where loading filtered IFC2X3 models didn't work. 2024-01-23 17:39:13 +11:00
Dion Moult ec79d61095 Fix #2719. Indicator whether or not IFC is dirty to help users know when to save. 2024-01-23 16:29:42 +11:00
Dion Moult 266236ee49 See #4241. Only use shapely to repolygonise if IfcOpenShell returns unclosed paths. Hollow cuts typically are closed paths. 2024-01-23 16:06:54 +11:00
Dion Moult 192e4e43a4 Fix #4239. Stop users from duplicating IfcProject. 2024-01-23 12:30:25 +11:00
Dion Moult b22c92e951 Fix regression where you couldn't unlink an object that already had a broken element link, and bug where you couldn't unlink a spatial element or similar with its own collection. 2024-01-23 12:27:09 +11:00
Dion Moult 7634e71434 See #4239. Ensure that all copy pasted objects are unlinked. Use duplicate if you want to copy. 2024-01-23 12:25:46 +11:00
Dion Moult dda803df2e See 0028fd3. Fix regression when duplicating objects without connections. 2024-01-23 09:05:40 +11:00
Andrej730 c3ded31a6a static ifcopenshell.geom.serializers and some typing for IDE code hints
code itself should work exactly the same way
2024-01-22 14:24:24 +05:00
Thomas Krijnen f2d19ab2c3 #4216 todo note 2024-01-22 09:38:05 +01:00
Dion Moult ab80400e16 See #4240. Guard against possible user creating invalid userdefined attribute values. 2024-01-21 21:56:45 +11:00
Dion Moult c88496c6a6 See #4240. Fix validation issue with perspective drawing pyramid booleans. Boolean clipping results can only be used on swept solids. 2024-01-21 19:13:40 +11:00
Dion Moult 0ee07fb8cc See #4240. Fix bug where 2D arbitrary profiles were invalid IFC (used 3D point lists not 2D) 2024-01-21 16:07:00 +11:00
Dirk Olbrich 36cf458498 docs: include doxygen-awesome as git submodule 2024-01-20 14:05:50 +01:00
Dirk Olbrich e7c25bf99f docs: add README with instructions 2024-01-20 14:05:50 +01:00
Dirk Olbrich 50a3c8c2f3 docs: modify doxygen config to new folder 2024-01-20 14:05:50 +01:00
Dirk Olbrich f18298d1fd git: clean up gitignore 2024-01-20 14:05:50 +01:00
Dirk Olbrich d4770bdee3 docs: move C++ API docs to subfolder 2024-01-20 14:05:50 +01:00
Dirk Olbrich 1fb107c361 docs: include doxygen-awesome theme 2024-01-20 14:05:50 +01:00
Dirk Olbrich 0fa1e2d585 docs: remove duplicate cmake for Sphinx setup 2024-01-20 14:05:50 +01:00
Dirk Olbrich dc13f4c5cc docs: remove geom setting docs and images
- these are duplicated in /src/ifcopenshell-python/docs/ifcopenshell/
2024-01-20 14:05:50 +01:00
Dirk Olbrich d197c3f49a docs: update doxygen file to 1.9.8 2024-01-20 14:05:50 +01:00
Dirk Olbrich c05200a5c6 docs: set LOOKUP_CACHE_SIZE 2024-01-20 14:05:50 +01:00
Dirk Olbrich 235bb198da docs: update Doxyfile to v1.9.4
- specify ./output/doxygen as main path for output
- use relative paths for subfolder output
2024-01-20 14:05:50 +01:00
Dion Moult 40f332d674 Fix #3947. Do slight 2mm offset to account for Z-fighting on 2D plan views and RCPs. 2024-01-20 21:53:34 +11:00
Dion Moult e8a272dc97 Fix #4213. Allow having separate windows to trigger drawing operators. 2024-01-20 15:06:47 +11:00
Dion Moult 0b308770a6 See #4216. Document using OpenCASCADE geometry serialisation to create geometry. 2024-01-20 14:35:52 +11:00
Dion Moult 96c8323a06 Fix #4221. Only load leaf rows with cost values. Createing a monetary measure with None results in a segfault on Windows. 2024-01-20 14:17:19 +11:00
Dion Moult 25573cd0e0 Fix #4236. Consolidate revert, reload IFC, and reload selected IFC operations.
Reload IFC incrementally (via diff) is moved to the debug panel since it is a dangerous advanced user command.
2024-01-20 13:15:59 +11:00
Dion Moult ff3c7786f6 Fix #4109. Write docs about geometry serialiser. 2024-01-19 23:18:38 +11:00
Dion Moult 5f4dfcf215 Fix #4231. Bug where you couldn't add a door to an element assembly. 2024-01-19 22:47:53 +11:00
Andrej730 9a89555a53 bbim_translations.py - remove operator context from operator tooltips
noticed editing translations from ui that operator tooltip doesn't appear in ui if tooltips has `msgctxt "Operator"`
2024-01-19 16:31:34 +05:00
Dion Moult fc69a2acbe Fix #4127. Bug where IfcTester couldn't save ODS report. 2024-01-19 22:25:03 +11:00
Andrej730 85a2a5ad12 fix build error 2024-01-19 15:11:59 +05:00
Andrej730 49c3d28a0b Merge branch 'localization' into v0.7.0 2024-01-19 15:02:01 +05:00
Andrej730 a8f20b2c6b drop bpy related translations.py<->.po stuff as we won't be using it 2024-01-19 15:00:41 +05:00
Andrej730 66fa1cedd9 run bbim_translations.py without bpy 2024-01-19 15:00:41 +05:00
Andrej730 eb971d3d73 save just a final dictionary to translations.py instead of tuples
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.
2024-01-19 13:58:49 +05:00
Andrej730 a30a796c07 generate translations.py without bpy 2024-01-19 13:58:49 +05:00
Andrej730 9e46bacc12 gettext bug fix 2024-01-19 12:06:11 +05:00
Ioannis P. Christovasilis b33378e135 ifc2ca major update - todo: update readme file 2024-01-18 12:53:31 +01:00
Vukas Pajic d42e19f491 Fix #4226 2024-01-18 08:54:24 +01:00
Eduardo Schilling 2597827ab3 Roof slope as percentage property 2024-01-18 09:40:33 +11:00
Dion Moult 3f71efea6d Fix #4227. Add shapely as an optional dependency for IOS-Python 2024-01-18 09:22:35 +11:00
Andrej730 2d279b7a7f update blenderbim build to include translation data 2024-01-17 17:18:04 +05:00
Andrej730 e5fe039fd0 expose current blender locale in bbim translations ui 2024-01-17 17:18:04 +05:00
Andrej730 9e14829cc1 bbim messages parser to also parse gettext 2024-01-17 17:10:26 +05:00
Andrej730 e867602d9d keep order of strings in .pot as they were parsed and store source filepaths 2024-01-17 17:10:26 +05:00
Andrej730 aecc3d56b8 switch to our own string parser instead of blender's 2024-01-17 17:10:26 +05:00
Andrej730 e3f5d3d2b7 rename BlenderBIM translation script/addon 2024-01-17 17:10:26 +05:00
Thomas Krijnen 65f8b1a532 #4222 template kw 2024-01-17 11:10:06 +01:00
Thomas Krijnen 96b4df10ba #4222 typename keywords 2024-01-17 11:02:02 +01:00
Andrej730 98b56aea42 allow missing translations.py as not everyone will need translations for BBIM 2024-01-17 12:07:02 +05:00
Andrej730 ba6ba29da8 auto enable "Manage UI Translations" addon if it's not enabled 2024-01-16 17:34:24 +05:00
Andrej730 1112b102f7 add without-blender-way to generate translations module from po files
though it does require `bpy` module which is available only for python 3.10.
Actually, `bpy` module by itself is not necessary - we just need `bl_i18n_utils` that becomes available after `import `bpy`. So alternatively we can just download that module from Blender https://projects.blender.org/blender/blender/src/branch/main/scripts/modules/bl_i18n_utils
2024-01-16 17:06:43 +05:00
Andrej730 04b8172ea9 black format 2024-01-16 15:28:55 +05:00
Andrej730 f5f3edbc79 check if translation ui is loaded by current Blender session instead of current Blender file
as it's more reliable and thing could change after Blender restart
2024-01-16 15:27:43 +05:00
Andrej730 30029e3dc7 expose i18n path in translator UI
removed bim.open_po_directory operator as it's now available just from alt-clicking on the path browsing button
2024-01-16 15:24:03 +05:00
Andrej730 ed836f5b4a Update bbim_setup_translations.py 2024-01-16 15:18:05 +05:00
Andrej730 a88b708442 fix issues with empty paths accepted as valid paths 2024-01-16 15:15:11 +05:00
Andrej730 764c3bbb85 separate developer/translator ui 2024-01-16 15:08:55 +05:00
Andrej730 382d3f1f9f generate pot file too converting translations.py 2024-01-16 15:04:02 +05:00
Thomas Krijnen c92f607a15 #4222 sprinkle with template keywords 2024-01-16 09:56:50 +01:00
Thomas Krijnen b57b7080fd #4220 weakref to file 2024-01-16 09:44:04 +01:00
Thomas Krijnen 860ff4e513 #4220 Update file.py 2024-01-16 09:31:35 +01:00
Andrej730 3546f13593 change test addon name from localization_test 2024-01-16 11:42:34 +05:00
Dion Moult 663966e08d Fix #4089. Document support for Linux AArch64 on Conda. 2024-01-16 11:19:17 +11:00
Dion Moult f077ebdc81 Fix #4211. Minor documentation fix that clarifies upstream bug about whether qto can be assigned to types. 2024-01-16 10:56:35 +11:00
Dion Moult eb888fd116 Fix #4223. Basic lint error. 2024-01-16 10:50:43 +11:00
Dion Moult 40b6b3bf17 Fix #4224. Fix sequencing lint bugs. 2024-01-16 10:47:50 +11:00
Dion Moult 2ef2f923d0 Fix #4219. Update documentation for creating a new model. 2024-01-16 10:45:13 +11:00
Bruno Postle 75fab58831 IfcGit fixes suggested by ruff 2024-01-15 22:16:19 +00:00
Andrej730 ce26c6e19b BBIM - upgrade to IFC4X3 on loading projects
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
2024-01-15 17:39:49 +05:00
Andrej730 8728fa38b9 Migrator - basic support for migrating attributes ifc4 -> ifc4x3
And added one of the IfcProperty renamed attribute as an example
2024-01-15 17:39:49 +05:00
Dion Moult 3037795199 Fix #4139. Bulk purge orphaned classes and move advanced operators to debug panel. 2024-01-15 23:16:42 +11:00
Andrej730 39ee9cd8b1 Migrator - display some error message for unhandled schemas
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
```
2024-01-15 16:16:29 +05:00
Andrej730 b375bbf558 black format 2024-01-15 16:16:29 +05:00
Thomas Krijnen f2cae79dea #4220 Update entity_instance.py 2024-01-15 12:01:18 +01:00
Andrej730 aadc77f6b6 minor fix for bim.create_all_shapes printed messages 2024-01-15 14:44:40 +05:00
Andrej730 35223d968c semi-automatic setup for necessary directories 2024-01-15 14:43:23 +05:00
Andrej730 e106dc4502 register translations dict only if addon is already loaded 2024-01-15 13:39:27 +05:00
Andrej730 2995b73c2d open .po directory operator 2024-01-15 13:39:27 +05:00
Andrej730 770bc6ea61 Operator to disable BBIM and restart Blender
as it's needed to reload the translations

Update bbim_setup_translations.py

Update bbim_setup_translations.py
2024-01-15 13:38:34 +05:00
Andrej730 f5736a7144 convert setup_translations to blender addon for UI 2024-01-15 12:18:53 +05:00
Dion Moult b4120b1cab Fix #4173. Don't recreate boundaries of building elements that already exist.
Inline opening processing. Minor improvement to detecting attributes for int/ext and physical/virtual.
2024-01-15 15:28:52 +11:00
Dirk Olbrich f44ca67ab9 readme: fix listed ifc version, add link to IFC4x3 docs 2024-01-15 09:20:15 +11:00
Dion Moult 77eae1c8e8 Fix #4195. Forgot to add UI for contains selector. 2024-01-14 23:20:06 +11:00
Dion Moult 02d79f0687 See #4173. Prototype new approach to generating 1st level space boundaries. 2024-01-14 23:12:14 +11:00
mohamadalbaaj 83d364574a Fixing Dimension Mismatch in Matrix Multiplication 2024-01-14 15:08:08 +11:00
Dion Moult 688d2b7bd1 Minor test fix 2024-01-13 16:49:27 +11:00
Dion Moult bf35239979 Fix bug where UI didn't show applicable psets to specific predefined types 2024-01-13 16:49:02 +11:00
Dion Moult ca8e014647 Fix #4195. Fix regressions from f840da3 and add support for "contains string" comparisons. 2024-01-13 15:58:57 +11:00
Dion Moult b5f63ec4f3 Fix #4196. Settings are now saved when you save Spreadsheet export JSON files. Also a new setting to generate an SVG alongside the spreadsheet (intended to be used as a schedule placed on a sheet). 2024-01-13 15:03:51 +11:00
Dion Moult aec2141128 Minor fix 2024-01-13 00:00:58 +11:00
Dion Moult 778344c804 Fix #4197. URLs in SVG schedules are now clickable. 2024-01-12 23:44:45 +11:00
Dion Moult 3ede9b254f Fix #4199. Bug where external references on sheets weren't properly referenced leading to no names. 2024-01-12 19:48:32 +11:00
Dion Moult 8df40dc4a6 Fix #4203. Fix bug where removing nested cost items left orphaned relationships. 2024-01-12 18:14:49 +11:00
Dion Moult 75dd4f3132 Fix #4204. Add support for XLSX schedules on sheets. 2024-01-12 17:26:04 +11:00
Christoph Mellueh be11df3dc1 sort code alphabetically 2024-01-12 08:43:50 +11:00
Christoph Mellueh 09ac212aa9 improve core file for better zen 2024-01-12 08:43:50 +11:00
Christoph Mellueh e159151b44 update BsDD to match new API
+ move Functions from operator to core/tool
2024-01-11 12:00:44 +11:00
Dion Moult 27f6ac0575 Fix #4198. Minor regression in updating text literals. 2024-01-11 09:53:48 +11:00
c4rlosdias f840da3ffd Added more comparisons in search 2024-01-10 23:21:18 +11:00
sennhvi 034df852b2 Update geometry_processing.rst
Add an usage example of the parameter include  for the Geometry Iterator
2024-01-10 23:19:46 +11:00
Christoph Mellueh f242071ebb add pset view to groups 2024-01-10 23:14:33 +11:00
Sigma Dimensions (Yass) b6663e9189 fix counting elements when importing cost schedules ( and run black) 2024-01-10 09:30:03 +01:00
Dion Moult 39d143668c Fix #4186. Support different RL insertion modes when adding occurrences of a type. 2024-01-10 18:53:05 +11:00
Dion Moult 6ea1e378c5 Fix bug where updating type text literals didn't propagate and formatting rounding null values wasn't handled. 2024-01-10 14:42:14 +11:00
Dion Moult a33f30e8ce Fix #4189. Hidden or non-isolated objects now don't show annotations. 2024-01-10 12:29:56 +11:00
Christoph Mellueh e79fb2ff0b add typing to BsDD 2024-01-10 09:10:38 +11:00
Christoph Mellueh 054b4d0ee2 add deprecation warnings 2024-01-10 09:10:38 +11:00
Christoph Mellueh 43bebf4eee update new api to BsDD 2024-01-10 09:10:38 +11:00
Thomas Krijnen 532869a48a #4182 Properly initialize filename in stream_or_filename class 2024-01-09 13:41:38 +01:00
Andrej730 6569d0031f monkey patch blender's dump_addon_messages
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.
2024-01-09 16:54:58 +05:00
Andrej730 bfaa61e592 setup_translations - original dump_addon_messages
same as with dump_py_messages - this commit is needed to track monkey patch changes later on
2024-01-09 16:46:22 +05:00
Andrej730 1a09ce40e9 fix error converting translations to .po if .po files already exist 2024-01-09 16:00:21 +05:00
Dion Moult 6f1b40fc86 Fix #4162. Reduce minimum area requirement for auto space generation down to 0.1sqm. 2024-01-09 18:20:51 +11:00
Dion Moult 734eec7715 See #4162. Fix bug with generating space from cursor due to numerical inaccuracies and colinear lines for shapely. 2024-01-09 18:13:29 +11:00
Dion Moult bfabc0db0f Add support for groups in selection queries 2024-01-09 16:44:40 +11:00
Dion Moult e71aac84dc Fix #4175. Add new UI for managing IFC object and edit modes. 2024-01-09 12:57:31 +11:00
Andrej730 c156100be2 Fix breaking spatial containers UI when spatial container is deleted
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
2024-01-08 15:53:10 +05:00
Andrej 48c2b43a58 Merge pull request #4171 from c-mellueh/fix-SurfaceStyle-loader-bug
Fix Surface Style Loader Bug
2024-01-08 12:31:14 +05:00
Dion Moult 2f8cfb5a95 Fix #4161. Deprecate unmaintained barebones LCA module. 2024-01-08 16:59:31 +11:00
Eduardo Schilling 1c4cc34c1b Add degrees format display 2024-01-08 16:54:58 +11:00
Eduardo Schilling b81e03d9c2 Add stair calculated parameter Pitch 2024-01-08 16:54:58 +11:00
Dion Moult eb96858460 Fix #4167. Bug where pset template module didn't allow creating qto template types. 2024-01-08 16:52:59 +11:00
Dion Moult 5c7e70e987 Minor fix to loading nested ports 2024-01-08 16:03:57 +11:00
Dion Moult 9093c9d419 Fix #4176. Bug where tabbed interface didn't work on new or temporary screens. 2024-01-08 16:03:34 +11:00
Dion Moult 02a5b8d997 Fix #4178. Bug when removing the wrong classification reference. 2024-01-08 13:48:35 +11:00
Sigma Dimensions (Yass) f1b5f7d558 add conversion based unit symbols 2024-01-05 18:45:54 +01:00
Thomas Krijnen 742a9ecd81 IfcParseExamples requires C++17 now 2024-01-05 09:04:34 +01:00
Thomas Krijnen 77a497cdf7 Generalize shortened file.schema attribute 2024-01-04 15:05:40 +01:00
CyrilWaechter 00576ef574 IfcRelSpaceBoundary: Add error handling and better error message for user 2024-01-04 10:22:51 +01:00
Sigma Dimensions (Yass) c26caaa58d fix resource cost calculation 2024-01-04 09:33:55 +01:00
Sigma Dimensions (Yass) b260bd3877 Record formula and resource name for cost values when calculating resource cost 2024-01-04 09:32:31 +01:00
Sigma Dimensions (Yass) cd6246c382 fix cost value calculation when using parent cost 2024-01-04 09:30:27 +01:00
Sigma Dimensions (Yass) a96d6dacc7 Display cost value names, and add import operator for cost schedule panel 2024-01-04 09:29:50 +01:00
CyrilWaechter 64c711a02a IfcRelSpaceBoundary: Create almost all boundaries for a selected space
* 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
2024-01-03 16:37:10 +01:00
Christoph Mellueh 68a2480a66 turn list into tuple 2024-01-03 13:42:14 +01:00
CyrilWaechter d5e2fd5d3c Fix some url and add missing ones 2024-01-03 01:11:05 +01:00
CyrilWaechter bb445663f8 Bump IOS and use more update friendly url 2024-01-03 00:22:50 +01:00
CyrilWaechter 1f7db75572 Add python 3.11 to blenderbim build matrix 2024-01-02 20:59:04 +01:00
CyrilWaechter f478ec8d6b black boundary operator.py 2024-01-02 18:49:50 +01:00
CyrilWaechter cf3ba334b7 IfcRelSpaceBoundary: make sure parent boundary is whole 2024-01-02 18:49:05 +01:00
CyrilWaechter c36af110c4 IfcRelSpaceBoundary: Improve inner boundary generation workflow and boundary names
# 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
2024-01-02 17:52:23 +01:00
Kristoffer Andersen 91eac7085b Update meta.yaml
pin swig version for conda
2024-01-02 15:46:48 +01:00
Thomas Krijnen 239d1d6fd2 C++ get_psets() with extensive preprocessor trickery 2023-12-30 16:14:10 +01:00
Thomas Krijnen 831709d514 Update src/ifcopenshell-python/docs/ifcopenshell-python/geometry_processing.rst 2023-12-30 10:03:10 +01:00
wangsenhui 5925476ed9 add geometry processing with multiple representations example 2023-12-30 10:03:10 +01:00
wangsenhui 3edb3c8df3 add geometry processing with multiple representations example 2023-12-30 10:03:10 +01:00
wangsenhui 72badd8427 add geometry processing with multiple representations example 2023-12-30 10:03:10 +01:00
Andrej730 ff251b7a6a monkey patch dump_py_messages to ignore blenderbim dependencies 2023-12-29 17:36:12 +05:00
Andrej730 dbce57ffc5 setup_translations - original dump_py_messages
as we're going to monkey patch it and this commit is needed to keep the history of changes
2023-12-29 17:36:12 +05:00
Andrej730 8ff9bcef32 update translations in current blender session 2023-12-29 17:13:43 +05:00
Andrej730 82b2006686 setup_translations.py - use just 1 directory to store .po files
and use temp directory to store .po files for ui_translate.export/import
2023-12-29 17:13:43 +05:00
Andrej730 ca4181c714 fixed typo 2023-12-29 16:58:31 +05:00
Andrej730 3928dd7c9c BBIM - register translation strings #889 2023-12-29 15:33:38 +05:00
Andrej730 925964ee2a BBIM script to reload/export/import translation strings #889 2023-12-29 15:33:30 +05:00
Thomas Krijnen 7201df8d22 p21 binary should be uppercase 2023-12-26 14:28:45 +01:00
Andrej730 7b65108a76 ifctester - added some typing for IDE type hints 2023-12-26 16:18:08 +05:00
Andrej730 0fbe4d80c7 Clean up IfcIndexedColourMap removing representation #4138
Because we wasn't removing colour map, remove_representation was producing orphaned IfcPolygonalFaceSet that were referred by colour map.
2023-12-26 11:33:20 +05:00
Ryan Schultz 54c689d615 Applying multiple opening objects in bulk
Merry Christmas.
2023-12-25 10:33:49 -06:00
Andrej730 ab828b1a8b ifcpixeltexture tests to reflect actual order of data 2023-12-25 16:22:08 +05:00
Andrej730 8ddd349f8b Fixed issue with flipped ifcblobtexture loaded to blender 2023-12-25 16:21:05 +05:00
Andrej730 3221219f4a save ifcblobtexture and ifcpixeltexture to .blend file 2023-12-25 14:36:58 +05:00
Andrej730 36387f348e Fixed issue changing type of object creating opening in an aggregate
More: https://community.osarch.org/discussion/1888/error-after-trying-to-change-a-window-type-whose-opening-is-applied-to-an-aggregate#latest

A bit related to #3973 in case if it will be resolved
2023-12-25 11:49:06 +05:00
Andrej730 c39c6d81e3 Note on not allowing aggregates with representation #3973 2023-12-25 11:47:58 +05:00
Andrej730 e8042de1ed expose assign/unassign aggregation hotkey to bim tool ui 2023-12-25 11:03:10 +05:00
Andrej730 78fd999c53 Fix a few uses of assigning/unassigning agregation after 165262933 2023-12-25 10:38:51 +05:00
dushyant basson 91d1cb79c2 Using transformation-matrix data; Turned off world-coords; Re-using geometry of repeating IDs 2023-12-24 11:57:14 +01:00
dushyant basson 832618b84a initial camera-orientation; multiple materials in a single element; default material used from IfcGeom; improved triangle node data generation for OSG 2023-12-24 11:57:14 +01:00
dushyant basson e4ce53d548 update 2023-12-24 11:57:14 +01:00
dushyant basson 7b92b5c7e2 IFC file successfully parsed and loaded in Qt OpenGL widget 2023-12-24 11:57:14 +01:00
dushyant basson c8c08439b2 added header-guard 2023-12-24 11:57:14 +01:00
dushyant basson 3476ee8fd5 debug messages 2023-12-24 11:57:14 +01:00
dushyant basson d2f331c813 update 2023-12-24 11:57:14 +01:00
dushyant basson 9e9b294f44 Implemented: Application icons; OpenSceneGraph to handle OpenGL with Qt; devicePixelRatio() for handing render on highDPI displays; Sample 3D with handler; MouseHandler not yet working as expected (WIP) 2023-12-24 11:57:14 +01:00
Dushyant Basson f824ee8ca4 updated .ico file 2023-12-24 11:57:14 +01:00
dushyant basson 919f673108 add application file icon for macos 2023-12-24 11:57:14 +01:00
Dushyant Basson b034b40b09 application file-icon and window-icon set on ms-windows 2023-12-24 11:57:14 +01:00
dushyant basson 34f038530f Removed .clangd file from tracking and added it to .gitignore 2023-12-24 11:57:14 +01:00
dushyant basson 1c70990b06 Removed .clangd file from tracking and added it to .gitignore 2023-12-24 11:57:14 +01:00
dushyant basson 07eecad433 adding qt resources 2023-12-24 11:57:14 +01:00
Sigma Dimensions (Yass) ef87f0fe74 New Clash management panel to load IFCClash collision results 2023-12-23 09:14:08 +01:00
Sigma Dimensions (Yass) 23c2d73e8e fix smart clash group selection 2023-12-23 09:11:20 +01:00
Andrej730 0b47fb5987 Fix typo in 92cf0d9 2023-12-22 21:53:31 +05:00
Andrej730 8a1dee532b Support loading styles with IfcPixelTexture 2023-12-22 19:22:14 +05:00
Andrej730 f0c6c4ca59 Allow copying node graphs for external shaders on Blender 4.1+ #3876 2023-12-22 16:40:48 +05:00
Andrej730 92cf0d9265 remove_representation not to leave brokens refs with batch_remove #4138 2023-12-22 16:04:52 +05:00
Andrej730 7c438b6b9b Purge IfcWindow/DoorStyle/IfcTypeProduct #4137 2023-12-21 14:26:43 +05:00
Sigma Dimensions (Yass) 46454c5c94 consider unit basis for calculating resource costs #4122 2023-12-20 14:19:16 +01:00
Andrej730 73aeafb063 Fix issue renaming objects first time project was loaded after 962b8fa
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.
2023-12-20 16:51:02 +05:00
Kristoffer Andersen e06297940f Update ci.yml
Hopefully this fixes ccache
2023-12-20 12:28:24 +01:00
Andrej730 1652629332 prefix bim.assign/unassign_object to avoid operator override #4099
Co-Authored-By: Bruno Perdigão <57102715+brunoperdigao@users.noreply.github.com>
2023-12-20 13:51:26 +05:00
Andrej730 3d8de40407 Fix for 308457300
Co-Authored-By: Bruno Postle <bruno@postle.net>
2023-12-20 11:00:24 +05:00
ay-ex 308457300e fix cmake regex for used blender python version 2023-12-19 15:46:32 +05:00
Andrej730 6ef96841ac Temp disable setting paint_active_slot from external materials #4129 2023-12-19 14:38:23 +05:00
Andrej730 289b2d1e9d Less console errors if failed to find external styles library
Now:
```
Error: Error loading external style - cannot find file: 'D:\Dropbox\GitHub\OD_Textures\Closed (Encrypted)\Materials.blend'
```

Before:
```
File "\blenderbim\bim\module\style\prop.py", line 250, in update_shading_style
Error: Error loading external style - cannot find file: 'D:\Dropbox\GitHub\OD_Textures\Closed (Encrypted)\Materials.blend'
Traceback (most recent call last):
  File "\blenderbim\bim\module\style\prop.py", line 255, in update_shading_style
    bpy.ops.bim.activate_external_style(material_name=blender_material.name)
  File "L:\Games\SteamLibrary\steamapps\common\Blender\4.0\scripts\modules\bpy\ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
RuntimeError: Error: Error loading external style - cannot find file: 'D:\Dropbox\GitHub\OD_Textures\Closed (Encrypted)\Materials.blend'
```
2023-12-19 14:38:23 +05:00
Kristoffer Andersen 96db699ad2 Merge pull request #4125 from Krande/fix/convert-units
Proposal for updating IfcPatch ConvertLengthUnit.py for compatibility with boost>=1.82
2023-12-19 06:43:01 +01:00
Andrej730 6b7eec0db6 Fix #4124 2023-12-18 12:28:19 +05:00
Sigma Dimensions (Yass) 80f35d0bda Fix CSV workschedule import - handle date-related attributes more gracefully 2023-12-17 20:25:23 +01:00
Sigma Dimensions (Yass) df390a655d fix displaying derived task durations 2023-12-17 20:20:52 +01:00
krande 593fca7c3d remove ci-py-only.yml as ci.yml already does this 2023-12-17 18:42:15 +01:00
krande 9335c8a0c8 add test and update ci 2023-12-17 18:09:28 +01:00
krande eccc21277d update ci 2023-12-17 15:42:38 +01:00
krande 2ce7e16537 add fix for ci tests 2023-12-17 15:33:35 +01:00
Thomas Krijnen 49835ee303 nix build-all: don't strip non-release wrapper builds 2023-12-17 13:18:34 +01:00
krande f5500da0af remove ifc2x3 conditional in conversion utility 2023-12-16 14:18:13 +01:00
krande c9552fac29 update name of function to make its purpose more clear 2023-12-16 14:01:36 +01:00
krande b11b3b7fa8 update unit_assignment 2023-12-16 13:47:18 +01:00
krande 8aecee5836 initial proposal for updating units conversion 2023-12-16 13:37:38 +01:00
Bruno Postle 2f3b3011ec BlenderBIM IFC Git set push.autoSetupRemote
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
2023-12-15 23:26:52 +00:00
Andrej730 491c9203b0 test for loading ifc with blob textures 2023-12-15 18:19:59 +05:00
Andrej730 7f2b996d23 test for loading ifc style to blender material 2023-12-15 18:19:59 +05:00
Andrej730 d2ea6f6656 BBIM to support loading IfcBlobTexture 2023-12-15 18:19:59 +05:00
Andrej730 25128e8aa8 support to add all surface style types creating new IfcSurfaceStyle
Previously it was working only for shading styles, for other styles it worked but then produced errors as IfcSurfaceStyle.Styles end up being None.
2023-12-15 18:19:59 +05:00
Dion Moult 30fa917e69 Patch recipes can now be performed in-place and are sorted in the UI. 2023-12-15 23:09:34 +11:00
Dion Moult 40e494996d Add support for manual classifications and references 2023-12-15 23:09:34 +11:00
Andrej730 cfdc54064e disable rel paths for adding ref images and textures with unsaved .ifc 2023-12-14 18:53:54 +05:00
Andrej730 6daead6b61 Fixed issues using relative paths for external styles
- 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)
2023-12-14 18:47:55 +05:00
Andrej730 241d52f0ad small error message fix
as it appears as one of the messages during .ifc load, that way it will be more clear that it's related to external styles
2023-12-14 18:43:17 +05:00
Andrej730 68dd93da1d Fix issue BrowseExternalStyle not selecting current external style in file manager 2023-12-14 17:43:12 +05:00
Andrej730 82703670f0 Pull all shading related material attributes from external styles #4053 2023-12-14 17:42:17 +05:00
Dion Moult cb8462a0d0 New SetWorldCoordinateSystem patch. Autodesk software is starting to pay attention to this attribute which I find really confusing. 2023-12-14 17:02:00 +11:00
Dion Moult 000245c26c Nesting collections only generate for element nesting, not port nesting 2023-12-14 16:50:56 +11:00
Andrej730 d97ee8eed4 Support editing IfcSurfaceStyleLighting in UI 2023-12-13 16:57:23 +05:00
Andrej730 f8af28f12a style.edit_surface_style to support editing IfcSurfaceStyleLighting
It was failing because api method wasn't supporting IfcColourRgb attributes edit in general but only for IfcSurfaceStyleShading.SurfaceColour
2023-12-13 16:53:58 +05:00
Andrej730 f6fab30d0a Support editing IfcSurfaceStyleRefraction in UI 2023-12-13 15:16:52 +05:00
Andrej730 f1a4ed702b Hide IfcStyledItem from bim.print_unused_elements_stats
as IfcStyledItem can be not referred by any other element and it doesn't mean it's not used in the project
2023-12-13 14:29:10 +05:00
Andrej730 c4080626df style.add_surface_texture to work without blender material provided 2023-12-13 14:07:48 +05:00
Bruno Postle a8078e38d2 Fix Clipping divide error (reported in #4057) 2023-12-12 22:15:59 +00:00
Andrej730 c52fe8abf9 data.py rename for consistency 2023-12-12 16:14:19 +05:00
Andrej730 b310b5aaba Remove old external styles UI from material in favor of general styles UI
Adding external styles from other styles now also moved to general styles UI - https://i.imgur.com/uEyjKVY.png
2023-12-12 16:12:55 +05:00
Andrej730 7246e75085 Fix after 2520a9305 2023-12-12 15:32:40 +05:00
Andrej730 48c0378bff Fixed #4105 2023-12-12 14:48:04 +05:00
Andrej 91c90e7b86 Merge pull request #4095 from c4rlosdias/v0.7.0 2023-12-12 14:09:14 +05:00
Thomas Krijnen 72abdb0569 Update build-all.py - py vers 2023-12-11 16:00:36 +01:00
Andrej730 7947ba4aaf Override some more blender scene panels #3842 2023-12-11 16:35:21 +05:00
Andrej730 2520a93055 Fix issues unregistering overridden panels
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`.
2023-12-11 16:35:21 +05:00
Andrej730 fa480d99a2 Procedural override for default blender panels, hide keying panels #3842
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.
2023-12-11 16:35:21 +05:00
Bruno Postle 72c057e7a0 BlenderBIM user docs update after 6452872 2023-12-10 22:13:05 +00:00
Carlos Dias 61cfb361fa Update __init__.py
Fix bug
2023-12-08 11:09:28 -03:00
Andrej730 3786cfa666 Fixed issues with linked elements from linked blend files #4081
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.
2023-12-08 18:38:09 +05:00
Andrej730 cabc06821f test for tool.Blender.copy_node_graph #3876 2023-12-08 16:58:11 +05:00
Dion Moult f9fef4f5f6 Fix #4085. Classification reference URIs now have a button you can jump to that link. 2023-12-08 16:35:46 +11:00
Dion Moult 7c89d072e2 Fix #4086. Add support for non predefined bSDD pset and qto values. 2023-12-08 15:07:46 +11:00
Dion Moult dbb9e8c907 Fix #4092. Minor bug with bad detection of text literals when switching geometry. 2023-12-08 14:03:46 +11:00
Dion Moult 2df5b4c70e Fix #4090. Bug where profile set generator didn't accommodate optional axes. 2023-12-08 12:17:48 +11:00
Andrej730 a5aa608240 Fix reference images import after styles ui change 2023-12-07 18:09:17 +05:00
Andrej730 f7454366cc Representation Items UI - replace icon for active style
Now it's more consistent because we use the same icon is Styles UI
2023-12-07 18:09:17 +05:00
Andrej730 f773480917 style.edit_surface_style - fix crash setting attribute to None
Occured on setting IfcColourOrFactor attribute to None (e.g. DiffuseColour).
2023-12-07 18:09:17 +05:00
Andrej730 89f9cd0403 Styles UI - moved UI from shader graph N-panel to Styles UI #3912
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
2023-12-07 18:09:16 +05:00
Martin15135215 b21159c6b3 add cff for ifcsverchok 2023-12-07 13:42:32 +11:00
Martin15135215 227f556669 add cff for serializers 2023-12-07 13:42:32 +11:00
Martin15135215 42bd69929c add cff for qtviewer 2023-12-07 13:42:32 +11:00
Martin15135215 a3532b24b3 add cff for ifcwrap 2023-12-07 13:42:32 +11:00
Martin15135215 5486c4c8e9 add cff for ifctester 2023-12-07 13:42:32 +11:00
Martin15135215 0259d4c0cd add cff for ifcpatch 2023-12-07 13:42:32 +11:00
Martin15135215 66c4c61dc2 add cff for ifcparse 2023-12-07 13:42:32 +11:00
Martin15135215 0f32ffe232 add cff for ifcopenshell-python 2023-12-07 13:42:32 +11:00
Martin15135215 72630de77a add cff for ifcmax 2023-12-07 13:42:32 +11:00
Martin15135215 9395bed72b add cff for ifcjni 2023-12-07 13:42:32 +11:00
Martin15135215 507a5cab83 add cff for ifcgeom_schema_agnostic 2023-12-07 13:42:32 +11:00
Martin15135215 a46a60996d add cff for ifcgeom 2023-12-07 13:42:32 +11:00
Martin15135215 3106168889 add cff for ifcfm 2023-12-07 13:42:32 +11:00
Martin15135215 7e0c0c5c83 add cff for ifcdiff 2023-12-07 13:42:32 +11:00
Martin15135215 19205c8774 add cff for ifccsv 2023-12-07 13:42:32 +11:00
Martin15135215 62b5f1d728 add cff for ifcconvert 2023-12-07 13:42:32 +11:00
Martin15135215 299df62758 add cff for ifcclash 2023-12-07 13:42:32 +11:00
Martin15135215 e58bfde500 Add cff for ifccityjson 2023-12-07 13:42:32 +11:00
Martin15135215 b60306cdbd add cff for ifcblender 2023-12-07 13:42:32 +11:00
Bruno Perdigão 61e0549e65 add_aggregate now add the empty using the 3d cursor location 2023-12-07 13:40:16 +11:00
Ryan Schultz 52ae759218 Added classification to selector 2023-12-07 13:39:42 +11:00
c4rlosdias 9b41614eff Update Load bSDD domains 2023-12-07 13:38:25 +11:00
Dirk Olbrich 58e01751c1 bbim-docs: add interface property editor section
- add stubs for each sub-tab
2023-12-07 13:19:46 +11:00
Dirk Olbrich 624134d033 bbim-docs: use figure with caption instead of plain image 2023-12-07 13:19:46 +11:00
Dirk Olbrich 22f83b68e4 bbim-docs: update workspace doc for sidebar panels 2023-12-07 13:19:46 +11:00
Dion Moult 1b35ea122e Implement support for managing nest hosts and components. 2023-12-07 13:19:29 +11:00
Ryan Schultz f1deefbcb3 Merge pull request #3969 from brunoperdigao/refactor-duplicate-aggregate
Refactor duplicate aggregate
2023-12-06 14:39:43 -06:00
Dion Moult d6c020b5ee Fix #4076. Fix bug where drawing activation priorities didn't match drawing generation priorities, and switching to a text literal representation failed. 2023-12-06 23:04:21 +11:00
Dion Moult ff4eddf38a Fix #4078. Bug in IfcTester that didn't allow certain facets to be used as applicabilities. Also canonicalise facet ordering for convenience. 2023-12-06 15:06:11 +11:00
Dion Moult 2b34dc4ce7 Fix bug in TessellateElements patch recipe where sometimes the patch would run forever. 2023-12-06 14:16:18 +11:00
Dion Moult 530260ebe7 Run black on cityjson2ifc 2023-12-05 09:54:38 +11:00
Dion Moult 594268c860 Fix two minor bugs in cityjson2ifc 2023-12-05 09:54:38 +11:00
Andrej730 e5fa8a01b4 fixed couple styles ui bugs
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
2023-12-04 17:38:22 +05:00
Andrej730 ad934cd9a6 Use paths relative to .ifc instead of .blend choosing texture paths
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
2023-12-04 16:42:31 +05:00
Andrej730 92fe325816 Store reference images by relative paths #3447 2023-12-04 16:42:31 +05:00
Andrej730 818bb9c823 Fix normals for generic parametric stairs #4020
Also made concrete stair normals defined more explicitly.
2023-12-04 16:42:30 +05:00
Andrej d71fad988d Merge pull request #4071 from maxfb87/fix_clone_opening 2023-12-04 16:39:34 +05:00
Dion Moult ff0d6c810f Fix #4072. IDS reports now include filename. 2023-12-04 17:26:57 +11:00
Dion Moult 8b72929d22 Fix #4073. Objects with no applicable context for the drawing view are now hidden. 2023-12-04 12:47:07 +11:00
Bruno Postle 6452872e83 BlenderBIM IFC Git allow branch creation from HEAD
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)
2023-12-03 16:15:09 +00:00
Ryan Schultz 88d2c61453 Merge pull request #3906 from IfcOpenShell/si_unit_w_cad_tools
allow SI with CAD tools.
2023-12-03 09:59:14 -06:00
Bruno Postle f777be6403 BlenderBIM IFC Git fix typo in function name 2023-12-02 23:59:07 +00:00
Massimo Fabbro 9aad249586 fix #3834. Now clone opening produces valid IFC files 2023-12-02 17:38:28 +01:00
Thomas Krijnen 7168f8eeff #2796 don't fail on null guid for rooted element deletion 2023-12-01 15:49:31 +01:00
Andrej730 da306c6141 Reference images attached to the drawings #3447
You can also save them as annotation types.
Example - https://imgur.com/a/6trT7SZ
2023-12-01 17:05:02 +05:00
Andrej730 e53c0b74b1 bim.update_representation to save non-body representations styles #3447 2023-12-01 16:53:50 +05:00
Andrej730 cb2f58ba0f Fixed issue importing drawing's IfcAnnotations with styles #3447 2023-12-01 16:53:50 +05:00
Andrej730 c0c7727f36 fix poll errors 2023-12-01 16:53:50 +05:00
Andrej730 60526e62b4 Revert "Minor fix - remove redundant code"
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. 😬
2023-12-01 16:53:50 +05:00
Andrej730 496e58418a fixed typo 2023-12-01 16:53:50 +05:00
Thomas Krijnen b976ad3880 occ_utils.py - #1037 2023-12-01 12:42:09 +01:00
MicheleBenedetti 31a763fe12 mistype-fix 2023-12-01 10:34:11 +11:00
Andrej730 93ef2d0349 Fixed issues applying arrays
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
2023-11-30 16:24:39 +05:00
Andrej730 7828508179 Minor fix - remove redundant code
style assignment was already done by `bim.add_style`
2023-11-30 10:41:57 +05:00
Dion Moult 7aa6be8e8a FixRevitTINs patch now also flips normals for surface TINs instead of solid TINs.
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.
2023-11-30 14:58:32 +11:00
Andrej730 0679956add bim.add_reference_image #3447
Added operator to load image references as planes that will be stored in IFC.

Button location - https://i.imgur.com/L87BPyX.png
Example - https://imgur.com/a/JJXyU6C
2023-11-29 17:23:27 +05:00
Andrej730 b86f924543 move all operators added to "add mesh" menu to common method in ui.py 2023-11-29 15:12:33 +05:00
Dion Moult 962b8fac67 Fix #4049. New basic "regenerate occurrence name" operator. 2023-11-29 17:36:59 +11:00
Dion Moult fdcb705551 Fix #4054. You can now select objects based on diff results. 2023-11-29 16:27:20 +11:00
Dion Moult b80ca3c167 See #4054. Diffing now allows partial loading of changed elements to make it easier to visualise without loading and linking two models. 2023-11-29 15:57:59 +11:00
Dion Moult e8bd272189 Fix #4057. Data objects for the API are now in util.data instead of mixed into the shape builder utility and only depends on numpy. 2023-11-29 14:36:01 +11:00
Bruno Postle 25bd94e84a minor documentation typo fix 2023-11-28 23:28:38 +00:00
Bruno Postle 5face7170f Fix python 3.12 SyntaxWarning (#4045)
Regular expressions now need to be double-escaped:
https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
2023-11-28 22:51:58 +00:00
Dion Moult 434a11a502 Fix #4057. Move clipping info dataclass to util.shape_builder 2023-11-29 09:28:24 +11:00
krande eb91f5179b suggested change of ifcwrap pythoninterpreter function to no longer rely on distutil (which is deprecated in python 3.12). 2023-11-28 15:03:31 +01:00
Andrej730 c6643da4ba created uv map to have constistent name with Blender uvs
Previously it was named "Float2"
2023-11-28 16:01:10 +05:00
Andrej730 18c93a13ec moved load_texture_map to tool.Loader, added a test 2023-11-28 15:53:40 +05:00
Andrej730 7cb582de5d bim.save_uv_to_style - experimental operator to save current uv to ifc
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
2023-11-28 15:53:40 +05:00
Andrej730 a5bb458d3d fixed issue importing uv failing for some IfcPolygonalFaceSets
It was failing with IfcIndexedTriangleTextureMap + IfcPolygonalFaceSet
2023-11-28 15:34:21 +05:00
Andrej730 c7f6a5e621 fixed issue importing uv on non meters projects 2023-11-28 12:17:31 +05:00
Andrej730 141e0240d4 fixed issue settings style blender props if there are not texture style 2023-11-28 12:17:30 +05:00
Andrej730 15cd2b6075 fixed issue with importing ifc objects with uv after 03a6ee912 2023-11-28 12:17:30 +05:00
Dion Moult fab8b5b702 Fix #3059. Implement IfcTester prohibited string templates (taking into account double negatives) 2023-11-28 17:20:20 +11:00
c4rlosdias 844f4c4944 Update IfcTester and Tester module of Blenderbim 2023-11-28 16:48:19 +11:00
Dion Moult 03809b3d5e Fix #3996. Reassigning occurrences or types now also reassigns the correlating occurrence or type. 2023-11-28 16:44:31 +11:00
Dion Moult 3e268be5c7 Fix #4052. Bug where invalid plane was generated due to missing X axis. 2023-11-28 11:52:56 +11:00
Dion Moult 6e932ec2fb Fix #3974. Bug where orphaned histories would be left in API remove operations. 2023-11-28 10:46:03 +11:00
Kristoffer Andersen 58414777be Update installation.rst
add more information about conda package installation
2023-11-27 10:25:11 +01:00
Dion Moult 14f1acadb7 See #3974. WIP review to ensure history removal in API. 2023-11-27 18:31:55 +11:00
Andrej730 f215670381 Small styles UI tweaks
- 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
2023-11-27 12:29:28 +05:00
Andrej730 11df5065e4 bim.validate_ifc_file to detect if there where no validation errors 2023-11-27 11:18:38 +05:00
Dion Moult ed47b6b227 Fix #4044. Bug where object in camera view algorithm was wrong. Simplied to simple AABB test. 2023-11-25 16:02:51 +11:00
Andrej730 6216ee9a98 Fixed issue duplicating IfcRelSpaceBoundary #4043 2023-11-24 20:37:23 +05:00
Andrej730 848d6b294e Fixed console errors with BIM Tool when boundary object is selected 2023-11-24 20:24:25 +05:00
Andrej730 795a372ac9 test creating surface style without IFC entities 2023-11-24 16:49:02 +05:00
Andrej730 03a6ee9121 BBIM Shader Graph Settings - setting uv mode for the textures
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.
2023-11-24 15:52:31 +05:00
Andrej730 5299a9d8a2 Fixed issue updating texture style for non-faceset representations 2023-11-24 15:24:56 +05:00
Kristoffer Andersen a5d5d72064 Update meta.yaml
add python version to conda build string
2023-11-24 09:29:34 +01:00
Kristoffer Andersen b6f2a76385 Update ci-ifcopenshell-conda-daily.yml
add anaconda-client to the mamba env dependencies
2023-11-24 08:30:05 +01:00
Dion Moult ea6c8fe2f8 Fix #4027. Fix regression where S-D or A-D hotkeys didn't follow vanilla Blender behaviour from 81a1bd9 2023-11-24 15:09:29 +11:00
Dion Moult c7268b6f42 Fix #4037. IfcTester reports now also include an element type column. 2023-11-24 14:44:28 +11:00
Dion Moult 5937ed4b63 Fix #4034. Bug where abstract pset template applicabilities didn't apply to occurrences as well as types. 2023-11-24 14:02:27 +11:00
Bruno Postle 8f650c56e5 Revert 1d972a6 as no datetime.UTC on CI server 2023-11-23 21:59:23 +00:00
Bruno Postle 1d972a6a6f fix python 3.12 utcnow() deprecation warning
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).
2023-11-23 21:16:24 +00:00
Bruno Postle 70a1d7d345 python api documentation fix 2023-11-23 21:15:24 +00:00
Kristoffer Andersen 519d59effe Update ci-ifcopenshell-conda-daily.yml 2023-11-23 20:38:11 +01:00
Kristoffer Andersen 7f5f67b131 Update meta.yaml 2023-11-23 20:35:28 +01:00
Kristoffer Andersen 8c64d9ddcc Update ci-ifcopenshell-conda-daily.yml
Update repo activation
2023-11-23 17:23:01 +01:00
Kristoffer Andersen 397f333db0 Merge pull request #4041 from Krande/v0.7.0-conda/update
V0.7.0 conda/daily-builds-update
2023-11-23 17:17:16 +01:00
krande b01bd8afb3 only modify windows in CMakeLists.txt 2023-11-23 16:05:00 +01:00
krande 1dd8624825 need to use a push trigger on fork (dispatch is not allowed on PR from forks it seems). 2023-11-23 15:55:23 +01:00
krande bc0c2e641b make modifications to support conda hdf5 1.14 in CMakeLists.txt 2023-11-23 15:51:41 +01:00
krande f5f68ea150 add a workflow dispatch trigger (lets you click a button in the github actions workflow panel to start a new build) 2023-11-23 15:39:24 +01:00
krande 76ce117b46 test one more time on my fork before merging 2023-11-23 15:37:41 +01:00
krande 52cad9d11c pin windows hdf5 to 1.12
windows hdf5 1.14 results in ninja: error: 'libhdf5_cpp.lib', needed by 'IfcConvert.exe', missing and no known rule to make it
2023-11-23 15:30:41 +01:00
krande 58af81e256 drop "all" variant for now. Will include if people request it. 2023-11-23 15:17:59 +01:00
krande fc2da4ee8f add conda-forge as a channel 2023-11-23 15:11:46 +01:00
krande c04fa12051 add mamba env name 2023-11-23 15:09:24 +01:00
krande 623d2b5be1 add matrix variant to workflow name and do not use conda env yml file 2023-11-23 15:06:56 +01:00
krande 46319634fb run it once on fork 2023-11-23 15:05:17 +01:00
krande 91d2e5ccd1 add novtk/all variants to daily builds 2023-11-23 14:58:34 +01:00
Bruno Perdigão d23e32c64a added report messages 2023-11-23 10:57:17 -03:00
Kristoffer Andersen 764efa1fed Update ci-ifcopenshell-conda-daily.yml
add missing multiline flag for condarc setup
2023-11-23 14:33:10 +01:00
Kristoffer Andersen b051adcc6c Update ci-ifcopenshell-conda-daily.yml
change from deprecated mamba provisioner and move to python 3.11 and 3.12
2023-11-23 14:31:53 +01:00
Bruno Perdigão b815719477 added the option to refresh different groups of linked aggregate 2023-11-23 10:27:54 -03:00
Gorgious56 0612d2b615 You can now select the same ifc classes and match predefined types with SHIFT + Clicking the "Select Ifc Class" button 2023-11-23 09:52:37 +01:00
Andrej730 0da210b732 edit_object_placement optimization for objects with subchildren #4035
1) We were iterating over same subchildren 2 or more times.
2) There is no need to change subchildren position at all since their parent position is already adjusted.

Explained here in detail - https://github.com/IfcOpenShell/IfcOpenShell/issues/4035#issuecomment-1822824352
2023-11-23 13:43:39 +05:00
Dion Moult 9429e478fe Fix #3691. Add toggle for power users to disable the BIM toolbar if an IFC isn't loaded. 2023-11-23 14:59:26 +11:00
Dion Moult 2f6c50d9c2 New style manager supports basic editing of externally defined surface styles 2023-11-23 13:17:33 +11:00
Dion Moult 640341715c Minor IfcPatch doc fix where examples had a missing argument 2023-11-23 12:07:29 +11:00
Dion Moult 42878e325e Minor fix to "select multiple IFC class" implementation 2023-11-23 11:18:04 +11:00
Dion Moult ac5cf95f9e IfcFM panel now autodetects available engines with names and descriptions 2023-11-23 11:00:10 +11:00
Ryan Schultz c9189055c7 Select all objects from multiple selected classes 2023-11-22 10:47:04 -06:00
Andrej730 6a08993f5e fill userdefined type field during reassigning IFC class #4034
to avoid confusion
2023-11-22 15:01:36 +05:00
Andrej730 df2a50b335 store path to bcf in Blender file to reaccess it on Blender restart
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.
2023-11-22 11:55:07 +05:00
Dion Moult c7543ff48d New graphical element filtering UI for drawing filters that lets you also use saved searches. 2023-11-22 15:33:30 +11:00
Dion Moult 1f75fa09ae If there is a Blender offset, show the non-offset placement in the placement panel 2023-11-22 11:32:14 +11:00
Dion Moult 94ce8e2c9c Fix bug when loading IFC with unsupported reflectance method (even though we don't fully support them yet) 2023-11-22 11:00:47 +11:00
Dion Moult 85e94d2cfc Move georeferencing calculator panel until scene georeferencing panel.
Slowly all the N sidebar panels should be moved away.
2023-11-22 11:00:47 +11:00
Andrej730 c2b332da48 BCF Viewpoint - clear selection before hiding IfcSpaces #4031 2023-11-21 22:12:26 +05:00
Andrej730 6ee4edd0a0 Fixed issue reassigning class to type class with userdefined type #4018
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.
2023-11-21 12:35:35 +05:00
Dion Moult 0d757027e3 Fix critical georeferencing autodetection regression due to refactor of new context filters. 2023-11-21 15:10:01 +11:00
Dion Moult 9ffe56e64d Improve geometry guessing to also check placements of random sample of elements (not just site and building), not just geometry 2023-11-21 14:21:09 +11:00
Dion Moult 37a9a1b5d9 New IfcPatch recipe to tessellate elements to account for bugs in other vendors. 2023-11-21 14:21:09 +11:00
Dion Moult c30c9d50c9 Fix missing LGPL license blocks in IfcPatch 2023-11-21 14:21:09 +11:00
Bruno Perdigão 8e64b55290 bugfix in recreate_aggregate 2023-11-20 22:05:41 -03:00
Bruno Perdigão b45001a95a fix conflicts 2023-11-20 18:40:17 -03:00
Bruno Perdigão fd65009f5a Refresh Linked Aggregate now handles multiple selection 2023-11-20 18:34:46 -03:00
Bruno Perdigão 52036e9bd4 merged the branch 'improvements-on-override-duplicat' 2023-11-20 16:38:10 -03:00
Bruno Perdigão 5399767898 Merge branch 'improvements-on-override-duplicate' into refactor-duplicate-aggregate 2023-11-20 16:24:16 -03:00
Bruno Perdigão f96d477d2b Groups are only added to the parent. Parts now have a pset with index 2023-11-20 16:23:34 -03:00
Andrej730 d5f3991d06 Fixed more overlooked context overrides... #3876 2023-11-20 15:13:54 +05:00
Andrej730 2f2e81f585 Fixed #4026 related to #3876 2023-11-20 14:47:06 +05:00
Andrej730 0b7442b288 Move code using ui index from data to ui #4028
As UI indices changes doesn't trigger data.py updates and information on screen is not synced with the active item anymore.
2023-11-20 12:24:06 +05:00
Dion Moult 229c7285c2 Add support for loading nested elements and consider nesting for indirect spatial containment. 2023-11-20 16:57:38 +11:00
Dion Moult 4fb99d2eed Don't unnecessarily merge materials which can be very computationally consuming on file loads (e.g. from software like Solidworks) which will be made redundant now that a new materials/style management system is WIP. 2023-11-20 16:57:38 +11:00
Dion Moult 123557939f New ConvertNestToAggregate patch recipe 2023-11-20 16:57:38 +11:00
Bruno Postle 3c396d3180 IfcGit.load_project() can be used to refresh scene
If no file path is given, clear blender objects and regenerate
the scene from the current ifc project in IfcStore
2023-11-19 10:49:58 +00:00
Massimo Fabbro 5d39603308 fix #4011. More precise IfcRoof qto calculator 2023-11-17 16:39:29 +01:00
Massimo Fabbro b792673f88 Minor fix 2023-11-17 16:14:08 +01:00
Massimo Fabbro cf65612a96 Covering Tool: fixed bug if the project is defined in units different from SI units 2023-11-17 16:14:08 +01:00
Andrej730 50bbe849ff minor fix to support union typing before python 3.10 #3774 2023-11-17 18:57:51 +05:00
Andrej730 dc438b2560 ClippingInfo util class to pass and apply plane clippings #3774
Co-Authored-By: Carlos Villagrasa <carvillasil@gmail.com>
2023-11-17 16:52:59 +05:00
Andrej730 6750dd927c minor fixes
- 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
2023-11-17 12:30:34 +05:00
Andrej730 9fb1986cad minor fix - clean up after debug 2023-11-16 19:26:12 +05:00
Andrej730 60f8d30fc1 Tests for connecting mep elements and regenerating them
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
2023-11-16 19:15:56 +05:00
Ryan Schultz 67be2e8ce8 Refresh different types of aggregates at one time 2023-11-15 21:40:15 -06:00
Andrej730 2557580500 Fixed error importing .ifc that has element aggregated by ifcproject
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'
```
2023-11-15 18:33:20 +05:00
Andrej730 c0d2ac6ff9 Assigning product from selected objects #4015 2023-11-15 17:12:08 +05:00
Dion Moult 52c168051e Revert "You can now override custom category element functions in IfcFM"
This reverts commit 8a63275db0.
2023-11-15 17:19:10 +11:00
Dion Moult e072da8d65 Minor alignment of Basic FM preset to IFC property naming 2023-11-15 16:47:42 +11:00
Dion Moult 8a63275db0 You can now override custom category element functions in IfcFM 2023-11-15 16:35:46 +11:00
Dion Moult 69be3a005c Minor bug fix to COBie 2.4 space descriptions 2023-11-15 15:59:24 +11:00
Dion Moult ad9ad3f060 Purge data recipe now also purges shape aspect names and layers. 2023-11-15 14:22:21 +11:00
Bruno Perdigão f0e5304b8e fix conflicts merging with v0.7.0 2023-11-14 11:58:35 -03:00
Andrej730 c6454803ee fixed issue adding bend between segments located at the same point
also added some tests
2023-11-14 17:18:57 +05:00
Andrej730 e8aa8c44e5 Fixed issue with UI for types withotu PredefinedType after 1621449
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'
```
2023-11-13 16:56:58 +05:00
Andrej730 48b237ab54 New context override method for setting viewport tools #3876 2023-11-13 15:51:50 +05:00
Andrej730 608b3e5401 DumpSlabPlaner.change_thickness to use si units #4004
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`.
2023-11-13 15:38:08 +05:00
Andrej730 c5d38227fc black format 2023-11-13 14:25:34 +05:00
Andrej730 e98ff136c2 Merge two Services sections in Services and Systems tab #4001
Two similar sections were needed in the old ui before we added tabs
2023-11-13 14:25:09 +05:00
Ryan Schultz 02ebc80525 closes #4006: automatically update the geometry of all the objects that have 'similar openings'. 2023-11-12 12:39:44 -06:00
Ryan Schultz 66431158b5 fixes #3908: Close the opening (bim.edit_openings) while having the opening selected 2023-11-12 10:11:13 -06:00
VDobranov dd044c8516 Update reference_structure.py
A mistype in docs: should be IfcRelReferencedInSpatialStructure instead of IfcRelContainedInSpatialStructure
2023-11-11 12:56:26 +01:00
Massimo Fabbro 55763ea7df Covering Tool now it is possible to add ceiling coverings from selected walls 2023-11-10 22:19:47 +01:00
Andrej730 8fe92e810f show mep regenerate and connecte elements for non-profile based elements 2023-11-10 16:28:44 +05:00
Andrej730 c26988b292 root.remove_product to remove IfcRelFlowControlElements 2023-11-10 12:10:22 +05:00
Andrej730 46e70c92c5 fixed issues with ports ui on undo
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
2023-11-10 11:39:49 +05:00
Andrej730 325c3665d9 UI for assigning controls to flow elements #3981
Example - https://imgur.com/a/CZQIoHp
2023-11-10 11:18:52 +05:00
Andrej730 9a80dc14e9 api for assigning/unassigning flow controls #3981 2023-11-09 17:34:26 +05:00
Andrej730 6bda066e1b Fixed typo in control.assign_control, added tests 2023-11-09 15:33:31 +05:00
Andrej730 912b01587b tool.System.add_ports tests 2023-11-08 18:01:30 +05:00
Andrej730 5d4d953320 fixed issue placing ports on a bend if start segment is bending using Z- 2023-11-08 16:54:05 +05:00
Andrej730 11ed8cc787 fixed issue in add_ports mutating object's matrix
inherently modifying ports positions in some cases
2023-11-08 16:49:31 +05:00
Dirk Olbrich d1a7b99eda bbim docs: add user interface subsection, general workspace 2023-11-08 22:12:40 +11:00
Dirk Olbrich 85bdeaeef4 bbimdocs: reorder images folder in users section 2023-11-08 22:12:40 +11:00
Dirk Olbrich a5f0de4d19 bbim docs: reorder images folder in dev section 2023-11-08 22:12:40 +11:00
Dirk Olbrich cb3392ec70 bbim docs: use absolute path for icon images 2023-11-08 22:12:40 +11:00
Dirk Olbrich 1dbe42061d bbim doc: fix list indentation 2023-11-08 22:12:40 +11:00
Dirk Olbrich a024d5c07f bbim docs: fix minor warning in ux-guidelines 2023-11-08 22:12:40 +11:00
Dirk Olbrich ea5e3c30b6 bbim docs: update bbim version, copyright year 2023-11-08 22:12:40 +11:00
Andrej730 ebfc8ef619 remove BIMGroupProperties.is_adding attribute to avoid confusion
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.
2023-11-08 15:13:49 +05:00
Andrej730 c0d8467154 define inherited ports attributes in bim.add_constr_type_instance 2023-11-08 14:19:36 +05:00
Andrej730 d0adbab9c2 fixed issue finding finding compatible fitting
it occured sometimes when segment's or fitting's PredefinedType/System were not defined
2023-11-08 12:21:50 +05:00
Andrej730 8e80f456cb fixed bug with system decoration data if no system were selected 2023-11-08 11:50:05 +05:00
Bruno Perdigão 61bd98e7db moved 'recreate_assembly' to tool/root.py 2023-11-07 18:28:43 -03:00
Bruno Perdigão 4bf0d9ccff added more tests 2023-11-07 18:19:42 -03:00
Bruno Perdigão 1e36ac8740 removed the pset and added group to all elements 2023-11-06 21:38:06 -03:00
Bruno Perdigão af864e8556 added test scenario for duplicating an aggregate 2023-11-06 12:15:31 -03:00
Andrej730 8cd9fb9015 test stairs calculated params 2023-11-06 15:56:33 +05:00
Andrej730 d9fdc0908a Nosing Lengths / Tread Gap for parametric stairs #3422
Example - https://imgur.com/d8PxLV4
2023-11-06 15:35:14 +05:00
Ryan Schultz a218ce5160 Select multiple arrays at one time, from various parts. Deselect non-compliant objects. 2023-11-04 11:35:30 -05:00
Igor.Sokolov b3a6b8e07f bf: IfcBSplineCurve is an isntance of abstract entity 2023-11-04 15:41:38 +01:00
Igor.Sokolov 52700452d9 bf: pass-valid-selected-enumeration.ifc 2023-11-04 15:41:38 +01:00
Igor.Sokolov aab011f7bf bf: pass-group-1-rels-IFC2X3.ifc failed 2023-11-04 15:41:38 +01:00
Igor.Sokolov 5f129e2357 bf: pass-attr-count-ok.ifc failed 2023-11-04 15:41:38 +01:00
Dion Moult 4e76f36af1 Black 2023-11-04 16:07:40 +11:00
Dion Moult 6f3ff51d91 Docs now mention historic builds 2023-11-03 22:45:42 +11:00
Dion Moult 0de0422c2e Minor fix 2023-11-03 22:45:42 +11:00
Andrej730 98de86e0ba Customize tread width for the first and last treads #3419
Available on all types of stairs, shouldn't break stairs previously created with BBIM.
Example - https://imgur.com/a/2wSueTM
2023-11-03 16:32:14 +05:00
Andrej730 142e41b3ad minor refactor 2023-11-03 16:32:14 +05:00
Andrej730 1e0dc7749d add force depsgraph update method 2023-11-03 16:32:14 +05:00
Andrej730 0f29de0391 skip black format on type manager template description for readibility 2023-11-03 16:32:14 +05:00
Andrej730 9933cc1b20 stair profile generation code refactor
hopefully it's now a bit more readable
2023-11-03 16:32:14 +05:00
Andrej730 fa6192e9bc Fixed stair calculated params not updating during edit (after 8b23c615c)
.data doesn't update on props change, so need to take data from props explicitly when BIMStairProperties.is_editing
2023-11-03 16:32:14 +05:00
Andrej730 bfd4559da8 move generate_stair_2d_profile to tool, add tests 2023-11-03 16:32:14 +05:00
ceegartner 01f52e069e Update unit.py - convert function, case issue
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!
2023-11-03 11:47:44 +01:00
Dion Moult 2fbc9e4424 Forgot rabbit branding. 2023-11-02 15:15:04 +11:00
Dion Moult ba97da20eb New data purging IfcPatch recipe 2023-11-02 14:59:18 +11:00
Dion Moult 44f5be142f Fix #3963. Bind IFC separate to P hotkey and prevent separation on non-IFC meshes. 2023-11-02 13:03:56 +11:00
Dion Moult 2f951d352b Fix #3948. Bug where IfcTester PartOf facet didn't correctly read entity XML. 2023-11-02 12:29:05 +11:00
Andrej730 8b23c615c3 Fix issue with calculated params in stair ui
it was displaying incorrect data when stair was just loaded because it was relying on BIMStairProperties in ui.py
2023-11-01 17:33:38 +05:00
Dion Moult 7c694e5b3e Fix #3951. mats selector now supports IfcMaterialList. 2023-11-01 22:48:31 +11:00
Dion Moult 8eeb212003 See #3951. IfcCSV now supports list concatenation. 2023-11-01 22:47:30 +11:00
Dion Moult 7bf8d58cde Improve data type error reporting 2023-11-01 22:23:55 +11:00
Dion Moult b6e24559e5 Fix #3961. Improve UI so setting null now clears the value. 2023-11-01 18:04:44 +11:00
Andrej730 0d87d5927e bim.select_all_array_objects not to clear previous selection #3960 2023-11-01 10:53:25 +05:00
Dion Moult dfd5cc4728 See #3953. Fix bug where IDSes with a single enumeration value didn't validate. 2023-11-01 16:28:42 +11:00
Dion Moult 20b7ee009d Fix #3957. Fix bug where shared properties were not edited independently. 2023-11-01 15:18:57 +11:00
Dion Moult 19a3f56941 Fix #3958. Bug where reassigning type class would incorrectly assign occurrence classes. 2023-11-01 14:41:25 +11:00
Dion Moult 3b298d44c1 Fix regressions in mapped native swept disk handling 2023-11-01 14:16:12 +11:00
Andrej730 038d3bc41c fix future warning for xml.etree
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.
2023-10-31 16:24:41 +05:00
Andrej730 235e89ae14 remove blf.size deprecated dpi argument #3876
turn out it wasn't working for awhile now and in Blender 4.0 was completely removed
2023-10-31 16:19:42 +05:00
Andrej730 e2de9efc33 Move new Blender 4.0 Simulation section to Scene/Blender tab #3876 2023-10-31 15:57:54 +05:00
Andrej730 8126085037 Warning message on copying node graph on Blender 4.0+ #3876
As we're still looking for a workaround
2023-10-31 15:38:57 +05:00
Andrej730 bbe14834e4 Remove 3D shaders prefix #3876
In Blender 4.0 3D_* shaders are called without "3D_" prefix, otherwise it throws an error. Tested on Blender 3.6 - they work without "3D_" prefix too.
2023-10-31 15:27:43 +05:00
Andrej730 45f2d301b3 More context override fixes #3876 2023-10-31 15:18:33 +05:00
Andrej730 2ecd11d71f fixing test after 0d0b91e 2023-10-31 15:18:33 +05:00
Gorgious56 b42f072bd5 You can now eyedrop an object in the viewport to copy container when editing container 2023-10-31 11:14:54 +01:00
Ryan Schultz 3b3668eedf More IFC class suggestions 2023-10-30 22:51:55 -05:00
Dion Moult 7f7f353131 Disable batching for removal as it doesn't seem to help mostly from experience. Still testing. 2023-10-31 12:31:05 +11:00
Dion Moult 53594de1ff See #3955. PyPI release now specifies compatible Python versions. 2023-10-31 08:32:51 +11:00
Gorgious56 4fbbfb5191 You can now eyedrop an object in the viewport to copy class and predefined type when reassigning class 2023-10-30 15:04:37 +01:00
Gorgious56 4e1daea838 Clicking on an entry in the search field popup automatically validates and closes the popup
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
2023-10-30 14:19:01 +01:00
Andrej730 d8ff83da73 Replacing old context override method #3876 2023-10-30 15:14:34 +05:00
Andrej730 a7712a923f setup_pytest to find site-packages folder near sys.executable
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).
2023-10-30 15:14:34 +05:00
Andrej730 01b5f8f237 Fixed #3949 2023-10-30 11:27:55 +05:00
Dion Moult b9ad15c50f Minor fix to Uniclass classification 2023-10-30 09:31:00 +11:00
Thomas Krijnen db06cff997 Update test file for case insensitivity. Thanks Igor. 2023-10-29 14:35:14 +01:00
Dion Moult f0028c0094 get_footprint_area now unions 2D polygons to prevent double counting 2023-10-28 15:54:45 +11:00
Dion Moult 1c954801b0 Fix #3939. Bug where IfcLabel data type was incorrectly used for longer text data. 2023-10-28 14:44:41 +11:00
Ryan Schultz 973e4f0064 Updated default JoinCriteria to accommodate new facet selector for statuses. 2023-10-27 11:24:49 -05:00
Andrej730 be5d291bd9 test creating mep transition 2023-10-26 17:21:42 +05:00
Andrej730 cbec56c2f0 ifc2x3 pset library - fix bunch of unit related vlaidation errors #3929 2023-10-26 15:54:34 +05:00
Dion Moult 880d0ba753 Minor fixes 2023-10-26 13:08:30 +11:00
Dion Moult db85689364 Add support for latest uniclass and add Uniclass July 2023 2023-10-26 13:08:30 +11:00
Sigma Dimensions (Yass) 48a0d8c508 fix displaying undefined or userdefined units in cost schedules 2023-10-25 15:01:52 +01:00
Sigma Dimensions (Yass) df4cd493ee fix displaying cost item totals 2023-10-25 13:54:13 +01:00
Massimo Fabbro 74132dcd49 New operator that creates a ceiling from cursor position in covering tool 2023-10-23 20:58:59 +02:00
Bruno Perdigão ef72cd3250 recreates assembly for array children objects 2023-10-23 15:46:14 -03:00
Andrej730 5cf1dd4249 fixed core tests after switch_representation changes 2023-10-23 17:25:07 +05:00
Andrej730 29bd30d3bf "Edit Profile" in BIM Tool for mapped representations
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)
2023-10-23 16:50:05 +05:00
Andrej730 3f8a0a91b3 switch_representation to automatically switch to unresolved mapped representation
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.
2023-10-23 16:49:56 +05:00
Andrej730 416a572664 switch_representation not to break with temporary mesh representations
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
2023-10-23 15:24:43 +05:00
Thomas Krijnen 388c72360d Use --start/end-group on linux to fix ld geomserver 2023-10-21 22:26:16 +02:00
Dion Moult b841afc2e4 Update beginners tutorial documentation with images from new UI. 2023-10-21 22:46:15 +11:00
Dion Moult f10d340254 You can now assign and unassign styles to materials 2023-10-21 15:23:55 +11:00
Dion Moult 0d0b91ee9b You can now specify a name when adding materials 2023-10-21 15:23:55 +11:00
Bruno Perdigão 4f1e59a613 improvements on dealing with sub-aggregates 2023-10-20 21:26:56 -03:00
Bruno Perdigão 5960e4153c wip: RefreshLinkedAggregate is working with IfcGroup 2023-10-20 14:34:03 -03:00
Ryan Schultz 8032333a17 Additional clarification on save and save as 2023-10-20 09:53:29 -05:00
Dion Moult 712ec6def3 Reorganise new stakeholders panel, move profiles into geometry tab. General UI polish. 2023-10-20 22:18:32 +11:00
Andrej730 0d43ef0736 option to set active system
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.
2023-10-20 15:59:24 +05:00
Andrej730 b318509cba Merge systems UI into one
We had two very similar systems panels that were part of the old UI.
2023-10-20 14:00:32 +05:00
Dion Moult f3b541f00a Fix #3095. Very basic implementation of a new zones panel. 2023-10-20 17:51:48 +11:00
Andrej730 4f64dcdbd4 Fixed tests after selector syntax update 2023-10-20 11:06:10 +05:00
Dion Moult 68acf84e26 Fix #3901. Add configurable list concatenation support in IfcFM. 2023-10-20 13:38:17 +11:00
Dion Moult aaceb923ad Fix #3903. Bug where stairs started off with an empty mesh and had a representation added, resulting in an invalid empty point cloud.
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.
2023-10-20 12:28:18 +11:00
Dion Moult 074de2741a Fix regression from 744c08e where type products cannot have an instance specified in create_shape 2023-10-20 12:24:57 +11:00
Dion Moult 0e4bc320cb Adding / editing shading / rendering styles in the style manager now updates Blender materials 2023-10-20 10:26:35 +11:00
Andrej730 9e9412bec0 Forgot to fix test after 35d66f5 2023-10-19 18:10:31 +05:00
Andrej730 7e92471ac9 Fixed issue unlinking mesh objects
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
2023-10-19 17:05:14 +05:00
Andrej730 078a7eb290 Fix tests after 808ff54 2023-10-19 16:42:20 +05:00
Andrej730 df3876b438 Minor fix after a47c57c 2023-10-19 16:11:57 +05:00
Andrej730 d414de450b Fixed test after c34a9c5
Also fixed bug in the sheeter
2023-10-19 16:11:56 +05:00
Andrej730 9e89bb5044 Fixed test after 418444a 2023-10-19 13:22:06 +05:00
Andrej730 aa0c42e1ec Fixed test after 90b40ff 2023-10-19 13:05:25 +05:00
Andrej730 a4daa0e3d9 Fixed test after 88d96f7 2023-10-19 11:03:27 +05:00
Andrej730 162ac39570 Fixed test after 6e9639446 2023-10-19 11:03:27 +05:00
Andrej730 8c73fa69a1 Fixed #3907 after dd7a6a80e 2023-10-19 10:49:47 +05:00
Dion Moult 159eeeb3a4 You can now edit rendering styles in the style manager 2023-10-19 16:38:42 +11:00
Bruno Perdigão 66f735fde9 wip: refactor of RefreshLinkedAggregate. The operator triggers all the other linked aggregates deletion. 2023-10-18 21:36:04 -03:00
Bruno Perdigão 1a3aa7f031 IfcElementAssembly share a group instead of a pset 2023-10-18 20:43:41 -03:00
Ryan Schultz ac41a9e63a allow SI with CAD tools. 2023-10-18 17:07:29 -05:00
Andrej730 eb0873996f Added IfcZone to systems UI in IFC2X3 #3905
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.
2023-10-18 17:13:22 +05:00
Andrej730 c85826ef2e Fixed #3901
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
2023-10-18 16:40:07 +05:00
Andrej730 627cf63a4c ifcfm symlink to dev environment setup script 2023-10-18 16:07:27 +05:00
Andrej730 744c08e13e bim.switch_representation to switch to exact representation
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`
2023-10-18 15:48:08 +05:00
Andrej730 dd7a6a80eb activate_drawing to prioritize already active representation
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.
2023-10-18 15:48:01 +05:00
Andrej730 ab807e3b9b bim.create_all_shapes info message 2023-10-18 12:21:41 +05:00
Andrej730 c35be50c83 Bump build version to fix #3889 2023-10-18 11:10:04 +05:00
Bruno Perdigão 37ab9c80e3 Duplication now recreates connections path #3770 2023-10-17 18:45:14 -03:00
Andrej730 7ff98d2918 Some UI to mark booleans as manual #3709
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
2023-10-17 18:19:45 +05:00
Andrej730 35d66f5d8c move to tools methods for working with manual booleans #3709
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'
```
2023-10-17 18:13:54 +05:00
Andrej730 3f018a4195 localize mathutils dependency in tests #3895
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
2023-10-17 15:53:26 +05:00
Andrej730 578e15adb2 refresh_aggregate to show time it took
since this can get very time consuming on large projects
2023-10-17 15:07:43 +05:00
Andrej730 c4474455e9 Fix poll error after 3de9915
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'
2023-10-17 15:07:43 +05:00
Dion Moult 8f43854cbf Minor fix 2023-10-17 20:47:39 +11:00
Thomas Krijnen 787149da13 Regen express rule code: lowercase str comparison in express rule generated code 2023-10-17 11:04:46 +02:00
Thomas Krijnen 3b31f6932a Compile IFC4X3_ADD2 express rules 2023-10-17 09:50:39 +02:00
Andrej730 6c9e130ca8 small fix f38952dc5 #3898 😬 2023-10-17 10:47:52 +05:00
Bruno Perdigão 86a234d17e Changed operator name 2023-10-16 22:32:09 -03:00
Bruno Perdigão f68baee5c3 small deletions 2023-10-16 22:17:22 -03:00
Bruno Perdigão 0028fd3e9c ifc_duplicate_operator now remove the connections with old objects. Similar solutions presented in PR #3789 2023-10-16 15:39:38 -03:00
Bruno Perdigão f5f9862b78 Fix #2187. ifc_duplicate_operator now recreates the IfcElementAssembly structure into a new Assembly 2023-10-16 15:31:56 -03:00
Andrej730 f38952dc51 small refactor 2023-10-16 16:23:48 +05:00
Andrej730 24eb149221 Support other voiding IfcFeatureElementSubtraction elements #3889
Support other voiding IfcFeatureElementSubtraction besides IfcOpeningElement.
2023-10-16 15:31:53 +05:00
Andrej730 ce8598a0b4 Fixed issue after 19345ff
It wasn't considering that EnumerationReference could be None
2023-10-16 15:31:53 +05:00
Thomas Krijnen fb9cf75412 #3889 Apply handling of openings on IfcFeatureElementSubtraction generically 2023-10-16 11:02:40 +02:00
Andrej730 68f5df73b9 black formatting 2023-10-16 12:21:20 +05:00
Andrej730 e068c523ec Keep placement axes recalculating profiles #3879 2023-10-16 12:19:18 +05:00
Andrej730 aa182bf047 small fix add_profile_representation - use of undefined variables 2023-10-16 11:59:33 +05:00
Ryan Schultz 6e9639446d Add a preference for particular app to open sheet layout 2023-10-15 20:04:53 -05:00
Bruno Postle c48c1c3b32 BlenderBIM minor fix after 7107a91 2023-10-15 21:15:32 +01:00
Dion Moult 14224ac538 Fix #3870. Bug where element filtering wasn't initialised properly when loading a camera for the first time.
Raster_x/y would only be set after the handler triggers. This is no longer necessary with the new explicit width / height properties.
2023-10-15 22:23:10 +11:00
Dion Moult 58be92d3fc New verbose option in util get_pset(s) which lets you get ID and class for complex processing. 2023-10-15 08:57:37 +11:00
Bruno Postle 7107a91f6f BlenderBIM keep camera position on git switch
New 'zoom extents' behaviour on IFC load is unwanted when switching
between git revisions
2023-10-14 21:54:16 +01:00
Thomas Krijnen 438ed22f8f Merge pull request #3888 from isma3lMB/v0.7.0
Adding support for non ascii characters when reporting
2023-10-14 16:00:18 +02:00
isma3lMB a9dfc9a9fd Adding support for non ascii characters when reporting 2023-10-14 15:31:33 +02:00
Thomas Krijnen f8b09b3525 Update build-deps.cmd: proj compilation 2023-10-13 22:34:35 +02:00
Massimo Fabbro f1ab02b311 Fix bug in covering/space tool with matrix global and local 2023-10-13 22:03:43 +02:00
Bruno Perdigão 4e833e26ca wip: DuplicateMoveAggregate now calls DuplicateMove function and removes code duplication 2023-10-13 14:41:21 -03:00
Dion Moult 25df2f6414 See #3884. Rewrite native geometry handling with a much more robust approach fixing a number of invalid coordinates and simplifying things. 2023-10-13 23:40:23 +11:00
Dion Moult 42719d3fe3 Fix bug where native meshes had normal smoothing enabled by default 2023-10-13 23:40:23 +11:00
Dion Moult 1f6d23c19c Minor fixes to placement utilities for getting mapped item matrixes 2023-10-13 23:40:23 +11:00
Thomas Krijnen 94db9ec522 Add IFC4X3_ADD2 schema 2023-10-13 11:51:05 +02:00
Dion Moult a47c57c22c First draft of style manager panel 2023-10-13 17:38:55 +11:00
Dion Moult 8f4bc0ea00 Material manager panel now moved to geometry tab 2023-10-13 17:37:24 +11:00
Dion Moult dd70b09fb1 Representation items panel now shows styles and layers 2023-10-12 22:56:36 +11:00
Dion Moult c930050da6 Accommodate bug in Revit where mapped representations were missing... well, a representation map. 2023-10-12 22:56:36 +11:00
Dion Moult 55a7a72e61 Minor bug fixes with error message when selecting objects in layers without objects 2023-10-12 22:56:36 +11:00
Dion Moult ca2ae36d41 Modernize zone and type table mappings for COBie 2.4 with Emma Hooper 2023-10-12 22:56:36 +11:00
Thomas Krijnen 81b4e42ca2 Use schema_identifier for schema and express rule validation. See #3126 2023-10-12 10:37:44 +02:00
Massimo Fabbro 55e61b55d8 better UI for covering tool 2023-10-12 05:58:52 +02:00
Massimo Fabbro a99529cb1e fix generate space and covering where objects weren't created in the right location 2023-10-12 05:58:52 +02:00
Dion Moult bf43efe509 Begin drafting out a new representation items panel for managing styles and layers properly 2023-10-11 23:26:48 +11:00
Vukas Pajic da7f5b015b add missing attributes in ids.parse 2023-10-11 10:06:54 +02:00
Massimo Fabbro 3de9915389 Add generate flooring from cursor and regen (#3874) 2023-10-11 09:15:36 +11:00
Dion Moult 418444a196 Fix #3873. Regression due to new importing logic. 2023-10-11 09:12:00 +11:00
Dion Moult 171251b27d See #1619. Fix issue where copying non-templated properties didn't work. 2023-10-11 08:53:53 +11:00
Ryan Schultz 9fef920a6f Further clarify the bim.link_ifc command 2023-10-10 13:43:56 -05:00
Dion Moult 5bff837a61 Minor fix 2023-10-10 22:21:32 +11:00
Dion Moult 05f6f4efab Manual booleans are now tracked via a Pset instead of arbitrary class conventions which should fix a bunch of issues. 2023-10-10 17:33:00 +11:00
Dion Moult e4f5b0e3d8 Write documentation for placement utility 2023-10-10 10:56:28 +11:00
Dion Moult 49b733f660 See #3817. WARNING: fundamental change. Standardise prioritisation of all context permutations when loading occurrences and types. 2023-10-09 23:21:09 +11:00
Dion Moult 36ed618adf You can now federate FM spreadsheets using the Blender UI 2023-10-09 17:26:45 +11:00
Dion Moult 48042011e2 Merge pull request #3860 from IfcOpenShell/Representation_Utilities_more_functions
Adding "Manually Save Representation" and bim.get_representation_ifc_…
2023-10-09 09:58:58 +11:00
Andrej730 0e1939a871 Minor fix #3862 2023-10-08 21:32:34 +05:00
Ryan Schultz bea1e61739 Adding "Manually Save Representation" and bim.get_representation_ifc_parameters back to Representation Utilities panel
from: https://github.com/IfcOpenShell/IfcOpenShell/commit/3a812a9ec156818061c01bd5b2ac2c2bee09faf1#r123820129
2023-10-08 09:24:18 -05:00
Ryan Schultz 72cd82f450 fixed error when creating new walltype in IFC2x3 2023-10-07 10:25:22 -05:00
Massimo Fabbro befa059591 Merge pull request #3838 from maxfb87/covering_tool
Covering tool (see #3754)
2023-10-07 14:20:27 +02:00
Bruno Postle 7229f7271c BlenderBIM make fca90e9 optional
setup_viewport_camera() does a 'zoom extents' on IFC import.
Create a should_setup_viewport_camera option (default True)
2023-10-06 22:34:43 +01:00
Andrej730 9c5970e757 fixed issue with placing end port for a bend 2023-10-06 17:30:01 +05:00
Andrej730 2fe3f0a9df system decorations - indicate both directions flow 2023-10-06 17:30:01 +05:00
Dion Moult 3929f02e94 Fix #3843. Regression where IfcMaterialList UI didn't show list of materials. 2023-10-06 22:43:56 +11:00
Andrej730 1abf80c310 Minor fix after b9a9abd30 2023-10-06 16:03:40 +05:00
Andrej730 2c18c89807 revert flow directions icons to arrows 2023-10-06 16:01:46 +05:00
Andrej730 1b81fa5aa1 Minor fix after 78c748df5
RuntimeError: Error: Registering panel class: parent 'BIM_PT_tab_placement' for 'BIM_PT_placement' not found
2023-10-06 15:31:41 +05:00
Hilko baa08b3221 Update build-deps.cmd 2023-10-06 12:16:51 +02:00
Andrej730 b9a9abd30d Fixed adding opening to meshes of all occurences for non material based representations
Mentioned in #3817
2023-10-06 15:11:14 +05:00
Andrej730 33536957d8 Moving some code to tool.Geometry 2023-10-06 15:11:14 +05:00
Dion Moult d092fd45ba You can now select coloured objects in a colourscheme. 2023-10-06 16:51:50 +11:00
Dion Moult 78c748df5d New placement panel to consolidate placement data in geometry tab 2023-10-06 15:25:51 +11:00
Dion Moult 3d76de3041 New geometry tree documentation picture and minor documentation improvements including mention of COBie 2.4 legacy mode in IfcFM. 2023-10-06 13:05:38 +11:00
Dion Moult ed3e9f3347 New documentation for shape utility 2023-10-06 13:04:54 +11:00
Dion Moult eb836436b9 Implement projected surface area calculation function in util.shape 2023-10-06 13:04:34 +11:00
Dion Moult c34a9c52d0 New drawing width / height / depth / raster DPI controls 2023-10-06 10:45:54 +11:00
Dion Moult 88d96f7d57 You can now easily create orthographic and perspective model drawings from a preset 2023-10-06 10:44:51 +11:00
Dion Moult 69e447be1c Active drawing panel moved from camera properties to drawing tab. 2023-10-06 08:17:03 +11:00
Massimo Fabbro df09acfa31 Merge branch 'v0.7.0' into covering_tool 2023-10-05 21:23:11 +02:00
Massimo Fabbro 6343f77c0d Minor spatial refactor 2023-10-05 21:17:25 +02:00
Thomas Krijnen 285fc2269e #3852 Update pyproject.toml 2023-10-05 15:52:59 +02:00
Andrej730 68a1da9190 test for model.get_manual_booleans() #3709
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.
2023-10-05 18:38:46 +05:00
Andrej730 ceae7d4fdb DumbWallJoiner to work with IfcBooleanResult correctly #3831
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
2023-10-05 17:31:24 +05:00
Dion Moult 371daa6c80 Revise COBie 2.4 mappings for facility, floor, and some of space worksheet in collaboration with Emma Hooper 2023-10-05 22:49:52 +11:00
Dion Moult 948993e066 Fix #3845. Select similar for predefined type now takes into account inheritance. 2023-10-05 22:47:12 +11:00
Andrej730 ec4f0e5ad6 Fixed issue applying array with Sync Children #3822 2023-10-05 15:32:45 +05:00
taylor ef56c6ce7e Fixed model reference 2023-10-05 10:17:03 +02:00
Dion Moult 3c02da416e Georeference module now supports IFC2X3 georeferencing / conversion utilities. 2023-10-05 16:15:28 +11:00
Dion Moult 6660bf7618 Document geolocation util and add support for ePSet IFC2X3 fallbacks. 2023-10-05 16:15:28 +11:00
Dion Moult 000e5ec29a Merge pull request #3835 from c4rlosdias/v0.7.0
Fix problem in facets.py (IfcTester)
2023-10-05 11:39:47 +11:00
Dion Moult ef8f4df4ab Fix #3841. Bump IOS. 2023-10-05 09:57:03 +11:00
Andrej730 dff70f2608 bim.flip_object #3803
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.
2023-10-04 18:20:17 +05:00
Andrej730 0d7967ff62 .reg file for #3778
Forgot to commit the .reg file...
2023-10-04 15:13:57 +05:00
Andrej730 4fe459dab6 Fixed typo 2023-10-04 09:47:38 +05:00
Thomas Krijnen 0e5e1f7873 Option to write Earth-Centered Earth-Fixed glTF 2023-10-03 21:26:11 +02:00
Dion Moult 82d4829c83 Clean up IfcFM's Basic preset to be more true to IFC rather than follow naming schemes from stuff like COBie 2023-10-03 21:21:28 +11:00
Dion Moult a24fab6d92 You can now select and bulk process multiple models using IfcFM in Blender. 2023-10-03 21:21:28 +11:00
Dion Moult 748055dcf1 New IfcPatch recipe to fix Revit bug with occurrence based classifications 2023-10-03 21:21:28 +11:00
Dion Moult 3904162360 New IfcPatch recipe to fix Revit bug with hardcoded Uniformat classification 2023-10-03 21:21:28 +11:00
Andrej730 7ca24ede4c IfcSverchok docs update urls 2023-10-03 10:50:56 +05:00
Ryan Schultz 1e59b10479 Merge pull request #3820 from brunoperdigao/fix-duplicate-agg-pset-for-new-objs
Fixed a bug where the refresh aggregate operator was not working afte…
2023-10-02 15:14:05 -05:00
Massimo Fabbro cda61bff5b Refactor create_space operator and better UI for covering tool 2023-10-02 22:13:03 +02:00
Massimo Fabbro 09a9753ca7 refactor create spaces from walls 2023-10-02 22:13:03 +02:00
Massimo Fabbro 1621449143 Add predefined type to AuthoringData 2023-10-02 22:13:02 +02:00
Ryan Schultz d0ef7f69b1 fix #3792 2023-10-02 14:56:17 -05:00
c4rlosdias 3df95b8970 Merge branch 'v0.7.0' of https://github.com/c4rlosdias/IfcOpenShell into v0.7.0 2023-10-02 13:49:32 -03:00
c4rlosdias ddd4b0e262 Fix problem in getpsets(facet.py) and added descriptions to specifications (IfcTester) 2023-10-02 13:49:27 -03:00
Carlos Dias 6b05b6e7fb Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-10-02 12:58:10 -03:00
Andrej730 9dd728ce7e Fixed error creating a door type / window types after 8f6be60c6 2023-10-02 17:32:56 +05:00
Andrej730 90b40ff0dc Getting drawing group more precisely
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
2023-10-02 16:55:38 +05:00
Andrej730 3c27c52c9f Small fix for 05d4dc566 2023-10-02 15:38:26 +05:00
Andrej730 05d4dc5666 Rever IFC Project
https://i.imgur.com/ajQiK8D.png
2023-10-02 15:30:32 +05:00
Andrej730 edaabf5bd2 Fixed #3829 occured after ae45e6b
similar_openings wasn't reset on each iteration causing moving unrelated openings
2023-10-02 11:44:31 +05:00
Andrej730 ad79c63a37 Fixed #3832 2023-10-02 10:57:24 +05:00
Sigma Dimensions (Yass) 9461bf2129 fix f2097c0 2023-09-29 17:30:33 +01:00
Sigma Dimensions (Yass) f2097c0c5f importing csv cost schedules now allows using selector queries for effortless product assignments to cost items, and add new ods and csv format templates (in french) 2023-09-29 16:10:16 +01:00
Dion Moult d838e1808d IfcFM can now be used to federate multiple spreadsheets together 2023-09-29 23:03:58 +10:00
Dion Moult 5ed54d9e7c Revise COBie 2.4 contact table mapping in collaboration with Emma Hooper 2023-09-29 23:03:58 +10:00
Andrej730 78aba1c7e4 Workaround for #3778 2023-09-29 15:28:11 +05:00
Andrej730 3faaee80ec copy_deep to always pass exclude_callback to the recursion
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
2023-09-29 09:29:25 +05:00
Andrej730 a847b8f4e4 bim.remove_opening not to force Model/Body/Model_view
Now it won't be forcing Model/Body/Model_view representation on the objects if some other context is active for the object.

Indirectly solves #3817
2023-09-28 18:51:27 +05:00
Dion Moult 24170a8a16 Ship with fallback IFC2X3 georeferencing pset 2023-09-28 23:07:43 +10:00
Massimo Fabbro 5438331fe1 fix generate spaces from walls bug 2023-09-27 18:52:49 +02:00
Carlos Dias 3c957e0cbe Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-09-27 10:55:52 -03:00
Andrej730 10672f3e1a Print unused elements stats / purge unused elements
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.
2023-09-27 15:42:31 +05:00
Andrej730 fa90e420eb info message for amount of purged elements 2023-09-27 13:55:56 +05:00
Dion Moult 347bb2df4b Introductory docs written for IfcFM 2023-09-27 18:22:02 +10:00
Dion Moult 986ffe66f8 New introduction section in IOS docs 2023-09-27 18:22:02 +10:00
Andrej730 c1bedec354 Minor fix after 22edbdd
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)
2023-09-27 12:09:44 +05:00
Dion Moult 182b6c7b07 IfcFM now supports writing to Pandas Dataframes 2023-09-27 14:18:48 +10:00
Dion Moult 22edbddd84 You can now interact with IfcFM via CLI 2023-09-27 14:17:46 +10:00
Dion Moult 50f6f44d26 You can now specify empty formatting for IfcCSV via CLI 2023-09-27 14:16:43 +10:00
Dion Moult e93a697179 Fix #3788. Fix crash when opening drawing SVGs using webbrowser module which is not recommended and the file is on a Dropbox synced external drive. Now replaced with generic os.startfile / xdg-open / open commands. 2023-09-27 11:50:52 +10:00
Sigma Dimensions (Yass) f1a5805b1c fix loading animation color scheme 2023-09-26 18:33:52 +01:00
Sigma Dimensions (Yass) 126f530af1 run black and forgotten calender utils 2023-09-26 16:44:35 +01:00
Sigma Dimensions (Yass) 5dfbbb8d96 maintain tasks bar visual property state when tasks properties are reloaded 2023-09-26 16:42:35 +01:00
Sigma Dimensions (Yass) 6962e505f9 hide spaces when creating an animation 2023-09-26 16:38:33 +01:00
Sigma Dimensions (Yass) 5c2523e752 fix warning statement when there are no saved animation color schemes 2023-09-26 16:36:48 +01:00
Sigma Dimensions (Yass) 635dff73b4 fix typo 2023-09-26 16:35:31 +01:00
Sigma Dimensions (Yass) c85e4e7ceb fix missing task types for animations color scheme 2023-09-26 16:35:00 +01:00
Sigma Dimensions (Yass) 7ed4301c6c fix tasks not displaying derived calendar 2023-09-26 16:29:53 +01:00
Andrej730 1193e7025a system decorations - live time update
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.
2023-09-26 17:08:39 +05:00
Andrej730 cc1ee19115 Add ports to MEP bends/transitions types instead of occurences 2023-09-26 15:19:49 +05:00
Andrej730 e975eac4a7 system decorations to show flow direction 2023-09-26 11:47:10 +05:00
Andrej730 779fc35228 settings flow direction without jumping to ports
https://imgur.com/a/F00tG7g
2023-09-26 11:47:10 +05:00
Dion Moult 8e59282fe0 Possible optimisation by caching in IfcTester property checks 2023-09-26 16:03:10 +10:00
Bruno Perdigão 11c8d47909 fixed a bug where the refresh aggregate operator was not working after adding new objects to the parent aggregate 2023-09-25 22:55:56 -03:00
Claudio Benghi 2661999f3e Fixed most issues with IDS auditing 2023-09-26 11:06:58 +10:00
Ryan Schultz e4bfb05875 proposed fix for #3792 2023-09-25 10:32:06 -05:00
Massimo Fabbro fe14988d50 Merge pull request #3790 from maxfb87/new_covering_tools
New covering tools (see #3754)
2023-09-25 16:03:56 +02:00
Massimo Fabbro d45bef5e70 Merge branch 'v0.7.0' into new_covering_tools 2023-09-25 15:01:03 +02:00
Andrej730 82d03b98c6 Descriptions for add_representation conversion methods 2023-09-25 16:32:48 +05:00
Andrej730 9c1ecf3f2c draw calculate_all_quantities hotkey in bim tool ui
hotkey was already there, it just wasn't added to UI

https://i.imgur.com/nar5WYI.png
2023-09-25 16:32:48 +05:00
Andrej730 8f6be60c6e recalculate fills on applying changes to ifc windows / ifc doors
previously if you'd move the window and then change it's parametric data and try to apply it, opening's position wouldn't be updated
2023-09-25 16:32:48 +05:00
Andrej730 81a1bd9206 Moved common duplication operators code to DuplicateMove
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).
2023-09-25 16:32:48 +05:00
Andrej730 9f7dffb29d replace Drawing.remove_object_data with more general method 2023-09-25 16:32:47 +05:00
Dion Moult eee799bfc4 Purge IfcCOBie deps from build 2023-09-25 19:24:01 +10:00
Dion Moult 9665adb61d Fix #3793. Bug where flipping a wall with generic connection relationships would fail. 2023-09-25 08:34:48 +10:00
Sigma Dimensions (Yass) e40019f3cb resources code cleanup 2023-09-24 19:02:35 +01:00
Sigma Dimensions (Yass) b2f95bfa60 change tests due to new class assignment workflow ref commit 808ff54 2023-09-24 18:45:12 +01:00
Bruno Perdigão be2c7a62fd remove connections with old objects when duplicating aggregates 2023-09-24 22:23:55 +10:00
Dion Moult 38f5468f19 We now support separating IFC meshes. 2023-09-24 15:45:22 +10:00
Dion Moult 31dcbc0159 Splitting by edge now resolved mapped representations, voided, and non-mesh geometries 2023-09-24 15:45:22 +10:00
Sigma Dimensions (Yass) bd81320c08 fix parametric duration/ resource update 2023-09-24 04:39:30 +01:00
Dion Moult 0707f37247 Minor fix during loading arrays 2023-09-24 13:18:32 +10:00
Dion Moult 0993736cea Fix #3791. Add isodate as an optional dependency to ifcopenshell-python. 2023-09-24 13:14:56 +10:00
Sigma Dimensions (Yass) cc3e2204e2 improved template for resource csv imports 2023-09-24 03:17:39 +01:00
Sigma Dimensions (Yass) 8ac5f0318b fix location search filter 2023-09-23 23:35:17 +01:00
Sigma Dimensions (Yass) 270a61e73a bring back filter operators into new Filter subpanel and change filter by storey to filter by container 2023-09-23 21:26:58 +01:00
Massimo Fabbro 1c057b1ce1 Add new covering tool. Mock up and initial functions 2023-09-23 18:09:59 +02:00
Sigma Dimensions (Yass) e74e824417 Proposal to use resource's parent cost, reducing manual insertions 2023-09-23 16:04:01 +01:00
Dion Moult 73d1de5dcf New debug feature to override the display type. 2023-09-23 14:51:27 +10:00
Dion Moult 4549be0d05 Autodetect dense meshes to make it faster when loading so users don't need to go into advanced mode. 2023-09-23 14:51:27 +10:00
Andrej730 e3f2f2175d Moving common code for duplication operators 2023-09-22 16:37:50 +05:00
Andrej730 a604cf2b2a Duplicate the array if all it's elements are selected #3763
Demo - https://imgur.com/a/0wYZOPl
2023-09-22 16:37:49 +05:00
Andrej730 d6b4c1f454 Setup arrays constraints on loading .ifc #3753 2023-09-22 13:56:55 +05:00
Andrej730 d3258693b2 Clear constraint and transform lock on duplicating array child object
Previously it was locked even though it's not part of an array anymore.
2023-09-22 13:56:55 +05:00
A. R. S 9eba3b6eaa Try to get unit from EnumerationReference for IfcPropertyEnumeratedValue 2023-09-22 17:41:05 +10:00
Dion Moult 7b75364feb Refactor IfcFM to make it easier to exclude things 2023-09-22 17:17:15 +10:00
Dion Moult 4a4a0f09ef Finally purge IfcCOBie to be superseded by IfcFM 2023-09-22 17:04:22 +10:00
Andrej730 6d14c2d448 removing arrays if all array elements are selected #3781
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
2023-09-22 11:25:56 +05:00
Andrej730 57edd47ed7 Fixed error editing pset with prop with empty prop.NominalValue
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'
```
2023-09-22 10:25:51 +05:00
Massimo Fabbro aefcedf754 Add model test about manual booleans 2023-09-21 23:19:47 +02:00
Massimo Fabbro 2c685c846f Added calculating quantities function for Qto_DuctSegmentBaseQuantities and Qto_DuctFittingBaseQuantities 2023-09-21 23:19:24 +02:00
Ryan Schultz 6536f7b56b small fix for 9e67565 2023-09-21 12:58:16 -05:00
Vukas Pajic 9d3881b00e typo 2023-09-21 16:14:37 +02:00
Vukas Pajic baffbd6a32 Update ids validation
see https://github.com/IfcOpenShell/IfcOpenShell/issues/2933
2023-09-21 13:27:38 +02:00
Sigma Dimensions (Yass) 9e4702c102 small fix when calculating resource work 2023-09-21 06:04:24 +01:00
Dion Moult b63f3f335c Autogenerate API docs for more modules. 2023-09-21 13:33:26 +10:00
Dion Moult 29b0bcb6b9 Forgot to commit BCF docs 2023-09-21 13:23:43 +10:00
Dion Moult 62fa0bb218 Migrate more documentation to the official Sphinx docs and mention IfcOpenShell-WASM as an installation option 2023-09-21 13:21:43 +10:00
Ryan Schultz 9e67565c71 Refresh aggregate from selecting a part 2023-09-20 08:54:04 -05:00
Andrej730 dee4cf591e mep system decorators - basic implementation
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
2023-09-20 15:28:06 +05:00
Andrej730 bc5d6ee113 fixed error in api.system.disconnect_port
Error was:
TypeError: can only concatenate tuple (not "list") to tuple
2023-09-20 15:28:05 +05:00
Andrej730 5af3b537da get_viewport_context to also return space 2023-09-20 15:28:05 +05:00
Andrej730 4b159d400c bim.draw_system_arrows updated for ifc4 2023-09-20 15:28:05 +05:00
Sigma Dimensions (Yass) f3c012660a improve pset editing workflow and use refactored core and tool functions 2023-09-20 01:22:18 +01:00
Sigma Dimensions (Yass) b5b8b5df26 cascade schedule when adding a sequence relationship 2023-09-20 01:15:06 +01:00
Sigma Dimensions (Yass) 6d38d9b538 fix count_working_days when the start and finish are the same same hours 2023-09-20 01:11:42 +01:00
Sigma Dimensions (Yass) ef11ae6540 fix calculating critical path to consider:
- parent tasks with sequence assignments #3772
- tasks that are constrained by a schedule start
2023-09-20 01:10:34 +01:00
Sigma Dimensions (Yass) a3802c25c0 fix cascading schedule when parent tasks have sequence relationships #3772 2023-09-20 01:05:19 +01:00
Andrej 377bcfe6da Merge pull request #3732 from brunoperdigao/fix-refresh-aggregate-rotation 2023-09-19 23:57:52 +05:00
Dion Moult 63a5c0986f Datatype checks in IfcTester are now case insensitive 2023-09-19 23:56:04 +10:00
Andrej730 8320623210 Exposed some MEP operators in BIM Tool UI
https://i.imgur.com/U61QqlQ.png
2023-09-19 17:00:14 +05:00
Andrej730 90c4a2fd41 bim.mep_connect_elements to connect elements by the closest ports
Previously it was looking for exact match. Now operator also adjusts connected ports
2023-09-19 17:00:14 +05:00
Andrej730 4ee66caaf9 override_outliner_delete poll error fix 2023-09-19 16:59:15 +05:00
Andrej730 23251de6f1 info message for refresh_aggregate 2023-09-19 16:59:15 +05:00
Dion Moult 37287bac7e You can now add bSDD properties when assigning bSDD classifications 2023-09-19 20:30:56 +10:00
Vukas Pajic 43a7340f5d Fix case when ids_dict has key but value is None 2023-09-19 12:28:09 +02:00
Dion Moult 2363b5e167 Minor fix 2023-09-19 19:13:21 +10:00
Dion Moult 62bf8c2287 Fix crash where IFCTester read directly from IFC in the UI 2023-09-19 18:17:24 +10:00
Dion Moult a5a958d6e2 Basic integration of bSDD with BlenderBIM Add-on: you can now assign classification references from the bSDD and set the active bSDD domain. 2023-09-19 18:17:24 +10:00
Dion Moult 812d8508f4 Implement classification searching in bSDD library 2023-09-19 18:17:24 +10:00
Andrej730 c40cc3f740 select array parent / all array objects to work without parent guid argument
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
2023-09-19 11:48:06 +05:00
Ryan Schultz 56040951f1 Have bim.select_aggregate make the aggregate empty the active object, as well. 2023-09-18 20:21:19 -05:00
Dion Moult 39b1a65dc5 IfcTester now includes percentages per requirement 2023-09-19 09:03:53 +10:00
Sigma Dimensions (Yass) 438f35fe88 purge cost schedules 2023-09-18 20:20:23 +01:00
Dion Moult 9240518066 Accommodate potential manual deletion of EPset drawing. 2023-09-18 23:41:13 +10:00
Dion Moult 27b71a9d07 Fix #3752. Accommodate situations where layouts don't match IFC. 2023-09-18 23:15:05 +10:00
Andrej730 0f1d675bef Associate IFC files with BlenderBIM on Windows
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.
2023-09-18 18:01:20 +05:00
Andrej730 19345ff538 Remove orphaned IfcPropertyEnumeration
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')),$);
2023-09-18 12:08:16 +05:00
Andrej730 7b28bc9c68 fixed bug creating transition shapes
it was accidentally assigning extrusion vector instead of an offset
2023-09-18 11:30:36 +05:00
Andrej730 d67eae55df Clean up orphaned meshes
- delete_ifc_project
- bim.add_constr_type_instance
- adding transitions and bends
- add profile / slab / wall
2023-09-18 10:58:26 +05:00
Andrej730 8e375dcf73 Save last active context editing doors/windows, solves #3735
previously - https://imgur.com/a/gri6zMk
now - https://imgur.com/a/GIwZP6c
2023-09-18 10:04:45 +05:00
Sigma Dimensions (Yass) a34d0cabfc MSP calendar exceptions are now also imported #3766 2023-09-17 03:10:31 +01:00
Sigma Dimensions (Yass) a668743d10 fix msp .xml import: exception days for a standard working week #3766 2023-09-16 19:29:48 +01:00
Massimo Fabbro b13cbbb244 Partial spatial tool refactor 2023-09-15 22:47:35 +02:00
Andrej730 b6ae5fd344 For parametric doors and windows remove "Edit Profile" button from BIM Tool UI to avoid confusion 2023-09-15 15:55:15 +05:00
Andrej730 1c85034e19 Add starting/saving IFC project to Blender F4 file context menu
https://i.imgur.com/FDvZZwc.png
2023-09-15 15:36:33 +05:00
Andrej730 b0d1823968 MEP bends - fixed bunch of bugs related to adjusting already existing bends types 2023-09-15 15:36:33 +05:00
Dion Moult f0e03c79df Project advanced mode filtering now uses new filter syntax 2023-09-15 11:25:08 +10:00
Andrej730 6109cdf41b Ooops, forgot to remove debug shape creation 2023-09-14 18:19:03 +05:00
Andrej730 ec0873d527 transitions - fixed bug finding compatible fitting
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.
2023-09-14 18:19:03 +05:00
Andrej730 63223172b4 mep operators - clamp properties below zero 2023-09-14 18:19:03 +05:00
Andrej730 9778253d21 bends - support for zero radius bends 2023-09-14 18:19:03 +05:00
Dion Moult 0140b4ded1 IfcDiff can now visualise across linked IFCs 2023-09-14 22:50:57 +10:00
Dion Moult dca60b83a9 Make IfcDiff more forgiving when invalid geometry occurs. See #3755. 2023-09-14 22:28:03 +10:00
Andrej730 42e683375c Fixed bug using tab editing arbitrary profile
It was assuming we were editing extrusion profile and therefore was giving errors.
2023-09-14 11:06:42 +05:00
Dion Moult 66e07c2f69 Include buildingSMART psets in IfcFM Basic preset 2023-09-14 15:17:52 +10:00
Dion Moult 2b067b9dec Minor fix 2023-09-14 14:27:07 +10:00
Dion Moult c22d7d2f41 More minor fixes to IfcFM basic preset 2023-09-14 14:24:06 +10:00
Dion Moult ea3d489c24 Minor fixes to IfcFM 2023-09-14 12:10:36 +10:00
Andrej730 97683a14ef Revert "Replace currently selected objects with occurences of type"
This reverts commit 58199ef7c9.
2023-09-13 18:44:00 +05:00
Andrej730 d79b912e0e bends - consider profile dimensions searching for compatible fitting
So basically now it won't reuse a bend fitting created for the same profile but with different dimension.
2023-09-13 16:30:20 +05:00
Andrej730 7ec8f8b03e bends - adjusting compatible fitting rotation to match the segments
Demo - https://imgur.com/a/cYdWy9X (note that no bend types created in the process - it's just adjusting the type created for the first two segments).
2023-09-13 16:30:20 +05:00
Andrej730 58199ef7c9 Replace currently selected objects with occurences of type
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
2023-09-13 16:30:20 +05:00
Andrej730 d5c46514d3 bends - considering parametric data searching for compatible fitting 2023-09-13 16:30:20 +05:00
Thomas Krijnen f400973557 Correct xsi:schemaLocation 2023-09-13 12:47:33 +02:00
Thomas Krijnen 148d6e7b1b Update IDS.xsd 2023-09-13 10:11:01 +02:00
Dion Moult 74dec650a7 New FM module in BlenderBIM Add-on for interacting with IfcFM. 2023-09-13 17:08:33 +10:00
Dion Moult 5f6e003e4e Implement COBie documents and attributes 2023-09-13 17:08:33 +10:00
Andrej730 d3df22b44b bends - use IfcArcIndex to define bends curves
instead of manually generating polylines of segments
2023-09-12 16:29:33 +05:00
Andrej730 257208d55b bends - support for start and end segments 2023-09-12 16:00:02 +05:00
Andrej730 d8b9b09d14 shapebuilder - replace y extrusion args with shortcut for readibility 2023-09-12 16:00:02 +05:00
Andrej730 6f9e14ceb0 Bends - replace faceset with simple extrusion 2023-09-12 16:00:02 +05:00
Andrej730 d854984dda MEP bends - support for circular profiles
Demo - https://imgur.com/a/XQBOvGz
2023-09-12 16:00:01 +05:00
Dion Moult 2951721886 Don't strip selector query keys to allow for explicit "mistakes" in key names. 2023-09-12 20:45:24 +10:00
Dion Moult 02801b32a6 Minor fix in IfcCSV where strings didn't get auto quoted. 2023-09-12 17:48:23 +10:00
Dion Moult b243e04fd2 New util.system.get_port_element function. 2023-09-12 17:48:23 +10:00
Dion Moult 02902d9a41 Allow optional second arguments to substr formatting. 2023-09-12 17:48:23 +10:00
Dion Moult 5c33034455 Implement COBie assemblies, connections, spares, resources, and jobs. 2023-09-12 17:48:23 +10:00
Thomas Krijnen 7541293a3c Case sensitivity on entity str comparison from cmd line https://sourceforge.net/p/ifcopenshell/discussion/1782717/thread/2bf3324a7f 2023-09-11 21:27:54 +02:00
Dion Moult da7d4dac7a Implement COBie systems 2023-09-11 23:24:34 +10:00
Andrej730 507ab8ec11 Fixed top and center alignment in the schedule
Solves #3599

Before - https://i.imgur.com/9s7MxH5.png
After - https://i.imgur.com/ojDj09G.png
Inkscape - https://i.imgur.com/pWF4Ouy.png
2023-09-11 17:30:59 +05:00
Andrej730 e93ff7a6b1 MEP bends - more robust start/end points detection
also support for bends with angles > 90 degrees and some other bugs fixed
2023-09-11 16:28:14 +05:00
Dion Moult 098ae2b69f Implement COBie type and component tables 2023-09-11 18:31:37 +10:00
Dion Moult a58a10e93d Deprecate purge_module_data in favour of newer refresh_ui_data function. 2023-09-10 18:27:05 +10:00
Dion Moult 9be7d951c3 Improve usability of pset template UI by removing save button and using new explicit applicable entity defaults to mitigate possible invalid pset templates. 2023-09-10 17:38:07 +10:00
Dion Moult 6cf482dc63 Minor UI bugfix where pset template files sometimes displayed with truncated filenames 2023-09-10 17:36:07 +10:00
Dion Moult aaa4683462 Fix bug where you couldn't add psets that were inherited. 2023-09-10 17:35:33 +10:00
Dion Moult 0b5535b6d4 Implement COBie zones 2023-09-10 09:04:19 +10:00
Andrej730 45feaeaec4 Spatial Manager - try to preserve the selection on loading the manager
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
2023-09-09 18:04:35 +05:00
Andrej730 90f92cd139 Units formatting for Spatial Manager
Noticed in Sigma Dimensions video that we have some floating point garbage displayed in the Spatial Manager UI and I've added some simple formatting.

Now - https://i.imgur.com/eM1rDDu.png
Before - https://i.imgur.com/ySln5uU.png
2023-09-09 17:55:58 +05:00
Dion Moult 0285d97e3f Reimplement IfcCOBie contacts, facilities, floors, and spaces in IfcFM. 2023-09-09 21:27:10 +10:00
Andrej730 bf80e4b5e1 Considering parametric data for fitting #3695
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😬
2023-09-08 19:40:18 +05:00
Andrej730 d4e4717857 Fixed issue creating slabs in IFC2X3 #3696
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
2023-09-08 17:46:58 +05:00
Andrej730 fca90e9b0f automatically adjust viewport camera on loading ifc
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
2023-09-08 17:10:52 +05:00
Andrej730 ffbb91216f Fixed issue using mitre with small angles between walls (#3721)
Normalization is unrelated, just added to be safe.
2023-09-08 15:47:20 +05:00
Andrej730 09620e060f some DumbWallJoiner.join() refactor 2023-09-08 15:47:20 +05:00
Dion Moult 0ea38384cc Minor fix after 6887210 2023-09-08 17:44:33 +10:00
Dion Moult aae659c5fd Fix bug when casting to tessellation for invalid IFCs which don't use material sets properly. 2023-09-08 15:52:44 +10:00
Dion Moult b7a481ec79 IfcFM now uses Openpyxl and supports xlsx. Reorder columns to be more logical and group similar data types together (at least for me). 2023-09-08 13:16:17 +10:00
Dion Moult 763eaf83da Fix #3733. Fix round function precision error. 2023-09-08 12:20:52 +10:00
Dion Moult 2843d1e13e Enable Sphinx auto section labels. Minor doc link fix. 2023-09-08 12:06:59 +10:00
Dion Moult e897797955 For convenience, rounding to an integer value now also casts to integer. 2023-09-08 11:17:28 +10:00
Bruno Perdigão cc8f103465 fix rotation from refresh aggregate operator 2023-09-07 21:06:08 -03:00
Ryan Schultz f1c3a90bc5 Update installation.rst 2023-09-07 14:23:37 -05:00
Dion Moult c90c438324 ResetAbsoluteCoordinates IfcPatch recipe can now choose whether to reset placements, geometry, or both points. 2023-09-07 22:15:44 +10:00
Dion Moult ae1ff3f6f7 Fix bug where unedited mesh objects were still tagged as edited which led to unnecessary processing prior to drawing generation or saving. 2023-09-07 22:09:26 +10:00
Dion Moult e2224386bf You can now customise the display of empty strings in IfcCSV. 2023-09-07 18:15:12 +10:00
Dion Moult 6ad51ebd18 Update documentation with new selector keys. 2023-09-07 18:11:55 +10:00
Dion Moult 0fb9f584cb Big clean up to IfcFM. It's almost usable! 2023-09-07 17:38:33 +10:00
Dion Moult 9a34b94568 Fix #3682. You can now tag setout points with dynamic xyz / enh values. 2023-09-07 13:47:54 +10:00
Dion Moult 7bca3bcac3 Drawing text annotation now use the new format functions instead of executing arbitrary code. 2023-09-07 13:05:03 +10:00
Dion Moult de27554043 New substr formatting function. 2023-09-07 13:02:45 +10:00
Dion Moult 306ee3dfa4 You can now choose both input and output units for imperial formatting 2023-09-07 12:18:43 +10:00
Ryan Schultz 3593b6b5c2 Update ifc_classes_suggestions.json 2023-09-06 20:13:55 -05:00
Dion Moult e06acab39b Revert "Spreadsheet Import/Export: Fix feet and inch formatting"
This reverts commit 921d412fc7.
2023-09-07 10:13:00 +10:00
Dion Moult 6dd4e0f53a Revert "Small fix for feet and inch formatting on Spreadsheet Import/Export"
This reverts commit 7935bd22c2.
2023-09-07 10:12:50 +10:00
Dion Moult 2c2a37cacb Fix #3722. Fix ifcopenshell pypi distribution to use modern manylinux tag for glibc 2.31. 2023-09-07 09:57:58 +10:00
Ryan Schultz 7935bd22c2 Small fix for feet and inch formatting on Spreadsheet Import/Export 2023-09-06 13:49:32 -05:00
Andrej730 6887210a1a remove the orphaned data created on object duplicate
orphaned mesh still had ifc_definition_id of the original object and could have caused issues in theory
2023-09-06 17:28:37 +05:00
Andrej730 33dc3a4b06 Update status visibility automatically #3721 2023-09-06 15:57:39 +05:00
Dion Moult ba4610155f Fix #3705. Fix ambiguity in using commas in unquoted strings in facet selector. 2023-09-06 16:34:39 +10:00
Dion Moult 28eeba49ba Fix #3712. Fix bug where grid axes couldn't be duplicated. 2023-09-06 15:11:07 +10:00
Dion Moult 0a00e529c3 Improve hello world documentation to be more beginner friendly 2023-09-05 23:42:31 +10:00
Dirk Olbrich c5024cf6be cmake: ifcconvert is build in minimal 2023-09-05 13:00:39 +02:00
Dirk Olbrich 0f3b416c3f cmake: reorder build options 2023-09-05 13:00:39 +02:00
Dirk Olbrich addacd9ce5 cmake: move check fo 3ds max sdk to external file 2023-09-04 15:01:12 +02:00
Dirk Olbrich 5582bb2d4c ifcmax: format and unify cmake 2023-09-04 15:01:12 +02:00
Andrej730 8b27c0e755 hotfix for ca4efa6e5 2023-09-04 16:33:02 +05:00
Andrej730 ca4efa6e50 Remove operator's name from set_tab tooltip #3704 2023-09-04 16:14:56 +05:00
Andrej730 cfac835607 bim.mep_add_bend
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
2023-09-04 15:42:45 +05:00
Andrej730 3aa72ae74a notify about unsupported transition case 2023-09-04 15:42:45 +05:00
Dion Moult 07579ee9a1 See #3700. Fix issue in drawing include filter where "addition" selections like GlobalIds and classes didn't have any impact. 2023-09-04 15:59:13 +10:00
Dirk Olbrich fe4823681f ifcgeom: fix compiler warning -Wunused-but-set-variable 2023-09-03 20:02:20 +02:00
Dirk Olbrich 6816ad5c0f ifcparse: fix compiler warning -Wignored-qualifiers 2023-09-03 20:02:20 +02:00
Dirk Olbrich aace987149 ifcgeom: fix compiler warning -Wreorder-ctor 2023-09-03 20:02:20 +02:00
Carlos Dias 339ab9eeab Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-09-03 12:33:20 -03:00
Thomas Krijnen eee844e204 Express rules: Workaround str case in IfcBlobTexture 2023-09-02 15:58:05 +02:00
Dion Moult 46cfe70181 You can now load 2D point clouds. 2023-09-02 16:31:08 +10:00
Dion Moult 294935ceed See #3682. You can now add symbols and multisymbols (i.e. one vertex per symbol) annotations. New default symbols for setout points in demo library. 2023-09-02 16:31:08 +10:00
Dirk Olbrich f2097b9036 cmake: fix PATHS syntax error closes #2632 2023-09-01 17:35:02 +02:00
Andrej730 e48a3a06c0 Fixed bug with adding obstruction fittings 2023-09-01 18:24:02 +05:00
Andrej730 c07371cb76 couple descriptions for setting north 2023-09-01 18:05:22 +05:00
Dion Moult 8d450aa500 Fix #3470. Fix bug where hppfcl for IfcClash was incorrectly bundled for Windows. 2023-09-01 22:14:09 +10:00
Dirk Olbrich 726c792fbe cmake: remove unused CONVERT_PRECISION closes #3672 2023-09-01 11:56:11 +02:00
Dirk Olbrich 83dda3e73f cmake: fix QT version number from merge conflict 2023-09-01 11:56:11 +02:00
Dirk Olbrich 5c78e29849 cmake: fix target versions closes #3671 2023-09-01 11:56:11 +02:00
Dirk Olbrich e6d48cd37f cmake: fix reset to ROOT_PATH back in 2023-09-01 11:56:11 +02:00
Dirk Olbrich a3ecde3ad9 cmake: reset wrong fix on merge conflict 2023-09-01 11:56:11 +02:00
Dirk Olbrich 2bb64a6cae cmake: fix order to set boost components 2023-09-01 11:56:11 +02:00
Dirk Olbrich 764c818d10 cmake: fix inline variable error 2023-09-01 11:56:11 +02:00
Dirk Olbrich 2d18185928 cmake: fix lowercase and duplicates from rebase 2023-09-01 11:56:11 +02:00
Dirk Olbrich 43468166d2 fix format of license block 2023-09-01 11:56:11 +02:00
Dirk Olbrich fbfd6bc485 refactor order of unify envvars 2023-09-01 11:56:11 +02:00
Dirk Olbrich 1578efe366 refactor conditional for 3ds Max SDK 2023-09-01 11:56:11 +02:00
Dirk Olbrich 76948c5156 add uninstall target 2023-09-01 11:56:11 +02:00
Dirk Olbrich 562ed5908d fix IFC_MAX check 2023-09-01 11:56:11 +02:00
Dirk Olbrich 9caac14014 make 3ds SDK search optional, order cmake options
# Conflicts:
#	cmake/CMakeLists.txt
2023-09-01 11:56:11 +02:00
Dirk Olbrich 695f75f3a7 fix missing capitalization 2023-09-01 11:56:11 +02:00
Dirk Olbrich 7d7c04ddc0 cmake format and unify file 2023-09-01 11:56:11 +02:00
Dion Moult 863bf8ebbe Fix bug where models that might have invalid shapes or 2D far shapes might break georeferencing and model loading. 2023-09-01 17:39:53 +10:00
Dion Moult 0fcc28f50c Minor fix 2023-09-01 17:33:33 +10:00
Dion Moult 04e9a08f3d IfcTester BCFs now include viewpoints for occurrences 2023-09-01 17:29:06 +10:00
Dion Moult 837c401116 Add filepath popup when saving IDS reports to BCF 2023-09-01 17:28:19 +10:00
Dion Moult b087d5125f Bump IOS 2023-09-01 16:55:18 +10:00
Dion Moult a6bff09c78 Update BBIM tester module UI to be compatible with new IfcTester upgrades 2023-09-01 16:47:55 +10:00
Dion Moult 4716c0b7b7 IfcTester now supports much more granular statistic reports and more detailed / beautiful HTML reports. 2023-09-01 16:46:49 +10:00
Dion Moult 1d040a170e Fix #3649. Increase profile threshold. 2023-08-31 23:04:55 +10:00
Dion Moult 951026a95c Fix #3667. Allow removing drawings if the sheet hasn't yet been generated or manually removed. 2023-08-31 22:36:18 +10:00
Dion Moult c6b82bfa56 Fix #3647. Fix bug where Windows .exe suffix needed to be explicit in commands. No more eval, and commands must now be provided in json form, and variables should be given as simple strings. 2023-08-31 22:28:33 +10:00
Sigma Dimensions (Yass) 01b6d90432 fix failed context for hotkey Shitf+C #3676 2023-08-31 11:14:53 +01:00
dushyant basson 504a116ebf Update src/qtviewer/ParseIfcFile.cpp
Co-authored-by: Thomas Krijnen <t.krijnen@gmail.com>
2023-08-31 10:17:30 +02:00
dushyant basson be785a878c Update src/qtviewer/ParseIfcFile.cpp
Co-authored-by: Thomas Krijnen <t.krijnen@gmail.com>
2023-08-31 10:17:30 +02:00
dushyant basson 5c2b7404d2 Revert "Updated included header files"
This reverts commit 65f86d929e.
2023-08-31 10:17:30 +02:00
dushyant basson 84e9e2396a Updated included header files 2023-08-31 10:17:30 +02:00
Dushyant Basson 7687d5e26e Added output panel (for debug info, etc.) 2023-08-31 10:17:30 +02:00
Dushyant Basson 25ce3b039e added IFCOS libraries; Qt include dir 2023-08-31 10:17:30 +02:00
Dushyant Basson 9c4c42e27e comment edit: Qt5 to Qt6 2023-08-31 10:17:30 +02:00
dushyant basson 26dd850ac1 added .cache to .gitignore 2023-08-31 10:17:30 +02:00
dushyant basson 0380c286a5 Rename files - fixing case change 2023-08-31 10:17:30 +02:00
dushyant basson 10aca77de4 Updated to use Qt6; Created initial structure of the viewer with OpenGL widget 2023-08-31 10:17:30 +02:00
Dion Moult b6f2fdef77 Fix #3531. See #3660. Exclude 2D elements from generating shapely surface polygons in drawings. 2023-08-31 18:14:06 +10:00
Thomas Krijnen 9cc1f5f0e3 #3660 Oops... propagate setting 2023-08-31 08:27:45 +02:00
Dion Moult adcf22f281 Fix #3002. You can now have metadata classes on projection lines. 2023-08-31 12:40:39 +10:00
Dion Moult ad0c49ac37 Bump IOS to take advantage of setSegmentProjection 2023-08-31 12:40:39 +10:00
Thomas Krijnen 73d77b8382 Update rule_executor.py - catch some runtime errors 2023-08-30 14:56:35 +02:00
Andrej730 3e45f39ea2 Fixed #3666 after 101972f 2023-08-30 17:43:11 +05:00
Thomas Krijnen a2bb015c79 Update validate.py - catch some runtime errors 2023-08-30 13:48:31 +02:00
Thomas Krijnen b231f43fc7 Update ci.yml 2023-08-30 11:38:28 +02:00
Thomas Krijnen 383038fdb4 Update ci-py-only.yml 2023-08-30 11:38:20 +02:00
Thomas Krijnen fbd8ea1edb #3660 setSegmentProjection() / --svg-segment-projection options 2023-08-30 10:57:33 +02:00
Dirk Olbrich 26e292dd34 docs: fix backslash in cmake command 2023-08-30 10:31:41 +02:00
Dion Moult c520e16031 Fix #3644. Annotation matrixes properly calculated now for RCPs. 2023-08-30 18:16:08 +10:00
Bruno Postle 101972fbad BlenderBIM keep view when switching git revision 2023-08-29 22:28:02 +01:00
Sigma Dimensions (Yass) f23ebc4031 fix issue where add materials operator would only show when a material is selected 2023-08-29 17:00:24 +01:00
Sigma Dimensions (Yass) 44431db092 fix toggle link selectability and visibility when linked IFCs use a relative path 2023-08-29 16:32:18 +01:00
Sigma Dimensions (Yass) d1b6c1ffe4 fix loading and unloading linked IFCs with a relative path 2023-08-29 16:30:29 +01:00
Sigma Dimensions (Yass) 4d98151b62 fix various issues by preventing data from linked IFCs to be saved in current project 2023-08-29 16:28:40 +01:00
Sigma Dimensions (Yass) 5e8e18e3b5 Maintain active status filters override when activating 3D model during drawing worfklows 2023-08-29 10:29:03 +01:00
Andrej730 808ff548ec IfcElementType now appears first in Object Metadata
Because it's seems more general workflow to create types than just assign classes.
Example - https://i.imgur.com/DD8twX3.png
2023-08-29 13:58:14 +05:00
Andrej730 bc9b482373 Rename IFC AU Library to IFC Furniture library
Just thought watching BIM Voice last video that some people may overlook it like something Australia specific with "IFC AU Library" name.
2023-08-29 13:58:14 +05:00
Sigma Dimensions (Yass) 4506eb0df9 fix removing drawings from sheets when deleting drawings #3645 2023-08-29 00:45:01 +01:00
Ryan Schultz 921d412fc7 Spreadsheet Import/Export: Fix feet and inch formatting 2023-08-28 10:11:24 -05:00
Andrej730 6089d3af78 shape_builder docs test 2023-08-28 16:14:05 +05:00
Christoph Mellueh b8168ca606 add build to Makefile and use it in bcf-pypi Workflow 2023-08-28 11:24:19 +02:00
Andrej730 61a7325bc0 fill-bg for text instead of the entire symbol by default #3594
Before - https://i.imgur.com/OsQycgW.png
After - https://i.imgur.com/rZvXIoT.png
2023-08-28 11:58:17 +05:00
Chetan c483116b32 Create constants ELEMENT_ARRAY_BUFFER and ARRAY_BUFFER to allow for more descriptive bufferview construction. Change the bufferViewId variable from a static variable to a member variable because python instances of IfcOpenShell can have multiple serializers open at any given time. This commit also includes some minor code reformatting and code comments explaining the changes done. Finally integer constants GLB_FILE_HEAER, GLB_JSON_HEADER, GLB_BINARY_CHUNK_HEADER were added to make the glb file header creation more descriptive 2023-08-28 08:46:11 +02:00
Chetan 55a623dc97 Give each accessor its own buffer view to improve the memory and rendering efficiency of the glb file 2023-08-28 08:46:11 +02:00
Sigma Dimensions (Yass) ad420108b0 run black and fix silly code #3652 2023-08-27 18:43:33 +01:00
Sigma Dimensions (Yass) 9944c7d2de you can now reload linked IFCs #3652 2023-08-27 18:21:19 +01:00
Sigma Dimensions (Yass) 1a8f2be4fd Move grids panel under Project Setup 2023-08-27 18:19:33 +01:00
Dion Moult 13f64fdfe2 Write documentation describing facet selector and element query syntax. 2023-08-27 22:32:41 +10:00
Dion Moult 38a9e29102 Bump IOS and enable unify inputs. 2023-08-26 22:11:54 +10:00
Dion Moult 3c23a57138 Minor fix to use new regex syntax in select similar dialog. 2023-08-26 18:26:03 +10:00
Dion Moult 7baed872c6 Minor fixes, and IfcCSV now uses pandas to import ODS/XLSX for more robust importing. 2023-08-26 18:24:48 +10:00
Dion Moult 9a7a284561 Selector element key queries now allow for regex matching, and single regex matches return that only item, not a list with one item in it. 2023-08-26 16:42:18 +10:00
Dion Moult e9c24a2656 Fix #3587. IfcCSV now supports custom formatting functions. 2023-08-26 15:15:34 +10:00
Gorgious56 5c73ef0a6d Fix #3641 : Error when creating roof type 2023-08-25 15:13:07 +02:00
Carlos Dias 6c29c53a72 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-08-25 08:25:25 -03:00
Thomas Krijnen dadcbe61ea #3158 Fix unify inputs 2023-08-25 12:48:45 +02:00
Thomas Krijnen 93502a05ea Update draw.py --with-unify-inputs [True] 2023-08-25 12:43:32 +02:00
Andrej730 5ebde4c79a small info message on bim.get_representation_ifc_parameters
just to notify that it worked but haven't found any parameters
2023-08-25 12:16:40 +05:00
Dion Moult cf21ae22f1 Fix incorrect implementation of regex matching 2023-08-25 17:15:21 +10:00
Dion Moult cc500ae833 Fix #3635. Minor fix. 2023-08-25 16:59:08 +10:00
Dion Moult 256c0baa14 Accommodate invalid Revit models where they have invalid material relationships. 2023-08-25 16:52:00 +10:00
Dion Moult 66decc604e Fix failing tests and optimise brick tests. 2023-08-25 16:52:00 +10:00
Andrej730 356bc18078 fixed errors after 13309cb8c #3624
for example it was throwing errors when using WindowTool you selected a wall and it would try to assign current type to wall
2023-08-25 11:26:37 +05:00
rileywong311 1344cbc192 Update core/test_brick.py 2023-08-24 16:38:54 -07:00
rileywong311 e00ffb07ad Update tool/test_brick.py 2023-08-24 16:38:54 -07:00
rileywong311 dba43590a5 Fix bug where split screen selection from previous page is out of range on the next 2023-08-24 16:38:54 -07:00
rileywong311 a0613cfee6 Undo indentation from commit <e08283350> (did not account for no name existing) 2023-08-24 16:38:54 -07:00
rileywong311 c3de72b71a Fix Brick core
- 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"
2023-08-24 16:38:54 -07:00
rileywong311 39fc60a482 Update core\tool.py for Brick 2023-08-24 16:38:54 -07:00
rileywong311 0d7e71a269 Fix Brick tool
- 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
2023-08-24 16:38:54 -07:00
rileywong311 78a2f65ec3 Fix brick.feature
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.
2023-08-24 16:38:54 -07:00
rileywong311 802bd74c52 Refactor UI get_brick_relations 2023-08-24 16:38:54 -07:00
rileywong311 33cf40debb Fix condition for hiding "view_brick_item" 2023-08-24 16:38:54 -07:00
rileywong311 ff63fd9f6f Rename 'add_brick_failed" to "add_brick_relation_failed" 2023-08-24 16:38:54 -07:00
rileywong311 5b207e6f54 Fix indentation for assign Brick reference 2023-08-24 16:38:54 -07:00
Gorgious 695dc6ec5a Fix #3636 : Check if representation class exists before testing if it's a circle extrusion representation 2023-08-24 20:42:42 +02:00
Sigma Dimensions (Yass) d3bcb8c6b9 updating a duration will not auto update schedule usage 2023-08-24 15:51:33 +01:00
Andrej730 6226aea3c3 Fixed bug adding ports to the transitions between profiles with an offset
end port ended up located without the offset
2023-08-24 18:22:03 +05:00
Andrej730 a30ad9b886 Fixed bug in shape_builder.mep_transition_calculate
it wasn't taking account that `h` can also end up negative
2023-08-24 18:22:03 +05:00
Andrej730 2b1e17681f Fixed bug with segments incorrectly adjusted after adding transition
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.
2023-08-24 18:22:03 +05:00
Dion Moult 8f25a31f19 Fix more failing tests. 2023-08-24 23:03:43 +10:00
Sigma Dimensions (Yass) 1c7e6cf1b9 fix bug where nested resources in task ICOM panel didn't show 2023-08-24 13:58:18 +01:00
Sigma Dimensions (Yass) fc7459c07f Resource Features :
- 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
2023-08-24 13:43:25 +01:00
Gorgious56 8f6932de64 Prevent user from editing the mesh of a circle based extrusion 2023-08-24 14:16:59 +02:00
Dion Moult b708100c03 See #3581. Fix failing IOS tests. 2023-08-24 22:12:44 +10:00
Christoph Mellueh d4e2d3d2dd rename File and unify with ci-ifctester-pypi 2023-08-24 21:05:54 +10:00
Andrej730 13309cb8c4 Fixed #3624 - tools props were updating only for BIM Tool
It wasn't taking into account WallTool, BeamTool and all other tools we have.
2023-08-24 15:42:23 +05:00
Andrej730 5a4bc0909b Update currently selected ifc class and type on selecting object
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
2023-08-24 15:20:36 +05:00
Andrej730 39540e5794 A button to jump back from boolean to the original object
Example - https://imgur.com/a/A3dVbFM
2023-08-24 14:29:42 +05:00
Dion Moult 0a0f977b5c Fix #3632. Make search and CSV UIs share the same Blender props for DRY. 2023-08-24 17:01:25 +10:00
Dion Moult 13a75e7ad7 You can now reorder columns in IfcCSV 2023-08-24 13:56:43 +10:00
Dion Moult 99574d6255 Loading IFCs now prioritise 2D bodies over 3D non-bodies. This helps prevent loading and seeing a bunch of Box / Clearance representations. 2023-08-24 13:24:08 +10:00
Dion Moult 968cceb725 Fix #3627. Bug where exclude didn't take into account entities are "OR" not "AND". Whoops. 2023-08-24 11:50:48 +10:00
Sigma Dimensions (Yass) 002985a446 run black 2023-08-23 21:21:19 +01:00
Sigma Dimensions (Yass) 5adc29b0b3 Feature to calculate required resources 2023-08-23 21:21:03 +01:00
Sigma Dimensions (Yass) 52ea4ff44d Calculates the number of resources based on required person-hours. 2023-08-23 21:19:16 +01:00
Sigma Dimensions (Yass) 4e31a87c20 clean up Resource UI using column layout 2023-08-23 21:15:59 +01:00
Jesusbill 5d85390715 Fix duplicate id in EP_set_Drawing template 2023-08-23 17:01:25 +02:00
Andrej730 3e13eb8942 bump ifcsverchok release in readme 2023-08-23 18:43:27 +05:00
Andrej730 262c6d1fcb added UI to display connections for realizing elements
Example - https://imgur.com/a/1ZZlTwp
2023-08-23 18:42:07 +05:00
Andrej730 12b5a88861 Added small UI to show realizing elements for the connections
Example - https://i.imgur.com/JLDcnbK.png
2023-08-23 18:42:06 +05:00
Andrej730 2ccc9d886e test to make sure nothing happened to ifcsverchok 😅 2023-08-23 18:42:06 +05:00
Andrej730 a78769c8ff a bit faster renaming ifc elements when renaming blender objects
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
2023-08-23 18:42:06 +05:00
Andrej730 1a142ad5eb fixed bug in mep transitions
it wasn't taking into account that offset can be too big to sustain the angle
2023-08-23 18:42:06 +05:00
Andrej730 2bc22e150c added tests for shape builder transition length calculator 2023-08-23 18:42:06 +05:00
Sigma Dimensions (Yass) aad5d280fd you can now also update resource numbers (usage) from the task ICOM resource list 2023-08-23 14:13:16 +01:00
Sigma Dimensions (Yass) 7ab07ed149 refactor highligh_task code 2023-08-23 14:04:39 +01:00
Dion Moult 3690998dbc Fix #3620. Bug where manually inserted windows should preseve the existing Z value. 2023-08-23 23:03:13 +10:00
Sigma Dimensions (Yass) 1b83fcc1c7 when editing sequence relationships, enabling selecting successor and predecessor task 2023-08-23 14:02:53 +01:00
Sigma Dimensions (Yass) 5cf25c45f9 feature to select a resource in resource tree from task ICOM list 2023-08-23 13:59:31 +01:00
Dion Moult efa734c06e Fix #3628. Minor issue where regex queries didn't load properly. 2023-08-23 22:42:21 +10:00
Dion Moult e242244ec0 The copy property tool now works on enumerated properties. Hooray for copying over statuses! 2023-08-23 17:47:20 +10:00
Andrej730 6f9da163fb Small fix for 422f772c4 2023-08-23 12:32:37 +05:00
Dion Moult a3fd169bb6 IfcPatch now uses the new facet selector syntax. 2023-08-23 17:10:17 +10:00
Dion Moult 899056f929 Due to popular demand, custom EPset_Status to be used for "userdefined" status values as well as for things which don't have a status. 2023-08-23 17:10:17 +10:00
Dion Moult 132fef1b76 New Status panel for managing statuses in the costing / scheduling tab. 2023-08-23 17:10:17 +10:00
Andrej730 422f772c40 Fixed bug with remembering materials assigned to faces
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
2023-08-23 11:07:57 +05:00
Sigma Dimensions (Yass) 66f5081ada implement calculating task duration based on resource usage change for fixed person-hours and prevent constrained attributes from updating 2023-08-23 02:19:44 +01:00
Dion Moult 839e35f1da Fix #3627. Error where using filters incorrectly applied includes / excludes. 2023-08-23 11:15:38 +10:00
Sigma Dimensions (Yass) 40d9713326 consolidate constraint utilities into ifcopenshell.util.constraint and refactor 2023-08-23 02:11:18 +01:00
rileywong311 17b04ad697 Update Brick feature tests 2023-08-22 13:15:01 -07:00
rileywong311 2f99dd8e98 Catch Assign_Brick_Reference with no selections 2023-08-22 13:15:01 -07:00
rileywong311 49f825ba82 Refactor+polish Brick UI 2023-08-22 13:15:01 -07:00
rileywong311 3f18ad0bc5 Use "split" in Brick relations list to better align layout 2023-08-22 13:15:01 -07:00
rileywong311 991c42e816 Update Brick References Panel 2023-08-22 13:15:01 -07:00
rileywong311 20d6eae50a Export/assign Brick library reference uses "label" if there is one 2023-08-22 13:15:01 -07:00
rileywong311 9740582a84 Brick UI relations list uses "label" if there is one 2023-08-22 13:15:01 -07:00
rileywong311 a8046a6d69 Restore Brick select ifcGlobalID functionality 2023-08-22 13:15:01 -07:00
rileywong311 d6655a5c14 Move Brick "set last saved" to BrickStore 2023-08-22 13:15:01 -07:00
rileywong311 0a3a2db4ae Simplify buttons for add Brick relations manually 2023-08-22 13:15:01 -07:00
rileywong311 499eb5ea14 Rework Brick UI into toggle panels 2023-08-22 13:15:01 -07:00
rileywong311 b8ca287883 Fix up convert_ifc_to_brick
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
2023-08-22 13:15:01 -07:00
rileywong311 52f3392ece Remove Brick data debugging printouts 2023-08-22 13:15:01 -07:00
rileywong311 d53641ce5e Check Brick library location exists 2023-08-22 13:15:01 -07:00
Sigma Dimensions (Yass) 7a3ad6c3a1 forgotten bits and bobs + run black 2023-08-22 20:03:09 +01:00
Sigma Dimensions (Yass) 0b2007011e Feature to constrain a resource work or number of used resources 2023-08-22 20:01:19 +01:00
Sigma Dimensions (Yass) eae6983ca5 Fix calculating resource work based from parent's productivity and improve UI to show this 2023-08-22 19:54:37 +01:00
Sigma Dimensions (Yass) 0ec337748f improve purge of remove_metric usecase 2023-08-22 19:36:01 +01:00
Sigma Dimensions (Yass) 2699278ba3 api usecase to add a reference path to a metric objective 2023-08-22 19:34:47 +01:00
Sigma Dimensions (Yass) 0406166d8a fix updating an objective's metric 2023-08-22 19:21:26 +01:00
Andrej730 2128eda87b Save blenderbim last commit hash to the ifc header
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');
2023-08-22 19:59:46 +05:00
Carlos Dias 59e11aa804 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-08-22 11:14:04 -03:00
Dion Moult 21f4fb169f New util function to format a length value in preparation for custom formatting rules in drawings and schedules. 2023-08-22 23:12:37 +10:00
Thomas Krijnen 30fc52ebd9 #3616 Only consider distance orthogonal to projection vector for 2d boolean preprocessing 2023-08-22 15:00:25 +02:00
Andrej730 64bc7af4ef mep transitions - correct angle when connected segments share the same dimensions
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.
2023-08-22 16:06:24 +05:00
Dion Moult b3f1fc667a IfcCSV can now create summary rows (e.g. total, average) at the end of the table (may or may not be in addition to group totals). 2023-08-22 21:04:59 +10:00
Dion Moult fcbb28f9d8 When you force an object to be a tessellation, automatically remove all parametric constraints for you. 2023-08-22 17:32:29 +10:00
Dion Moult 240a31db3a Fix bug where split elements by plane didn't work on multiple elements due to forgetting to toggle normals of the cutting plane. 2023-08-22 17:31:54 +10:00
Dion Moult c1bde09585 IfcCSV now supports grouping and group operations like concat, sum, min, max, etc. 2023-08-22 15:43:31 +10:00
Dion Moult 5dd2b5e555 New support for sorting IfcCSV outputs 2023-08-22 14:32:26 +10:00
Dion Moult 37dcb92220 Drawing include/exclude filters now use the new facet selector syntax 2023-08-22 11:31:18 +10:00
Dion Moult 6c43c60d04 Drawings now can include non-drawing specific annotations too. 2023-08-22 11:30:48 +10:00
Dion Moult b8d191ac1c Now support custom queries for advanced users in the facet selector (similar to old selector). Also support types and count keys. (e.g. filter by objects with zero types, or zero materials, etc). 2023-08-21 23:44:20 +10:00
Dion Moult 57173c7740 You can now get specific container types via util.element or util.selector. E.g. if you wanted to know what building an object is in or what storey an object is on. 2023-08-21 23:07:02 +10:00
Andrej730 2d3295ec54 more work on transitions for MEP
- 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
2023-08-21 17:56:17 +05:00
Andrej730 941ede117c show error if transition length is more the segments length 2023-08-21 17:56:17 +05:00
Andrej730 4210b8333f fix the errors occured trying to find compatible fitting type
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.
2023-08-21 17:56:17 +05:00
Sigma Dimensions (Yass) 1723d1e5a9 Update tests for editing sequence relationships 2023-08-21 13:43:43 +01:00
Sigma Dimensions (Yass) 3ee06ee7a0 remove unused function 2023-08-21 13:41:42 +01:00
Sigma Dimensions (Yass) d3e8da58dc stop committing print statements 2023-08-21 13:30:20 +01:00
Sigma Dimensions (Yass) 29e000b939 clean up updating selected task ICOM and UI re-ordering for work schedule subpanels 2023-08-21 13:28:08 +01:00
Sigma Dimensions (Yass) 6686a72d1f editing sequence relationships now requires less clicks 2023-08-21 13:24:36 +01:00
Sigma Dimensions (Yass) 7dd20f69d7 ligten up add cost schedule UI 2023-08-21 01:13:17 +01:00
Dion Moult 0044ef5588 Close #3615. Follow (terrible, unofficial) convention that boolean result is intentional and boolean clipping result is automated. 2023-08-21 08:53:14 +10:00
Dion Moult ffa5686b22 Fix #3614. Remove_pset API now supports removing predefined property sets (E.g. door lining properties). 2023-08-21 08:44:24 +10:00
Sigma Dimensions (Yass) ab8d6bea99 update sequence tool functions 2023-08-20 23:02:31 +01:00
Sigma Dimensions (Yass) e7bb89f582 You can now save and load 4D animation color schemes 2023-08-20 21:39:00 +01:00
Dion Moult c80b0464e5 Fix #3551. Project specific pset templates now show up in the pset template editor. 2023-08-20 23:51:38 +10:00
Dion Moult 7e3547b309 Fix #3610. Glitch where editing existing float cells in IfcCSV ODS files created new cells or didn't update. 2023-08-20 23:42:11 +10:00
Dion Moult 45c7432ff7 Minor fix 2023-08-20 22:53:32 +10:00
Dion Moult c98c20d403 Fix #3583. BaseQuantity QTOs in IFC4 can now be set on types. 2023-08-20 20:50:46 +10:00
Dion Moult d26a2580ea Fix #3605. Bug where invalid representation type was created when booleans are added / removed. 2023-08-20 17:12:01 +10:00
Dion Moult f84c4ab2e5 IfcCSV now supports importing from ODS, XLSX, and Pandas dataframes in addition to CSV 2023-08-20 16:55:01 +10:00
Dion Moult de6676a516 Fix #3609. IfcCSV can now optionally attempt to "preserve" formatting for XLSX and ODS. 2023-08-20 16:34:42 +10:00
Dion Moult bfbb7bec94 Fix #2973. Bundle pandas, openpyxl, and odfpy in preprataion for upgrades in IfcCSV and IfcFM. 2023-08-20 15:28:09 +10:00
Dion Moult ac00aaae4d Fix #3607. IfcCSV now supports omitting the GlobalId column. This is great for presentation schedules, but the tradeoff is that you can't use it for imports. 2023-08-20 14:41:34 +10:00
Dion Moult 422222a7cb Bump IOS 2023-08-19 23:13:25 +10:00
Dion Moult e1c7b37d62 See #3587. IfcCSV now supports custom header titles. 2023-08-19 23:09:40 +10:00
Ryan Schultz dec978743b small fix on 'Live development environment' instructions 2023-08-18 13:15:35 -05:00
Sigma Dimensions (Yass) 10fae033c8 fix saving and loading coulour schemes 2023-08-18 17:09:00 +01:00
Sigma Dimensions (Yass) b23180d287 fix enumartion of saved searches 2023-08-18 17:08:01 +01:00
Gorgious56 99ccd81b3f You can now purge unused representations from the purge data panel 2023-08-18 16:20:41 +02:00
Gorgious56 e2d3f3a351 You can now purge types from the Purge data panel
And refactor a bit the purge profiles code to make use of the profile tool module
2023-08-18 16:04:08 +02:00
Dion Moult 5e6a444aa2 Advanced users can now directly edit search filter queries. 2023-08-18 23:39:13 +10:00
Dion Moult 72cf5cfc59 Minor fix to allow edit_work_time to work seamlessly for IFC4X3. 2023-08-18 23:01:24 +10:00
Andrej730 75cb68d2f1 Refactored svg angle decorator code, solves #3602, more constistency between viewport and svg
Now it should be more consistent and more stable since svg and viewport are now using much more similar approach.
2023-08-18 17:59:40 +05:00
Dion Moult 7f40a9d723 See #3603. Base64 encode gantt chart JSON data to prevent JSON parsing problems. 2023-08-18 22:19:27 +10:00
Andrej730 dcc9d0e9cd set_objects_selection to set selection only if active_object is not None
It was creating errors if you'd try to add angle annotation without having any objects active.
2023-08-18 15:37:04 +05:00
Sigma Dimensions (Yass) 7228329f5e Start improving UI for clash detection and management 2023-08-18 11:04:21 +01:00
Gorgious56 d8786717b6 Active profil users count is now dynamically fetched when the profile is clicked in the UI list 2023-08-18 09:43:46 +02:00
Andrej730 b73bd3506f Fixed clearing scales (after 3345d7e)
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)
2023-08-18 12:05:53 +05:00
Andrej730 bdb2791b35 Fill-bg for template tags #3594
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.
2023-08-18 12:04:42 +05:00
Dion Moult 549ea11945 Support arbitrary element selection for manual groups in search / IfcCSV, with support for huge element selections. 2023-08-18 16:58:07 +10:00
Dion Moult aed01b5703 IfcCSV can now use the graphical filter query builder too. 2023-08-18 13:43:42 +10:00
Dion Moult 13eb8562e0 Add support for converting IFC spaces, systems, and feed / location / part relationships into Brick. Brick utilities can now get downstream equipment, and system util can now take into account port flow direction. 2023-08-18 10:25:06 +10:00
rileywong311 c022a12835 Support displaying Brick Bnode relations
- 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
2023-08-17 16:19:49 -07:00
rileywong311 04eb47ff65 HIde Brick "Create Relation:" when not toggled 2023-08-17 16:19:49 -07:00
rileywong311 10ecd16f0c Refresh Brick split screen on ConvertIfcToBrick 2023-08-17 16:19:49 -07:00
rileywong311 75852bfa75 Rework "view brick item" conditional access
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.
2023-08-17 16:19:49 -07:00
rileywong311 750c720c9b Support Add Brick with IfcEntity selected (part 2 aka references)
Can now assign references again.
See https://github.com/BrickSchema/Brick/tree/master/examples/ifc for examples.
2023-08-17 16:19:49 -07:00
rileywong311 4697681fcb Support Add Brick with IfcEntity selected (part 1)
Next is to add the reference
2023-08-17 16:19:49 -07:00
Dion Moult 9398363cbf Fix #3589. Users can now configure how the null values are represented in IfcCSV. 2023-08-18 08:50:48 +10:00
Massimo Fabbro ae45e6b960 Clone opening initial draft 2023-08-18 08:30:36 +10:00
Gorgious 88c002703e Move profile data and inverse check in data class 2023-08-17 21:00:03 +02:00
Gorgious56 51c78a89bd simplify ifc class suggestions json file and operator 2023-08-17 17:31:00 +02:00
Gorgious56 e36a958c0d Scene properties : Highlight buttons to make them stand out more (#3598) 2023-08-17 16:56:26 +02:00
Gorgious56 a8126a6f90 You can now purge unused profiles 2023-08-17 16:26:21 +02:00
Dion Moult 9b857cdefa Fix #3596. Fix bug where objects marked as edited were not unmarked after saving when toggling mode. Also fix bug where updating representation didn't check whether or not the meshlike representation has openings applied (which would bake the openings, instead of leaving them dynamic). 2023-08-18 00:04:02 +10:00
Gorgious56 90e6400115 Active Profile's inverse relationships count is now displayed in the profiles editor 2023-08-17 15:44:37 +02:00
Dion Moult 2dcfcf9708 Fix #3591. Fix bug where IfcCSV import was not symmetric capability wise. Now you can set all sorts of complex values with the exact same keys you are using to query. 2023-08-17 23:33:40 +10:00
Thomas Krijnen f4971da42e #3429 Fix b operand non-planar face check 2023-08-17 11:28:02 +02:00
Andrej730 008f953b6c Fix tests errors after 8689164
Error was AttributeError: module 'blenderbim.bim.handler' has no attribute 'setDefaultProperties'
2023-08-17 13:18:27 +05:00
Andrej730 5481237480 geometry.edit_object_placement was producing orphaned placements
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.
2023-08-17 13:18:27 +05:00
Andrej730 4f7564e5ae misspelling 😅 2023-08-17 13:18:27 +05:00
Dion Moult d214cbaece Fix #3590. Update dev instructions to symlink other utility libraries in BBIM. 2023-08-17 17:37:37 +10:00
Dion Moult d0c5f1e69f Fix #2626. New IFC overrides for setting object origins. 2023-08-17 17:25:40 +10:00
Massimo Fabbro 4ba3240fb4 fix #3213 Problem related with sheet created on windows and opened on Linux 2023-08-17 16:22:16 +10:00
rileywong311 6d8e5e4c83 Merge Brick classification
https://github.com/rileywong311/BrickIfcClassification
2023-08-17 16:21:29 +10:00
rileywong311 cd1402570b Merge IfcClassification
https://github.com/Moult/IfcClassification/tree/master
2023-08-17 16:21:29 +10:00
Sigma Dimensions (Yass) 6c0e528dd2 enable an object to take part in an object type decomposition #3592 2023-08-16 16:08:27 +01:00
Dion Moult 297a513d21 Don't strictly require guids / class filters that exist in new facet selector. 2023-08-16 14:05:26 +10:00
Andrej730 9f0a4ba064 Calculate/guess quantity descriptions to avoid confusion 2023-08-15 14:42:31 +05:00
Dion Moult 8813ed66e0 See #3582. Fix bug where switching representations didn't handle curves in a body / model_view.
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.
2023-08-15 18:06:16 +10:00
Andrej730 fafcd5dfca root.copy_class to remove connections from previously connected ports 2023-08-15 10:35:36 +05:00
Carlos Dias 155a8b79da Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-08-14 22:10:54 -03:00
Dion Moult f523870b57 Fix #3584. Support matching enumerated properties in new facet selector. 2023-08-15 09:59:50 +10:00
Sigma Dimensions (Yass) 2ed24434c8 experimental import plot coordinates 2023-08-14 18:22:11 +01:00
Andrej730 6878b2c072 Handle ods schedules without column styles #3573
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.
2023-08-14 17:46:10 +05:00
Dion Moult 0ed8dc970d New simplified IfcFM parser for basic object data. 2023-08-14 16:14:57 +10:00
Andrej730 bc85f09109 Small info message on using validate 2023-08-14 11:09:26 +05:00
Andrej730 793b28e43b Remove empty IfcDocumentInformationRelationship #3581 2023-08-14 11:09:26 +05:00
Dion Moult ed4abacd1e Fix #3578. Support querying surface styles in tools like IfcCSV. 2023-08-14 11:55:15 +10:00
Dion Moult 8bf55ab46c See #3561. Misc annotation decorator now only highlights non-internal edges. 2023-08-13 23:34:06 +10:00
Dion Moult 7edabce657 Fix #3562. Non-manifold geometry is no longer considered in join criteria as there is no such thing as a closed polygon. 2023-08-13 23:04:32 +10:00
Sigma Dimensions (Yass) 56187e4da3 Improve Cost Schedule Layout 2023-08-13 13:23:31 +01:00
Sigma Dimensions (Yass) 31a12faef1 woopsies 2023-08-13 12:18:48 +01:00
Sigma Dimensions (Yass) eb94c16465 fix the bug fix #07b5c49 - where counting objects controlled by a cost item stopped working 2023-08-13 12:16:29 +01:00
Dion Moult e8437a9c54 Fix #3253. Bug where duplicating elements with fillings incorrectly recreated fillings at the cursor (i.e. the cursor was used as a target destination).
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.
2023-08-13 20:07:33 +10:00
Dion Moult 840039ef1e Fix #3472. You can now toggle selectability of linked IFCs. 2023-08-13 15:49:23 +10:00
Dion Moult 84a749605e See #3579. Support Google Colab as an installation option. 2023-08-13 14:48:49 +10:00
Bruno Postle c1283d2ab0 fix SyntaxError: '(' was never closed 2023-08-12 21:36:40 +01:00
Sigma Dimensions (Yass) 07b5c4918b fix api logic where only quantities of the same type can be assignmed to a cost control 2023-08-12 15:17:32 +01:00
Sigma Dimensions (Yass) 703f0a6b70 fix orphaned data when unassigning element quantities from cost item control 2023-08-12 14:57:01 +01:00
Dion Moult 5e98dee46f Fix #3554. Support editing IfcIndexedPolyCurve profiles where IfcLineIndex has >2 indices. 2023-08-12 22:25:34 +10:00
Sigma Dimensions (Yass) b2eddf55d2 Fix contracting/expanding cost schedule tree and add tests to avoid proof changes 2023-08-12 12:58:16 +01:00
Massimo Fabbro db7be640d4 Fix #3569 Variable name override caused the bug (#3575) 2023-08-12 19:03:58 +10:00
Dion Moult 04fa597844 Fix #3564. Bug where IfcBuiltSystems didn't show up due to missing icon in IFC4X3. 2023-08-12 17:09:48 +10:00
Dion Moult 694dbeb96c Fix #3576. Explicit drawing annotations are now immune to "include / exclude" filters. 2023-08-12 17:06:22 +10:00
Dion Moult 7afd358c3c Fix #3556. Bug where quantities could not be imported using IfcCSV. Also make IfcCSV support any qset name, not just "Qto" prefixed names. 2023-08-12 16:41:57 +10:00
Dion Moult b0a5a570a9 IfcCSV now uses the new filter query system. 2023-08-12 16:40:59 +10:00
Dion Moult c45b84c850 Fix #3577. Don't force uppercase in schedules. 2023-08-12 16:16:51 +10:00
rileywong311 d575a43aee Make refresh Brick viewer refresh both screens 2023-08-11 16:14:41 -07:00
rileywong311 0b151ea559 Second level query for Brick equipment+point roots 2023-08-11 16:14:41 -07:00
rileywong311 926970b256 Polish Brick UI and add "last saved" label 2023-08-11 16:14:41 -07:00
rileywong311 d58af0bfa5 Filter Brick class if deprecated 2023-08-11 16:14:41 -07:00
rileywong311 429da7c6f3 Filter more (all) Brick ontology namespaces
I'm not sure if this method of filtering out the entire domain will cause problems. This could use investigation.
2023-08-11 16:14:41 -07:00
rileywong311 60a7433573 Clear Brick breadcrumbs on close project 2023-08-11 16:14:41 -07:00
rileywong311 08a5d444d4 Remove another needless BrickStore.graph.triples check
As before, this returns a generator type which always evaluates true, even if it is empty.
2023-08-11 16:14:41 -07:00
rileywong311 1982069b69 Add description to Brick operators 2023-08-11 16:14:41 -07:00
rileywong311 7c06c65df3 Move Brick "set root" button and change roots on update instead of operator 2023-08-11 16:14:41 -07:00
Sigma Dimensions (Yass) 6263766202 fix Cost schedule of rates UI bug where linked types dont't refresh correctly (and black formatting) 2023-08-11 14:57:43 +01:00
Dion Moult 66fbbeff54 See #3561. Fix bug where schedules couldn't be removed. 2023-08-11 22:47:42 +10:00
Dion Moult 3c5ad1328f Auto create relevant context when attempting to add an annotation to make it friendlier for new users. 2023-08-11 22:41:47 +10:00
Dion Moult 3345d7e088 Fix #2894. Implement reflected ceiling plans. Note that this requires new bot build. 2023-08-11 22:41:47 +10:00
Dion Moult 2bb25cb874 See #3501. Minor matrix math fix that caused annotations to not appear in global coordinates. 2023-08-11 22:41:47 +10:00
Dion Moult 444a728e7a Improve default search filter to include types and spatial elements. 2023-08-11 22:41:47 +10:00
Sigma Dimensions (Yass) 70bea0c865 Feature to add a camera to extents of the scene objects 2023-08-11 13:39:58 +01:00
Sigma Dimensions (Yass) 6eea1e9035 feature to clear previous 4D Animation (object keyframes & colors) 2023-08-11 13:36:14 +01:00
Kristoffer Andersen 4deb1836ad Update bld.bat
reduce number of schema variations on windows as well
2023-08-11 11:42:08 +02:00
Kristoffer Andersen 4c8007dcfe Update meta.yaml
pin compatible boost, occt and cgal-cpp
2023-08-11 08:44:25 +02:00
Kristoffer Andersen 000116bb3d Update build.sh
limit number of schema variants
2023-08-11 08:22:52 +02:00
Dion Moult a2b6f21c7a See #2894. Implement SVG mirroring options (typically used for RCPs or useful when converting to other things like DXF). 2023-08-11 16:01:01 +10:00
Sigma Dimensions (Yass) a374ee39d3 simplify setup_default_task_columns 2023-08-11 02:06:49 +01:00
Sigma Dimensions (Yass) 0f5c82dffd animation settings now use human readable durations to make it less confusing 2023-08-11 02:05:37 +01:00
Sigma Dimensions (Yass) 268fed761e simplify updateTaskDuration 2023-08-11 02:03:07 +01:00
Sigma Dimensions (Yass) fe01d252db WIP - Scheduling UI improvements 2023-08-10 22:07:34 +01:00
Sigma Dimensions (Yass) dc36d74337 Hide Header for Costing and Schedule Tab 2023-08-10 16:36:35 +01:00
Sigma Dimensions (Yass) 7a0da7bd8e Revert "Rename and move sub panels of Costing and Schedule Tab"
This reverts commit 9d4715c0a9.
2023-08-10 16:20:13 +01:00
Andrej730 530d5a4e63 plug add_transition to fit_flow_segments 2023-08-10 17:37:52 +05:00
Andrej730 2d847d1704 Adjusting connected elements on bim.regenerate_distribution_element
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
2023-08-10 16:31:08 +05:00
Andrej730 631d8fcfb1 quickly connect mep elements if they have matching ports
Demo - https://imgur.com/a/o9u8M1u
2023-08-10 15:06:16 +05:00
Andrej730 a8888efb88 fixed bug getting port relating element in ifc2x3 2023-08-10 14:12:20 +05:00
Andrej730 a51ecea9b1 More descriptive error message on attempt to delete drawings category 2023-08-10 13:55:46 +05:00
Andrej730 4d49517111 small refactor 2023-08-10 13:49:35 +05:00
Thomas Krijnen d5d1b3567b Update draw.py --include-curves 2023-08-10 15:44:21 +08:00
Kristoffer Andersen 7827ce3448 Update build.sh
fix env var declaration
2023-08-10 08:22:07 +02:00
Kristoffer Andersen a05059db01 Update build.sh
Reduce number of schema versions
2023-08-10 08:06:38 +02:00
Thomas Krijnen b78490ca56 #3510 Sample points along diagonal as well for quick and dirty occlusion detection 2023-08-10 10:52:06 +08:00
Andrej730 f8ffc97bf5 remove_product to also remove psets for types 2023-08-09 16:37:47 +05:00
Andrej730 29d4a8d5fe More Ports UI
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
2023-08-09 15:04:27 +05:00
Andrej730 2c1c13f27e bim.add_transition
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
2023-08-09 15:04:27 +05:00
Andrej730 4dc55e844c Fix default mep profile names
Previously it was generating names like 4000000x4000000 in mm projects.
2023-08-09 14:46:58 +05:00
Thomas Krijnen b611151039 #3536 fix edge segments in world coords 2023-08-09 14:55:23 +08:00
Dion Moult 9fc32e5c2e IfcTester JSON reporter now also stores identification data separately for convenient reporting. 2023-08-09 16:42:03 +10:00
Dion Moult c5e5036fd3 Store applicability in IfcTester JSON results 2023-08-09 15:00:58 +10:00
Dion Moult 0f68679295 Fix #2753. Disable mapping representations when appending assets via the ExtractElements recipe to be more forgiving (and faster) on invalid models. 2023-08-09 00:13:16 +10:00
Dion Moult fea0d93162 Fix SurfaceColour typo that broke loading colours in some IFCs 2023-08-08 23:47:57 +10:00
Dion Moult e43347161a Fix #3547. Bug where using existing clippings were not preserved when editing profile or wall representations. 2023-08-08 22:35:40 +10:00
arun 706aa70899 Update create_2pt_wall.py (#3553)
* Update create_2pt_wall.py

included unit scale for use cases other than si unit

* Revised Update create_2pt_wall.py

included is_si kwarg to select between si units and other units and also changed the dtype of p1 and p2 array to float incase they are entered as integers
2023-08-08 13:06:36 +10:00
Carlos Dias b46ccc9b78 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-08-06 11:21:39 -03:00
Carlos Dias fe5a6749a7 Add element guId in BCF report (#3549) 2023-08-06 21:11:31 +10:00
Thomas Krijnen c3f352c018 #3546 Filter duplicate edge indices 2023-08-06 14:27:31 +08:00
c4rlosdias 4f1e21dfb0 Add element guId in BCF report 2023-08-05 10:50:27 -03:00
Dion Moult 79584dba13 Whoops 2023-08-04 23:56:05 +10:00
Dion Moult 1c74147d89 Dissolve specifically IOS triangulated edges for meshes instead of generic Blender limited dissolve. 2023-08-04 23:49:50 +10:00
Dion Moult cc53744c29 Skeleton operator to regenerate distribution elements recursively 2023-08-04 17:20:50 +10:00
Dion Moult 945836f578 Initial implementation of scale dependent map conversion for IFC4X3 2023-08-04 14:42:43 +10:00
rileywong311 e88e2f5d9c Add brick create relation with split screen 2023-08-03 16:41:30 -07:00
rileywong311 ea267d9443 Implement Brick split screen 2023-08-03 16:41:30 -07:00
rileywong311 d64e4d70c5 Add more subclasses to Brick root options 2023-08-03 16:41:30 -07:00
rileywong311 156844b27d Move Brick list root setting 2023-08-03 16:41:30 -07:00
rileywong311 b96944ff1b Reformat Brick props order and singularize "brick_entity_classes" 2023-08-03 16:41:30 -07:00
rileywong311 7bfa6115ee Refactor AddBrickRelation to combine object namespace+label in operator
This is an important change that should make adding relations through other methods easier to implement
2023-08-03 16:41:30 -07:00
rileywong311 589b3928f3 Guard loading brick files from bad paths
Referred to "IFCFileSelector.is_existing_ifc_file" method for to make this
2023-08-03 16:41:30 -07:00
rileywong311 a884eb5c54 Add "rdfs:label" to Brick relation options
This is a tricky one because "rdfs:label" cannot really be queried from the Brick ontology, so it is a special case that probably needs to get added manually. Furthermore, an entity really shouldn't have multiple labels, so the option to give an entity an "rdfs:label"
 should only appear if it doesn't have one already. The way I did it meant I had to manually reset the Enum type in Blender because it was the active one selection and made the Enum blank since it got removed  now that the entity has a "rdfs:label." One possible alternative solution is to allow multiple labels, but in the query to import bricks in the UI list only select one label somehow.
2023-08-03 16:41:30 -07:00
rileywong311 796d19a3a8 Change BrickschemaData.relations to BrickschemaData.active_relations 2023-08-03 16:41:30 -07:00
rileywong311 b9211e2a93 Load Brick relationships from schema 2023-08-03 16:41:30 -07:00
rileywong311 b662d6f08e Remove if Brickstore.graph.triples check
This returns a generator type which I believe is always truthy, so it didn't change anything.
2023-08-03 16:41:30 -07:00
rileywong311 deecd60ff1 Implement basic Brick create relation 2023-08-03 16:41:30 -07:00
rileywong311 01615724fd Add "remove brick relation" operator 2023-08-03 16:41:30 -07:00
rileywong311 97685a7a77 Rename Brick "attributes" to "relations" 2023-08-03 16:41:30 -07:00
Dion Moult dc1721ed60 Fix #3538. Update bl_info metadata to reflect that we are a native IFC authoring platform not an import-export add-on. 2023-08-03 23:25:13 +10:00
Andrej730 e801ba49b2 option to provide step_id into bim.create_shape_from_step_id directly 2023-08-03 15:54:47 +05:00
Andrej730 2446479d82 remove_product to remove object placement too
previously it wasn't deleting object placement when you removed the objects (and related elements like IfcDirections etc) and working on project long enough you might had a bunch of orphaned data in it
2023-08-03 15:54:47 +05:00
Andrej730 8908011ecf automatically assign ports predefined type 2023-08-03 13:42:00 +05:00
Andrej730 fe6be61d7a small change for readibility 2023-08-02 16:37:09 +05:00
Andrej730 45f81b4780 adjust obstruction position on changing segment length
Now when you change the segment's length connected obstructions will adjust. Same for changing obstruction's length. You can also move obstructions/segment around and then use "Regenerate" to make them fit.
Small demo - https://imgur.com/a/atm8Mdx
2023-08-02 16:33:36 +05:00
Andrej730 92df1b351c add_obstruction to fit_flow_segments, derive it's position from cursor 2023-08-02 14:09:25 +05:00
Andrej730 002c7c1ad9 Fixed #3533 (also fixed the same issue for windows) 2023-08-02 11:42:48 +05:00
Andrej730 a583860b58 Fixed error on drawing tester UI
Error was:
Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\bim\module\tester\ui.py", line 39, in draw
    row.prop(self.props, "should_load_from_memory")
AttributeError: 'BIM_PT_tester' object has no attribute 'props'
2023-08-02 11:41:37 +05:00
Dion Moult 4efe198dbb Whoops 2023-08-02 00:03:24 +10:00
Dion Moult 7a6332c883 Skeleton of "add fitting" operator which decides appropriate fitting type 2023-08-02 00:02:05 +10:00
Andrej730 a14ef1ebc2 Fixed TestGetApplicableTypes after 0e69f484f 2023-08-01 18:24:11 +05:00
Andrej730 fab0f92c8a keep the default flow direction for ports NOTDEFINED as it's not yet set 2023-08-01 17:52:01 +05:00
Andrej730 490937ecf9 operator to add mep obstruction
Currently it's not yet available from UI, only from F3 menu.
On changing segment's length obstruction is not yet adjusted.
Short demonstration - https://imgur.com/a/I5fybpO
2023-08-01 17:45:17 +05:00
Andrej730 cbf8b7f3a2 root.remove_product to remove IfcRelConnectsPorts too
previously if you deleted some flow segment that was connected to another the connection would stay resulting in invalid ifc and other bugs
2023-08-01 17:45:17 +05:00
Andrej730 6c5bc5a3e8 Poll check for show/hide ports
https://i.imgur.com/NFAM1UC.png
2023-08-01 17:45:17 +05:00
Andrej730 f7aa67c6e9 Communicate that blend file is also saved on Ctrl-S
https://i.imgur.com/BnzTDhM.png
2023-08-01 17:45:17 +05:00
Andrej730 4ce41b33bb small add_constr_type_instance refactor
ifc_class removed as it was never used - ifc_class was always figured either from BIMModelProperties.relating_type_id or operator.relating_type_id
2023-08-01 17:45:17 +05:00
Dion Moult a0fd2a11cb Another minor documentation fix 2023-08-01 22:43:40 +10:00
Dion Moult 4443f484c1 Easily create a "default" duct / pipe even if you have no demo library. 2023-08-01 22:34:34 +10:00
Dion Moult 120a9f9f3e Minor documentation fix 2023-08-01 22:25:25 +10:00
Andrej730 e33a400ebb Fixed error opening type manager from window_tool, slab_tool etc
Th error was:

Error: Python: Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\model\ui.py", line 54, in invoke
    props.type_class = props.ifc_class
TypeError: bpy_struct: item.attr = val: enum "" not found in ('IfcActuatorType', 'IfcAirTerminalBoxType', 'IfcAirTerminalType', 'IfcAirToAirHeatRecoveryType', 'IfcAlarmType', 'IfcAudioVisualApplianceType', 'IfcBeamType', 'IfcBoilerType', 'IfcBuildingElementPartType', 'IfcBuildingElementProxyType', 'IfcBurnerType', 'IfcCableCarrierFittingType', 'IfcCableCarrierSegmentType', 'IfcCableFittingType', 'IfcCableSegmentType', 'IfcChillerType', 'IfcChimneyType', 'IfcCivilElementType', 'IfcCoilType', 'IfcColumnType', 'IfcCommunicationsApplianceType', 'IfcCompressorType', 'IfcCondenserType', 'IfcControllerType', 'IfcCooledBeamType', 'IfcCoolingTowerType', 'IfcCoveringType', 'IfcCurtainWallType', 'IfcDamperType', 'IfcDiscreteAccessoryType', 'IfcDistributionChamberElementType', 'IfcDistributionElementType', 'IfcDoorStyle', 'IfcDoorType', 'IfcDuctFittingType', 'IfcDuctSegmentType', 'IfcDuctSilencerType', 'IfcElectricApplianceType', 'IfcElectricDistributionBoardType', 'IfcElectricFlowStorageDeviceType', 'IfcElectricGeneratorType', 'IfcElectricMotorType', 'IfcElectricTimeControlType', 'IfcElementAssemblyType', 'IfcEngineType', 'IfcEvaporativeCoolerType', 'IfcEvaporatorType', 'IfcFanType', 'IfcFastenerType', 'IfcFilterType', 'IfcFireSuppressionTerminalType', 'IfcFlowInstrumentType', 'IfcFlowMeterType', 'IfcFootingType', 'IfcFurnishingElementType', 'IfcFurnitureType', 'IfcGeographicElementType', 'IfcHeatExchangerType', 'IfcHumidifierType', 'IfcInterceptorType', 'IfcJunctionBoxType', 'IfcLampType', 'IfcLightFixtureType', 'IfcMechanicalFastenerType', 'IfcMedicalDeviceType', 'IfcMemberType', 'IfcMotorConnectionType', 'IfcOutletType', 'IfcPileType', 'IfcPipeFittingType', 'IfcPipeSegmentType', 'IfcPlateType', 'IfcProtectiveDeviceTrippingUnitType', 'IfcProtectiveDeviceType', 'IfcPumpType', 'IfcRailingType', 'IfcRampFlightType', 'IfcRampType', 'IfcReinforcingBarType', 'IfcReinforcingMeshType', 'IfcRoofType', 'IfcSanitaryTerminalType', 'IfcSensorType', 'IfcShadingDeviceType', 'IfcSlabType', 'IfcSolarDeviceType', 'IfcSpaceHeaterType', 'IfcSpaceType', 'IfcSpatialZoneType', 'IfcStackTerminalType', 'IfcStairFlightType', 'IfcStairType', 'IfcSwitchingDeviceType', 'IfcSystemFurnitureElementType', 'IfcTankType', 'IfcTendonAnchorType', 'IfcTendonType', 'IfcTransformerType', 'IfcTransportElementType', 'IfcTubeBundleType', 'IfcUnitaryControlElementType', 'IfcUnitaryEquipmentType', 'IfcValveType', 'IfcVibrationIsolatorType', 'IfcWallType', 'IfcWasteTerminalType', 'IfcWindowStyle', 'IfcWindowType')

WARN (bpy.rna): C:\Users\blender\git\blender-v360\blender.git\source\blender\python\intern\bpy_rna.c:1343 pyrna_enum_to_py: current value '8' matches no enum in 'BIMModelProperties', '', 'ifc_class'
2023-08-01 14:19:30 +05:00
Andrej730 2cc9ea0539 tests for system.get_connected_to / get_connected_from 2023-08-01 13:40:06 +05:00
Andrej730 3c8dc70198 error message on setting flow direction for disconnected port
previously it just did nothing which was a bit confusing
2023-08-01 13:40:06 +05:00
Chetan 08d8657588 When creating a GLTF file, make the material double sided to fix a bug where some surfaces were transparent. This will allow surfaces created from a mesh to be be viewed from all angles regardless of the shape of the mesh or the directions of the normals. 2023-08-01 08:46:57 +08:00
Dion Moult e0b4c1a810 Flow segments are now created at a specific RL above the active storey in the BIM Tool 2023-07-31 23:32:10 +10:00
ay-ex a517c9338d fix_choco_cmake_url (#3528)
fixed problematic url for blender cmake
2023-07-31 22:50:26 +10:00
Andrej730 ef01766f4d fixed bug in system.get_connected_to / get_connected_from
import was missing
2023-07-31 17:30:40 +05:00
Andrej730 e9f77f8d2e Create empty at object placement from debug panel
Small feature for debugging - https://i.imgur.com/OSOCIqG.png
2023-07-31 16:00:44 +05:00
Andrej730 a93d4da810 Fixed #3262 2023-07-31 15:17:45 +05:00
Andrej730 e86d3731ff sort keys in the entity to type mapping 2023-07-31 11:46:27 +05:00
Andrej730 0e69f484f4 More general solution for #3466 2023-07-31 11:45:03 +05:00
Dion Moult 3a812a9ec1 Fix #3465. Move representation utilities into new tab system. 2023-07-30 23:18:58 +10:00
Dion Moult 12d70324b8 Fix #3483. You can now conveniently duplicate material layers. 2023-07-30 22:41:28 +10:00
Bruno Postle caff4d0b20 Fix some broken restructured text formatting 2023-07-30 12:41:45 +01:00
Dion Moult afb9aa178f Fix #3453. Hidden annotation type removed, and demo library now comes with linetypes for dashed, fine, thin, medium, thick, and strong. 2023-07-30 21:13:21 +10:00
Wei Yang 356a10eac9 Add UV texture support for IfcTessellatedFaceSet (#3523)
* Add texture support for IfcIndexedTextureMap

* fix description.

* Fix posible duplicate coordinate index issue

* Clean up code.

* revert default clean_mesh.

* Fix errors.

* change to EXTEND mode when not RepeatS/T

* remove tris merge to support mix quads and tris.
2023-07-30 20:34:50 +10:00
Massimo Fabbro 60f60798df Add new api function that allows to create arbitrary profiles with voids (#3522) 2023-07-30 17:30:56 +10:00
Dion Moult 360729738c Fix #3466. Bug in upstream IFC where distribution elements and furnishing elements had no corresponding type and occurrence. 2023-07-30 16:59:25 +10:00
Dion Moult 794212c223 Fix #2906. Basic support added for perspective drawings. 2023-07-30 16:50:17 +10:00
Dion Moult 2015f0618a Fix #3484. You can now have project-specific pset templates distributed with your project in a relative path. Defaults to pset/. 2023-07-30 14:47:05 +10:00
Dion Moult d7158be431 Purge obsolete search operators in favour of new search filters, colour legend system. 2023-07-30 08:16:30 +10:00
Dion Moult 1ccbe831c8 Purge select similar prop operator in favour of dedicated select similar panel 2023-07-30 08:03:37 +10:00
Dion Moult 5a8e4fa8fd Purge obsolete & risky module unloading / loading feature in favour of tabs. 2023-07-30 07:55:04 +10:00
Dion Moult 9048b67724 Fix #3501. Annotation tool now creates annotations at the 3D cursor. 2023-07-29 23:46:45 +10:00
Dion Moult 9059b5d7ec Fix #3511. You can now use a query to load in occurrences from another project (library). 2023-07-29 22:43:50 +10:00
Dion Moult 7af3f89688 Fix #3502. New select similar feature. 2023-07-29 20:46:07 +10:00
Dion Moult 8be0f2e1da Fix #3273. Don't use simple string replacement when renaming drawings but instead identify elements by attributes which is preferred. 2023-07-29 14:46:11 +10:00
Thomas Krijnen 630bb88a15 SVG serialization UnifyInputs option 2023-07-29 10:07:33 +08:00
Thomas Krijnen 6575921ccd Implement IfcGridPlacement 2023-07-29 10:06:44 +08:00
Thomas Krijnen 95eb78e919 ci-ifctester-pypi.yml Add workflow_dispatch event 2023-07-29 09:37:39 +08:00
Thomas Krijnen 78b4b09be9 Include .xsd in ifctester package pypi distribution 2023-07-29 09:34:26 +08:00
Dion Moult 32e02db3f7 Fix #3521. Forgot to commit function. 2023-07-29 10:21:19 +10:00
Sigma Dimensions (Yass) 9d4715c0a9 Rename and move sub panels of Costing and Schedule Tab 2023-07-28 19:04:12 +01:00
Dion Moult 0ba5db751c Fix #3471. Allow to select hidden types (except if the type is excluded). 2023-07-28 23:42:02 +10:00
Dion Moult c1a15d944f Fix #3518. Default to deeper opening extrusions to handle more wall thicknesses. 2023-07-28 23:07:56 +10:00
ay-ex 7cd1c47ceb add ids html report template percentage bars per section (#3520)
adding html report template percentage bars to each section
2023-07-28 18:55:35 +10:00
Dion Moult a1aa047161 Revert "Example of UI if we sentence-cased IFC classes. Good or bad? Please comment at https://community.osarch.org/discussion/comment/16493"
This reverts commit 53bd4bf5ea.
2023-07-28 17:42:41 +10:00
Dion Moult e4896539b4 Fix #3509. Backport Qto_BodyGeometryValidation to IFC4 (via EQto) and fix bug where there was no way to have custom Qtos show up in the qto dropdown. 2023-07-28 17:41:36 +10:00
Dion Moult 47ee667f06 Fix #3517. Fix bug where edit arbitrary profile button doesn't show if your profile has voids. 2023-07-28 17:27:54 +10:00
Dion Moult 7804c9ea80 Potential fix for #3273 where renamed drawings might not get moved on Windows. 2023-07-28 15:35:02 +10:00
Dion Moult 3980666824 Fix #3513. Minor issue where new hierarchical drawing list broke print all feature. 2023-07-28 14:55:22 +10:00
Dion Moult eda0b33b41 Fix #3512. Fix incorrect shapely fills due to unclosed polygons (tolerance issue) and incorrect raycast results. 2023-07-28 12:56:42 +10:00
Ryan Schultz 8fdd0983c0 Merge branch 'v0.7.0' of https://github.com/IfcOpenShell/IfcOpenShell into v0.7.0 2023-07-27 18:34:40 -05:00
Ryan Schultz 0ef141447b added to ifc_classes_suggestions.json 2023-07-27 18:34:27 -05:00
Bruno Postle 06ea0512f5 BlenderBIM filter Git messages, remove sort #3096 2023-07-27 16:35:10 +01:00
Dion Moult 8af11db8c2 Fix #3006. Don't affect visibility of types when activating drawing. 2023-07-27 22:29:17 +10:00
Dion Moult 1c5a4ddf20 Fix #3223. Fix #3474. When creating new representations, give the option to generate bounding box or "outline" curves (60 degree crease threshold hardcoded) instead of full 3D mesh. 2023-07-27 12:36:15 +10:00
ay-ex b792b05753 add collapsible detail results (#3508) 2023-07-26 23:33:36 +10:00
Dion Moult 524bace23b Redo mechanism that allows filtered BIM Tool classes to be less "magic" and more explicit whether it filters all vs a specific element type. 2023-07-26 18:14:31 +10:00
Dion Moult 0d656040eb Fix #3479. Regression in 69fa124 when addressing #3421 that led to objects with multiple paths not taking part in the wall / slab joining procedure. 2023-07-25 23:29:06 +10:00
Dion Moult 12fcdebd37 Fix #3486. If Z index isn't specified, text is prioritised over other annotation types. 2023-07-25 22:50:09 +10:00
ay-ex c798309039 fix choco url constants (#3504) 2023-07-25 22:35:25 +10:00
Dion Moult e1913bf03e Fix #3497. Set closed vs unclosed polygonal face sets to allow loading in some IFC software. 2023-07-25 17:41:33 +10:00
Dion Moult bc541d335f Fix #3469. Fix bug where you couldn't load models if there was no style due to no polygons. 2023-07-25 17:12:11 +10:00
rileywong311 d4933c7f24 Refactor BrickStore.root_classes 2023-07-24 21:27:44 -07:00
Trashman247 4e96f17dac Ignore populate Brick attributes if active entity is a brick entity 2023-07-24 21:27:44 -07:00
Trashman247 4665b44ded Make Brick "root_classes" one source of truth 2023-07-24 21:27:44 -07:00
Trashman247 d834d94fd9 Change brick attributes query "name" and "value" to "predicate" and "object" 2023-07-24 21:27:44 -07:00
Trashman247 f2db071cf3 Move brick entity classes to BrickStore and create drop-down for entity type creation 2023-07-24 21:27:44 -07:00
Trashman247 0348e6d11a Move Brick namespace from data to BrickStore 2023-07-24 21:27:44 -07:00
Trashman247 1eb7c006f1 Add Brick "Set View" operator to change list hierarchy
- "System" as a root may need different logic since children of a system are not "subClasses" but rather "parts". Currently, "part" would be listed as attribute rather than a direct object in the group.
2023-07-24 21:27:44 -07:00
Trashman247 c80a2e1d64 Reformat BrickSchema UI 2023-07-24 21:27:44 -07:00
Dion Moult 7b2d99ba1e Fix #3498. 2023-07-25 08:54:45 +10:00
Dion Moult 55c4ce0071 Fix #3391 #3491 #3493. New space generation that uses a cutting plane across all eligible objects instead of a simplified "straight wall" analysis.
This makes generating spaces significantly more robust, makes it easier to add / remove "space separating objects" (so we now have support for virtual elements), and only acts on visible objects.
2023-07-24 23:22:12 +10:00
Dion Moult 8e5dc01758 New projects now load with a Views and Types collection with appropriate visibility settings. 2023-07-24 18:01:25 +10:00
Dion Moult 90632a363c Demo library now ships with example text annotation types (door tag, window tag, etc) 2023-07-24 17:59:04 +10:00
Dion Moult 4d6225bc32 More explanatory images in geometry creation docs 2023-07-23 23:56:50 +10:00
Dion Moult 411ec36e65 Add documentation specifically about swept disk solid geometry for rebar 2023-07-23 23:41:53 +10:00
Gorgious 1a54f54c64 You can now directly apply an ifc array modifier
Previously one would have to click on "remove" then "keep objects"
2023-07-23 15:13:04 +02:00
Dion Moult 5d48dc15c1 Finish writing documentation on geometry creation 2023-07-23 23:04:14 +10:00
Gorgious 5169599884 Array children are now transform-unlocked & unconstrained when the array is applied 2023-07-23 14:01:17 +02:00
Gorgious c3323733a7 Array children are now transforme-locked after editing the array
I have yet to find how to set it on ifc load though
2023-07-23 13:39:52 +02:00
Gorgious 1468b7fddd Array children now follow their parent with a "child-of" constraint #3492 2023-07-23 13:38:37 +02:00
Gorgious 41d6882b40 Clicking on the "Select all array objects" button now sets the parent object as active #3492
Moved the array objects fetching code to tool.Blender
Also a bit of housekeeping and fixing minor typos here and there
2023-07-23 13:03:06 +02:00
Dion Moult a1ebc2e167 Revert "Small tester UI fix #3487"
This reverts commit c7a1acf974.
2023-07-23 19:09:00 +10:00
Carlos Dias d5d9c91f5a [BlenderBIM] Update IfcTester (2023_07_21) (#3489) 2023-07-23 19:04:45 +10:00
Ryan Schultz 98a6cbb1aa Allow negative X_angle values 2023-07-23 19:04:12 +10:00
Dion Moult f48060e7c7 Fix #3488. Minor regression in IFC4X3 mapping. 2023-07-23 15:42:09 +10:00
Dion Moult dd827bb4c5 You can now save, load, and create custom colour legends of properties 2023-07-23 15:20:14 +10:00
Dion Moult b1cab9484c Search now renamed filtering and grouping. New "sandbox" section for more experimental panels. Old selector moved to sandbox along with augin/lca/covetool/temporary cutaways also moved there. 2023-07-22 23:09:48 +10:00
Dion Moult 74637dd0ea You can now load and save searches from the search panel 2023-07-22 22:49:22 +10:00
Dion Moult a61eae5f98 More powerful search interface that uses the new facet selector syntax 2023-07-22 16:48:36 +10:00
Andrej730 4c18a89ee6 Spatial manager elevation in projects units and some bug fixed
1) Elevation prop now is taking into account project units (previously it was hardcoded to meters)
2) Fixed a bug that occured when you started changing spatial element name/elevation right after you loaded spatial manager.

https://i.imgur.com/1keMGus.png
2023-07-22 11:03:22 +05:00
Andrej730 4a7b8f1104 Fixed errors after b6ddc0d
`element.is_a() in ...` wasn't taking into account spatial classes that inherit from IfcSpatialElement/IfcSpatialStructureElement
2023-07-22 10:36:40 +05:00
Andrej730 c7a1acf974 Small tester UI fix #3487 2023-07-21 18:00:11 +05:00
Andrej730 630ac7250a Fixed ifctester tests by the latest ids schema #3458
Commented out tests involving minOccurs and maxOccurs until https://github.com/buildingSMART/IDS/issues/144 gets resolved.
2023-07-21 15:33:28 +05:00
Dion Moult 08756a24a4 Fix #3477. Move text panels to object information tab. 2023-07-21 18:14:49 +10:00
Gorgious56 8edee78900 Minor fix in wall creation code 2023-07-21 09:57:23 +02:00
Dion Moult 9864261c41 New wall tool, slab tool, etc in toolshelf to improve usability. 2023-07-21 17:29:09 +10:00
Andrej730 bb3e978bba moving code to shape builder 2023-07-21 11:04:44 +05:00
Gorgious56 288cc698bd #3478 : Ifc class name suggestions can now autofill predefined type
If they are correctly filled in the json file :)
2023-07-20 19:40:31 +02:00
Andrej730 a2e70cb454 fixed error after 190153347 2023-07-20 21:56:28 +05:00
Andrej730 1901533470 Distance subtype for rl1, rl2 and x/y/z (opening dimensions) in BIM Tool 2023-07-20 19:35:35 +05:00
Andrej730 c61854c7aa small matrix math refactor
more readable and allows avoiding jumping between 3d/4d vectors
2023-07-20 19:13:56 +05:00
Andrej730 0dee353b8e A bit more descriptive port UI
Before - https://i.imgur.com/ZhVRoJM.png
After - https://i.imgur.com/tI1h2i7.png
2023-07-20 18:08:23 +05:00
Andrej730 2e3cc8e73a Added some MEP related type templates
3 more new types for distribution segments.
Distribution segments work the same way as beams - they come without representation but with IfcMaterialProfileSet defined with some profile. Occurences will also have ports at the start and the end of the segment (ports can be displayed in "Ports" section in "Services and Systems"). If you extend the segment or move it around - ports will move accordingly.

Small demo - https://imgur.com/a/Aq0utXa
2023-07-20 18:08:23 +05:00
Andrej730 6b276b8aed Small type manager refactor and more descriptions 2023-07-20 18:08:23 +05:00
Dion Moult 1b71f4f569 Implement guid facet in facet selector 2023-07-20 19:42:34 +10:00
Dion Moult 452089596e New facet based selector syntax. Proposed to supersede existing selector syntax. 2023-07-20 19:22:15 +10:00
Dion Moult a360bac4c3 You can now explicitly create new IfcTypeProducts. 2023-07-20 19:14:24 +10:00
Gorgious56 09bc05f1af Fix #3480 : Scene tabs now show their individual description on hover
Also correct minor typo
2023-07-20 10:42:11 +02:00
Andrej730 efc84606c5 Support looped railings #3415
Example - https://imgur.com/a/RaLORbk
2023-07-19 16:53:39 +05:00
Dion Moult 268039fb13 Write docs describing how to create profile representations 2023-07-19 19:58:19 +10:00
Dion Moult c59757c61a Fix #3469. Minor regression in linking refactor. 2023-07-19 19:58:19 +10:00
ay-ex 0e3386438e fix error messages 2023-07-19 18:39:13 +10:00
ay-ex 38782f4f53 fix choco_regex
fixes new regex needed for upstream blender cmake adjustment, 
pulls all regex and url into contant variables, 
improves error message, when a version cannot be retrieved
2023-07-19 18:39:13 +10:00
Dion Moult da23e39084 Merge pull request #3467 from c4rlosdias/v0.7.0
[BlenderBIM] Add UI to IfcTester
2023-07-19 09:46:39 +10:00
Gorgious 88278a9edb Boolean subpanel is now located in the Geometric Relationships panel 2023-07-18 21:45:48 +02:00
Carlos Dias a23a66edc2 Update __init__.py 2023-07-18 15:28:37 -03:00
Carlos Dias d2c22b0b0c Update handler.py 2023-07-18 15:27:30 -03:00
Gorgious56 76a4850238 Show ifc modifiers only when applicable to current element 2023-07-18 19:31:51 +02:00
Gorgious56 bf5c8f5e88 Disable some tab buttons when no ifc file is loaded 2023-07-18 18:54:24 +02:00
c4rlosdias 36b45b744d add export bcf to ifctester (2023_07_18) 2023-07-18 13:35:43 -03:00
Andrej730 bffbfb5fa3 Small description for some type templates 2023-07-18 19:52:38 +05:00
Gorgious56 963ffa39b7 Housekeeping - Reorder suggestion dictionary keys alphabetically 2023-07-18 16:17:51 +02:00
Carlos Dias 25d76152f6 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-07-18 09:22:32 -03:00
c4rlosdias d851614cbb Add bug fixes 2023-07-18 09:21:47 -03:00
Gorgious56 9c7b073414 Refactor edit mode toggle logic for profile based representations 2023-07-18 14:02:56 +02:00
Gorgious56 66ed95fbc1 Add ifc modifier utilities to tool.Blender 2023-07-18 14:00:30 +02:00
Andrej730 44e98b17a0 Fixing railing/roof bug #3416
Issue occured when you imported .ifc and then would try to edit roof/railing path and then cancel/finish editing.

Added safe check to avoid using `change_object_data` in edit mode - https://projects.blender.org/blender/blender/issues/110232
2023-07-18 15:52:59 +05:00
Gorgious56 a095d93838 Fix bug when using the search operator (F3) with no active object 2023-07-18 10:43:36 +02:00
Dion Moult 892b41a540 New geometry.create_2pt_wall API function to create a wall-like representation from two points. 2023-07-18 18:29:26 +10:00
Dion Moult 0cdce9b2d6 Add documentation for basic geometry creation 2023-07-18 18:28:46 +10:00
Dion Moult 05e05d0d5a Rename sverchok representation to mesh representation 2023-07-18 18:22:56 +10:00
Dion Moult 8cbe298072 Utility function to create rotation matrixes in numpy. 2023-07-18 14:28:35 +10:00
c4rlosdias 7bc23c996b Add select entities (2023_07_17) 2023-07-17 17:07:45 -03:00
Gorgious56 b9ff4f3263 Fix Ifc modifier error after #3393064 because of legacy context.object
For some reason in the scene properties context.object returns None even if an object is active  in the viewport, so ifc modifiers would randomly throw errors. AFAIK functionally they are supposed to point to the same thing, but active_object seems to be the superior one and context.object deprecated and kept for legacy reasons. Couldn't find dev quote but I'm sure I saw it at some point
2023-07-17 14:48:01 +02:00
Gorgious56 42bbc9a093 Ensure positive extrusion depth
This prevents an error and mesh corruption when trying to input a negative extrusion depth
2023-07-17 14:29:35 +02:00
Dion Moult 33930642a4 Move all modifier panels into Representations and Materials tab. 2023-07-17 22:21:31 +10:00
ay-ex 0573ffb11a fix choco_update action
fix according to upstream makefile change: 
https://github.com/blender/blender/blob/main/build_files/cmake/Modules/FindPythonLibsUnix.cmake
2023-07-17 22:16:55 +10:00
Andrej730 21a614560a Revision Clouds - option to match revision cloud with the selected object
Works similarly to tagging, example - https://imgur.com/a/Atr0nYE

This feature also can be useful in the future if we integrate revision clouds with ifcgit
2023-07-17 16:32:40 +05:00
Dion Moult 80d74866a9 More tab and panel shuffling. Top level panels now have a tab prefix. 2023-07-17 18:17:32 +10:00
Dion Moult d75e85b3a6 Disable Shift-D duplication of drawings for now until drawings stabilise more. Use the dedicated duplicate drawings feature. 2023-07-17 18:17:32 +10:00
Andrej730 a101f46478 Fixing bugs on small revision clouds #3310
Bugs were:
1) svg print ZeroDivisionError if there was less than 1 pattern segment
2) svg drawing wasn't preserving edge direction if there was less than 1 pattern segment
2023-07-17 12:11:52 +05:00
Andrej730 2463b77985 Fixed #3441 2023-07-17 11:32:12 +05:00
Dion Moult e695bdbd0d Fix #3449. Fix bug where you couldn't edit the relating type of an annotation. 2023-07-17 15:47:10 +10:00
Dion Moult 17230e4170 Fix bug where loaded point geometry had unlinked meshes or placements with wrong units. 2023-07-17 15:46:33 +10:00
Dion Moult 80d88b3821 Fix #3275. You can now rename annotation types from the annotation manager. 2023-07-17 14:32:05 +10:00
Dion Moult 0500e666bd Add support for arbitrary point annotations and survey point, traverse points, control points, spot elevations, etc. 2023-07-17 11:48:09 +10:00
c4rlosdias 31bb220d38 Update 2023_07_16 2023-07-16 20:46:26 -03:00
Dion Moult 944f2f701a Fix #3288. Implement undo / redo until specified named transaction. Fix fundamental undo bug where Blender doesn't track the undo UUID property if you toggle edit mode.
This also has the nice side effect of implementing "Jump to point in history" so you can now use the Edit > Undo History menu.
2023-07-16 22:58:56 +10:00
Dion Moult 844cc62960 More panel shuffling, new Quality and Coordination tab. Geometry is now part of materials. 2023-07-15 21:47:35 +10:00
Dion Moult 147df7f46b Bulk rename panels to remove redundant IFC prefix 2023-07-15 21:02:40 +10:00
Dion Moult 53bd4bf5ea Example of UI if we sentence-cased IFC classes. Good or bad? Please comment at https://community.osarch.org/discussion/comment/16493 2023-07-15 21:02:40 +10:00
Andrej730 d50e43197e small fix 90fce1804 2023-07-15 10:28:23 +05:00
Dion Moult 90fce18042 New icon tabbed interface so you don't need to click twice to change tab. 2023-07-15 13:22:13 +10:00
c4rlosdias 772414451e update ifctester - 2023_07_14 2023-07-14 12:04:22 -03:00
Dion Moult 0a840188bf DANGER! Potentially fix a bunch of undo bugs by completely rebuilding undo id_map tracking with a much simpler solution.
In the past, we used undo_pre and redo_pre and a bunch of complex commit_link and rollback_link tracking to figure out what IDs and GUIDs were added / removed during transactions and how to handle invalidated objects in the id/guid maps.

I really don't know why I made it that complex.

Now we simply treat all data as bad and rebuild the either map. This means slower undos / redos for large projects, but in theory the maps will never invalidate.

This either fixes a lot of things or breaks a lot of things :) Watch out!
2023-07-15 00:05:34 +10:00
Dion Moult a2e7cb8158 Fix undo bugs in the type module where some operators were not part of the undo system for some reason. 2023-07-15 00:00:10 +10:00
Dion Moult 2034fa203b Fix #3275. You can now rename types from the type manager. 2023-07-14 23:58:33 +10:00
Andrej730 572a8c812e root.remove_product fix 2023-07-14 18:22:31 +05:00
Andrej730 af4b5e1fe6 oops, forgot to clean up the test name 2023-07-14 18:02:51 +05:00
Andrej730 9c383e0c1a Fixed plan level annotation rotation #3440 2023-07-14 17:42:45 +05:00
Andrej730 a72231cb91 StairData refactor, solves #3416 2023-07-14 16:17:14 +05:00
Andrej730 846dbc341d root.copy_class to support copying ports in ifc2x3 2023-07-14 15:48:41 +05:00
Andrej730 ed95516b9d Clean up type objects on ifc import 2023-07-14 15:04:15 +05:00
Andrej730 b6ddc0d55e avoid IfcSpatialElement errors in ifc2x3
IfcSpatialElement was added only in ifc4
2023-07-14 14:46:58 +05:00
Andrej730 be5950bcb7 clean up after running test_wall_opening.py 2023-07-14 14:46:58 +05:00
Andrej730 6810bbff2f remove_product to remove IfcRelConnectsElements 2023-07-14 14:46:58 +05:00
Andrej730 2fa7cbaabf Fixing confusing UI #3357
It was showing "Edit Profile" when you have slab and wall selected when it will actually extend the wall to the slab.
2023-07-14 14:46:58 +05:00
Dion Moult 69fa12423d See #3421. Fix drawing bug where IfcOpenShell might return unclosed paths even though the shape is closed and therefore break cut polygon fills. 2023-07-14 17:32:45 +10:00
Dion Moult 8f609ff383 See #3421. Fix bug where some projection fills wouldn't polygonize correctly in shapely due to numerical tolerance. 2023-07-14 17:29:30 +10:00
Dion Moult 924bf2a3ad Fix #3442. Update sheet list if drawing name changes. 2023-07-14 13:54:24 +10:00
Dion Moult 2be8f4a139 Move object data out of object tab and into new object dropdown. 2023-07-14 13:41:02 +10:00
Dion Moult 8411feedf4 You can now open projects from the Ctrl-N shortcut. 2023-07-14 13:40:09 +10:00
Gorgious56 56e6c8e0e1 Improve slightly the boolean interface in mesh properties editor 2023-07-13 14:52:00 +02:00
Dion Moult 818226d1e2 Fix #3414. The project wizard now doesn't load a fresh session by default. Note that File > Open still enforces a fresh session. 2023-07-13 22:34:13 +10:00
Andrej730 6336241431 Cleaning up connections on delete_ifc
Noticed an error if you connect wall and slab, then remove the slab and try to regenerate the wall - error occured because connection to that slab wasn't removed.

The error was:
Error: Python: Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\bim\module\model\workspace.py", line 381, in invoke
    return self.execute(context)
  File "\3.6\scripts\addons\blenderbim\tool\ifc.py", line 136, in execute
    IfcStore.execute_ifc_operator(self, context)
  File "\3.6\scripts\addons\blenderbim\bim\ifc.py", line 421, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
  File "\3.6\scripts\addons\blenderbim\bim\module\model\workspace.py", line 373, in _execute
    getattr(self, f"hotkey_{self.hotkey}")()
  File "\3.6\scripts\addons\blenderbim\bim\module\model\workspace.py", line 465, in hotkey_S_E
    bpy.ops.bim.join_wall(join_type="T")
  File "C:\software\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\tool\ifc.py", line 136, in execute
    IfcStore.execute_ifc_operator(self, context)
  File "\3.6\scripts\addons\blenderbim\bim\ifc.py", line 421, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
  File "\3.6\scripts\addons\blenderbim\bim\module\model\wall.py", line 76, in _execute
    joiner.join_E(context.active_object, context.scene.cursor.location)
  File "\3.6\scripts\addons\blenderbim\bim\module\model\wall.py", line 1038, in join_E
    self.recreate_wall(element1, wall1, axis, body)
  File "\3.6\scripts\addons\blenderbim\bim\module\model\wall.py", line 1145, in recreate_wall
    height = self.clip(obj, tool.Ifc.get_object(rel.RelatingElement))
  File "\3.6\scripts\addons\blenderbim\tool\ifc.py", line 89, in get_object
    return IfcStore.get_element(element.id())
AttributeError: 'NoneType' object has no attribute 'id'
2023-07-13 17:32:25 +05:00
Dion Moult 7720166c31 Fix #3393. Bug where duplicating a typed text didn't also copy its literal. 2023-07-13 22:22:00 +10:00
Carlos Dias f5ba0673e3 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-07-13 08:01:54 -03:00
Andrej730 3b05799956 Delete edit text from BIM Tool since it's already in Annotation Tool 2023-07-13 15:54:28 +05:00
Andrej730 f3924249e9 handle null diffuse color loading ifc styles
The error was:
Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\bim\module\style\prop.py", line 99, in update_shading_style
    tool.Style.set_surface_style_props(blender_material)
  File "\3.6\scripts\addons\blenderbim\tool\style.py", line 174, in set_surface_style_props
    style_data["DiffuseColour"] = style_data["DiffuseColour"][1]
TypeError: 'NoneType' object is not subscriptable
2023-07-13 14:54:36 +05:00
Gorgious56 7f9e8a207d Enable drawing generation buttons only when an actual drawing is selected 2023-07-13 11:38:11 +02:00
Andrej730 38f7c044a3 Fixed error on canceling editing railing/roof
Since we do not update representation for railing / roofs and just mark them wtih `tool.Ifc.edit(obj)` their previous representation may still be incorrect. So we restore the previous representation just using bmesh update method.

For example if create a new roof, enter editing roof properties mode and then cancel editing, then it would result in "Failed to process a shape" because roof still had just empty Body/PointCloud representation.
2023-07-13 14:32:09 +05:00
Andrej730 7896d5b6e5 Fixing errors on loading ifc after ef8f82501
The error was:
RuntimeError: Operator bpy.ops.object.editmode_toggle.poll() failed, context is incorrect
Location: C:\software\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py:113
Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\bim\module\project\operator.py", line 594, in execute
    bpy.ops.bim.load_project_elements()
  File "C:\software\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\bim\module\project\operator.py", line 653, in execute
    ifc_importer.execute()
  File "\3.6\scripts\addons\blenderbim\bim\import_ifc.py", line 265, in execute
    self.clean_mesh()
  File "\3.6\scripts\addons\blenderbim\bim\import_ifc.py", line 1347, in clean_mesh
    bpy.ops.object.editmode_toggle(context_override)
  File "C:\software\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py", line 111, in __call__
    ret = _op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Operator bpy.ops.object.editmode_toggle.poll() failed, context is incorrect
Location: C:\software\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py:113
2023-07-13 13:45:50 +05:00
Andrej730 96d812eaba Fixed console errors on checking modeling data 2023-07-13 13:03:18 +05:00
Dion Moult 0390a65590 Fix #3300. Bug where it was impossible to delete normal Blender objects in the outliner when an IFC existed.
Also port over batch deletion to the outliner override.
2023-07-13 16:26:06 +10:00
Andrej730 ad4ab1567f model data parameters renamed to pset_data for consitency 2023-07-13 11:08:52 +05:00
Andrej730 d633733d18 DoorData use refactor 2023-07-13 10:58:03 +05:00
Andrej730 cd1a813630 WindowData use refactor 2023-07-13 10:36:09 +05:00
Andrej730 c9e6da9b6c change .is_editing type for ifc modifiers to boolean 2023-07-13 09:53:11 +05:00
Andrej730 cada2c36e3 RoofData use refactor 2023-07-13 09:48:33 +05:00
Dion Moult 33304eb1a5 Group drawings by target view in the drawing list 2023-07-13 14:13:28 +10:00
Bruno Perdigão 4e72ef8b20 Select all objects in array modifier #3331 2023-07-13 13:21:49 +10:00
Dion Moult b9d8e86748 Fix #3411. Filtering sheets now doesn't break sheet hierarchy and also lets you search for sheet identification, name, and names of drawings / titleblocks / things on sheets. 2023-07-13 11:53:08 +10:00
Dion Moult 3adfc63b65 Fix #3432. Bug where null applicable occurrence of a type product caused the annotation tool to fail. 2023-07-13 11:27:01 +10:00
Andrej730 91e7d49060 makefile fix 2023-07-12 18:34:48 +05:00
Andrej730 4ad1a2be73 minor change for RailingData 2023-07-12 17:46:56 +05:00
Andrej730 ef8f825012 bim.load_project to refresh session on execute not invoke
if you accidentally opened file dialog or just changed your mind it shouldn't remove all objects from the current blender session
2023-07-12 17:10:30 +05:00
Andrej730 56adfc70b5 RailingData use refactor, solves #3416 2023-07-12 17:01:51 +05:00
smr02 bc909a26fa ifcsverchok delete api_WIP 2023-07-12 21:18:20 +10:00
Andrej730 dd0a015ec3 display current commit in status bar
it works for users who symlinked their blenderbim/bim folders to git repository or installed blenderbim from release created from makefile
https://i.imgur.com/mEBH9I7.png
2023-07-12 12:34:24 +05:00
Gorgious56 3813c26db7 Fix error when trying to edit an object that doesn't support edit mode with the TAB keypress
Also run black on the rest of the file
2023-07-12 09:28:21 +02:00
Dion Moult 95c06c7f82 Fix #3420. Fix missing sheet references on drawings and incorrect direction of section references. 2023-07-12 17:17:54 +10:00
Andrej730 db910d4024 more consistency in values for plan-, section level and diameter 2023-07-12 11:47:19 +05:00
Andrej730 669dbd2e8d radius annotation - support for prefix/suffix/fill-bg
and more consistency between viewport and svg
2023-07-12 11:47:18 +05:00
Andrej730 becbfccae9 PLAN/SECTION_LEVEL consistency between viewport and svg
before - https://i.imgur.com/bwYbozz.png
after - https://i.imgur.com/7BlmQIg.png

NOTE that if you're using markers.svg that was created before this update you won't see the changes for the section-/plan-level markers.
2023-07-12 11:47:18 +05:00
Andrej730 2f02d401f2 fill-bg for diameter, plan- and section-level annotations 2023-07-12 11:47:18 +05:00
Dion Moult ec2ca4bcf4 Fix #3417. Apply 50mm offset to camera to ensure text isn't "behind" the camera. This 50mm convention is used in quite a few places, we should standardise it. 2023-07-12 12:37:53 +10:00
Dion Moult 89df937f89 Fix #3425. Fix invalid IFC data where grid axes should be 2D not 3D. 2023-07-12 11:41:58 +10:00
Thomas Krijnen 7567971a32 Update entity_instance.py 2023-07-11 21:41:06 +02:00
Thomas Krijnen 74160731c9 Update rule_executor.py 2023-07-11 21:40:05 +02:00
Andrej730 5d7fefa042 Prevent resetting selected tab on blender restart
Not sure if there is any caveats to that
2023-07-11 18:23:26 +05:00
Dion Moult db4c61a472 Fix #3407. Override Ctrl-S to the export IFC which checks for Blender projects.
1. No IFC --> Saves Blend file
 2. IFC, unsaved Blend --> Saves IFC
 3. IFC, saved Blend --> Saves IFC and Blend
2023-07-11 23:08:05 +10:00
Andrej730 298568d3ea PLAN_LEVEL annotations support for prefix, suffix #3399
Viewport - https://i.imgur.com/XRa3oJO.png
SVG - https://i.imgur.com/C8PjoiO.png
2023-07-11 17:04:58 +05:00
Dion Moult 4da7b355bf Fix #3414. Only clear default scene, not custom scene when loading / creating IFCs. 2023-07-11 21:45:34 +10:00
Andrej730 2a15743f8b SECTION_LEVEL annotations support for prefix, suffix #3399
also added support for "show only description" for section_level
2023-07-11 16:42:07 +05:00
Andrej730 e54cc11ca6 Fixed #3400 introduced in dda16c8 2023-07-11 14:54:51 +05:00
Dion Moult 24fdfc6d82 Resolve merge conflict 2023-07-11 18:15:18 +10:00
Dion Moult 8689164769 Fix registration bug that created hundreds of workspaces due to continuous triggering of the depsgraph_update.
Use an is_registering check to only run the on_register once.

Rename setDefaultProperties to load_post to better reflect what handler it is.

Unregister our custom scene panels upon addon activation.

Move aprops getting to tool.Blender because it is a bit complex. Also, aprops may not be setup until load_post is called, so the len() check protects against that.
2023-07-11 18:08:02 +10:00
Gorgious56 86dd79daa6 Keep active object when unlinking an IFC element
Unlinking an element recreates a new blender object so the active object would be lost, jumping the properties to the scene panel which was slightly annoying
2023-07-11 09:33:06 +02:00
Andrej730 a231cc31e8 fixed properties search after 949a2bb and fixed console errors on search
1) When you search not from the SCENE properties blender creates some kind of phantom area to check search results. As this area is not present in `context.screen.areas` it was resulting in the error below.

2) After 949a2bb search in scene properties was limited to currently selected tab. Given the amount of tools we have in properties and native blender approach for searching across all available sections in properties, it seems reasonable to make search work across all tabs.

Console error was:
The error was
Python: Traceback (most recent call last):
  File "\3.6\scripts\addons\blenderbim\bim\ui.py", line 281, in draw
    aprops = context.screen.BIMAreaProperties[context.screen.areas[:].index(context.area)]
ValueError: bpy.data.screens['Layout.001']...Area is not in list
2023-07-11 11:00:20 +05:00
Dion Moult e412d27398 Integrate brickschema undo system into BlenderBIM Add-on undo system wrapper 2023-07-11 11:16:49 +10:00
Andrej730 60388f1a24 Fixed #3412
After 949a2bb printing happens not fron N-panel (which is part of viewport) but from scene properties - so current context doesn't have region_3d anymore.

PS The same issue was there all along if you'd try to print the drawing from Camera Properties tab.
2023-07-10 17:31:11 +05:00
Andrej730 d13d1493e3 allow to call select/color by attribute by providing arguments
instead of always checking scene.BIMSearchProperties. This allows to add different setups of selections to quick favorites
2023-07-10 17:17:12 +05:00
Dion Moult 556489d686 Implement Ctrl-Tab in properties to conveniently toggle between two tabs. 2023-07-10 22:04:10 +10:00
Dion Moult 657e77117c Move built-in scene panels to a dedicated "Blender Properties" tab instead of unregistering permanently. 2023-07-10 22:04:10 +10:00
Andrej730 7d97f5e375 Library for US AISC15 Steel Profiles #3203 2023-07-10 16:36:07 +05:00
Gorgious56 7583b56738 Trying to edit a railing modifier path while modifying the parameters is now prevented and user is informed with a tooltip 2023-07-10 13:00:43 +02:00
Gorgious56 073a00b2ca Fix IfcRailing modifier support spacing <= 0 would throw an error, and deactivate support spacing field if manual support is selected 2023-07-10 12:47:46 +02:00
Thomas Krijnen 8baa0945e9 2dc4bbf8cd Apply same logic for derived attributes 2023-07-10 10:26:37 +02:00
Dion Moult 717c28b7c9 Override Ctrl-N new file menu to make it easier to start new projects and new IFC icon. 2023-07-10 17:16:32 +10:00
Andrej730 f4a4e906ab Using EPset_Drawing data instead of camera props on drawing print #3396
Previously if you change `HasUnderlay` in pset it caused errors because camera properties `has_underlay` wasn't updated.
Still some work need to be done for updating keep camera properties in sync with pset - probably we can should call something like `tool.Drawing.import_drawing()` on EPset_Drawing edit
2023-07-10 11:09:48 +05:00
Dion Moult 052ff71c51 See #3411. Sheets are now sorted alphabetically by default. 2023-07-10 14:13:44 +10:00
Dion Moult 3dfd36877e See #3016. Scene shading styles are now stored as part of the drawing style. 2023-07-10 14:13:44 +10:00
Dion Moult a9f2237d32 Update splash image to be centered 2023-07-10 13:15:49 +10:00
Dion Moult 62c93f0462 Fix #3410. Minor regression when moving UI to properties panel. 2023-07-10 11:19:15 +10:00
Dion Moult 60ea504267 Add support for Point representations too, not just point cloud. 2023-07-10 10:23:33 +10:00
Dion Moult 1e3b45c0b8 Fix bug where all grouped annotations were excluded when opening models, whereas we only want drawing annotations to be excluded. 2023-07-10 10:23:33 +10:00
Massimo Fabbro 757277cedf Fix bug where drawing decimal places couldn't be 0. Now it's possible to define 0 as value 2023-07-09 18:52:03 +02:00
Dion Moult 14fced7aba Forgot to commit updated IfcTester test suite 2023-07-09 22:30:14 +10:00
Dion Moult 7a3b299148 Fix critical undo sync bug related to invoking instead of executing. See notes.
Currently, the undo system works by wrapping the execute operator. What was not considered was that execute() isn't the only entry point to operators. Operators can be invoked. If an invoked operator calls a bpy.ops.bim.something in its invoke() function, then bpy.ops.bim.something will start and finish its own transaction, and then when the invoke finishes and finally runs execute(), another transaction will be started and finished. This means that we get at least one extra transaction logged (one per any call to bpy.ops.bim.foo in invoke()).

This mismatch of number of transactions and undo stack means that when the user presses ctrl-z, the undo doesn't actually occur. This leads to a sync bug.

To be safe, all IFC invokes must be wrapped. This will take some time to review so expect another commit soon.
2023-07-09 22:29:49 +10:00
Dion Moult 45cf6a8ace Drawing panels now moved to the drawings and documents "tab" 2023-07-09 18:30:40 +10:00
Dion Moult 9b1693e112 Update IfcTester to comply with latest modifications to IDS XSD. 2023-07-09 17:02:12 +10:00
Dion Moult cc59929cfd Visual clean up of annotation tool to only activate when a drawing is active and have a type manager similar to the BIM tool. 2023-07-09 16:01:16 +10:00
Dion Moult 43fd012a4c Update tool icons to all use the same underlying "cube" shape and add bracing for structural icon and background walls for spatial icon. 2023-07-08 22:56:23 +10:00
Bruno Perdigão f96f663dc3 recreate decompositions in Refresh operator 2023-07-08 22:12:24 +10:00
Bruno Perdigão 486bafc814 changed keymap 2023-07-08 22:12:24 +10:00
Bruno Perdigão 20a31be5bf clear BIMObjectPropertis.collection after duplication 2023-07-08 22:12:24 +10:00
Bruno Perdigão 98dad0cbbe initial commit 2023-07-08 22:12:24 +10:00
Dion Moult b0ce2e5a00 Fix #3390. Type products should not be set in the model interface. 2023-07-08 22:09:50 +10:00
Thomas Krijnen 3aea0915d0 #3189 proposal (#3190) 2023-07-08 20:07:28 +10:00
Bruno Perdigão 0ee5e3887b removed total_items from the operator 2023-07-08 20:06:18 +10:00
Bruno Perdigão 1afcec2005 implementation of #3332 2023-07-08 20:06:18 +10:00
Dion Moult 656b7cb06e Merge pull request #3405 from brunoperdigao/pset_select_same_value
Bug fix in #3392
2023-07-08 20:05:22 +10:00
Dion Moult 19d3f98b6f Merge branch 'v0.7.0' into pset_select_same_value 2023-07-08 20:05:13 +10:00
Dion Moult 73a736f52a Fix #3402. Activate drawing no longer affects the visibility of non-IFC objects. 2023-07-08 19:55:45 +10:00
Dion Moult 6adc48ade4 Fix #3403. Templates must be specific to the version you are creating. 2023-07-08 19:30:11 +10:00
Dion Moult 949a2bb347 Start mocking up our own property "tabs" with the intention to use this new tab system instead of Blender property tabs
Blender property tabs are hardcoded and we cannot customise them. IFC data only "somewhat" maps to Blender property tabs, and some things fail to map causing user confusion. For example material and styles are very confusing. Also scene and object properties are crazy overpopulated (see how many times IFCArchitect bulk collapses things). And this also causes things to be spread out and lost (e.g. some random panels in viewport N menu). This should give us a lot more control to organise panels exactly how we want them.
2023-07-08 17:03:06 +10:00
Dion Moult 8cb63720eb Workspace inspired by IFCArchitect's layout is now setup by default and irrelevant Blender scene panels are hidden. You can disable this behaviour for advanced users, or use your own workspace layout but at least now there is a better "BIM-optimised" layout.
The layout uses three columns with a focus on a larger outliner (important as BIM models have lots of objects and complex hierarchies!) and properties, and removes the mostly irrelevant timeline for beginners.
2023-07-08 16:26:21 +10:00
Dion Moult 52ac1090e9 You can now create, open, and save projects from the file menu, with simple project presets. Also the scene is cleared so no more manual cube / light / camera deletion. Also poll prior to saving. No more import / export menu to confuse users.
https://imgur.com/a/EIt2H5b
2023-07-08 14:39:39 +10:00
Dion Moult 4f6180baf8 Delete old annotation panel in favour of annotation tool 2023-07-08 10:58:53 +10:00
Bruno Perdigão 743339598e minor fix 2023-07-07 15:27:48 -03:00
Bruno Perdigão 2e423f26ff bugfix and alt+click functionality 2023-07-07 15:19:35 -03:00
luzpaz b3b45893cc Fix various typos in src/ifcgeom* subdirs 2023-07-07 18:44:02 +02:00
Dion Moult a65747dd2c Minor doc improvements and SQL/stream code cleanup 2023-07-07 18:12:52 +10:00
Dion Moult 4286ad6dcc Fix #3394. Fix bug where railing and roof type names were hardcoded. Also improve UI of create type form so you can actually read the fields. 2023-07-07 17:57:09 +10:00
Dion Moult 0b823c772e Fix #3213. Internally, we should always use Unix path separators. 2023-07-07 17:20:07 +10:00
Dion Moult 9944024457 The user can now toggle between rotate before / after translating in OffsetObjectPlacements 2023-07-07 15:57:42 +10:00
Dion Moult 3cdad90755 Fix #3016. Drawing styles that set the shading style will change shading style upon activating the style. 2023-07-07 15:17:53 +10:00
Dion Moult 71846d683b Fix #3121. Merge equivalent contexts when merging projects in MergeProject Ifcpatch recipe. 2023-07-07 13:04:44 +10:00
Dion Moult 7be0fd6137 Fix failing tests since Github test runner only has IFC4X3_ADD1 not TC1 compiled in. 2023-07-07 12:33:38 +10:00
Bruno Perdigão 1eef746f60 implements #3268 2023-07-07 12:15:05 +10:00
Trashman247 1696ca5e08 Remove binding namespace new project (already in schema) 2023-07-06 16:47:53 -07:00
Trashman247 c011458ea2 remove import BrickStore in props 2023-07-06 16:47:53 -07:00
Trashman247 abf809f9dd Add brick operator accepts label parameter & add toggle for namespace editing 2023-07-06 16:47:53 -07:00
Trashman247 9257816e62 Add filter to listed namespaces (need add more aliases) 2023-07-06 16:47:53 -07:00
Trashman247 d47125b28f Double space core functions and clear brick browser on project close 2023-07-06 16:47:53 -07:00
Trashman247 b7453f584e Separate serialize into "save" and "save as" with file selection 2023-07-06 16:47:53 -07:00
Bruno Perdigão 6a7cf6843a implements #3268 2023-07-06 15:10:53 -03:00
Sigma Dimensions 9c4fa666c9 Georeferencing utility to convert an angle in degrees to X Axis Abscissa and Ordinate 2023-07-06 16:02:03 +01:00
Dion Moult a970120fac See #3126 and 5b4010c. Fix failing tests, and allow schema_by_name to follow the same schema_version distinction as file. 2023-07-06 22:40:31 +10:00
Andrej730 72907cd3f0 w-type US steel profiles #3203 2023-07-06 17:09:03 +05:00
Dion Moult ae7c9f35a6 See #3126. Forgot to commit tests related to explicit schema versions. 2023-07-06 20:56:33 +10:00
Thomas Krijnen 0b111084b0 Update win32 download links installation.rst 2023-07-06 11:30:09 +02:00
Thomas Krijnen 2ee0dcaf64 #3359 return early in case of no-prefiltering 2023-07-06 11:21:17 +02:00
Andrej730 70eabead92 fill-bg support for dimensions #3387
Example - https://i.imgur.com/lvJwtDI.png
works the same way as for text by adding "fill-bg" to EPset_Annotation.Classes
2023-07-06 13:52:51 +05:00
Dion Moult 5a30d9fb9b Fix #3383. Disallow any extrusion angles >=90 which are invalid. 2023-07-06 17:34:22 +10:00
Dion Moult 3126db342d Test all shapes in the debug panel now also attempts 2D checks to prevent false positives. 2023-07-06 17:24:51 +10:00
Dion Moult c0db03438f Revert "More descriptive RuntimeError: Failed to process shape #3383"
This reverts commit 1542217117.
2023-07-06 17:02:57 +10:00
Andrej730 1542217117 More descriptive RuntimeError: Failed to process shape #3383
Example of the new error - https://i.imgur.com/0FMQw5V.png
2023-07-06 10:29:17 +05:00
Dion Moult 5b4010c67d Fix #3126. Implement mapping from IFC4X3 to IFC4X3_ADD1 and explicit version identifiers in ifcopenshell.file 2023-07-06 14:22:36 +10:00
Dion Moult c18d96f0e3 Fix #3386. 2023-07-06 13:46:09 +10:00
Dion Moult f9173700a6 Fix #3349. Allow inserting a filling into an uncontained building element. 2023-07-06 13:40:29 +10:00
Bruno Perdigão 7100a7fa8e fix #3063 2023-07-06 12:39:20 +10:00
Dion Moult 0078d691d3 Fix #3382. Minor regression in wall join refactor from d64c135 2023-07-06 11:45:12 +10:00
Sigma Dimensions fd626e37a0 fix #3385 - renaming grids with "F2" 2023-07-05 17:41:57 +01:00
Andrej730 e62d7ad9ef Moving editing roof and railing paths hotkey from Shift+E/Q to Tab 2023-07-05 18:40:35 +05:00
Andrej730 80eebc03d3 Fix #3263 2023-07-05 18:04:14 +05:00
Andrej730 62fea990d9 railing modifiers - fixing normals for frameless_panel #3277 2023-07-05 17:47:16 +05:00
Dion Moult 7ab01e6ac0 See #3359. Bump IfcOpenShell and enable HLR prefiltering optimisation for drawing generation 2023-07-05 22:18:53 +10:00
Andrej730 74a025b81c type selection error #3318
if you switch ifc_class then relating_type_id can become invalid and we wasn't taking it into account

Also fixed bunch of warning like `pyrna_enum_to_py: current value '17' matches no enum in 'BIMModelProperties', '', 'relating_type_id'`` when some ifc_class has N related types and then you switch to other ifc_class that has less than N related types.
2023-07-05 16:52:23 +05:00
Andrej730 ca8ed87f2a Revert "enable activating object type when trying to select type from an object ( whilst the type is hidden from view layer)"
This reverts commit 4bc987924d since there was some unintentional changes.

Now when you use select_type in object properties - ifc class and related type gets selected in the BIM Tool  - https://i.imgur.com/drIHYDz.png

#3318
2023-07-05 16:52:23 +05:00
Andrej730 9fbcb3900f ShapeBuilder.polyline - skip creating segments if they are not needed 2023-07-05 13:02:17 +05:00
Dion Moult 1533283822 Fix #3356. Include version info in status bar for debugging and new copy debug info button to help bugreporting. 2023-07-05 17:39:43 +10:00
Dion Moult 6beca6382f Fix #3256. Support file profiles made out of multiple representation items. 2023-07-05 14:38:48 +10:00
Dion Moult a1caef5b4f See #3334. Fix some get_pset implementation errors in 64516a1 2023-07-05 10:37:13 +10:00
OrionSehn 7da96b4951 Proposed fix to #3352 2023-07-05 09:56:42 +10:00
Andrej730 66c275f617 Sync ifc class in BIM Tool and Type Manager
It's seems it would be better for ux if they will be connected
2023-07-04 17:17:57 +05:00
Andrej730 52a8fcd86e add_representation - detect non consequtive curves and handle them
Basically if current mesh curve is non consequtive we handle it in similar way to b03c4da7b - convert it to curves using Blender and then save them to ifc.

The advantage is that it creates less curves in ifc because mesh method wasn't able to detect separate curves correctly if vertex order was messed up (usually it is) and it would create separate curve for each curve segment.

I've also replaced figuring vertex duplicates with `bmesh.ops.remove_doubles` manually with `bmesh.ops.remove_doubles` and it's now much faster. In some cases because of the manual calculations it was taking too long - in #3233 Ryan mentiones that it freezes blender, it wasn't really freezing Blender but to finish calculations it would take 10 minutes.
2023-07-04 16:43:42 +05:00
Dion Moult 3ba7ecdb95 See #3376. Bump updated build of IfcSverchok. 2023-07-04 20:17:01 +10:00
Dion Moult 36f7625cee Merge AWS Lambda installation documentation into official docs 2023-07-04 20:10:57 +10:00
Dion Moult ee82714423 Whoops 2023-07-04 19:47:49 +10:00
Dion Moult 281147367e Close #3377. Implement xyz coordinates for COBie object placement. 2023-07-04 19:45:11 +10:00
Dion Moult 0beea4255a Write IfcOpenShell documentation for geometry trees. 2023-07-04 18:04:15 +10:00
Andrej730 b03c4da7bf experimental support for spline curves representation #3233
there is still no full support but as a workaround I've added blender converting curves to meshes and back to curves so we could preserve the actual shapes

before - https://i.imgur.com/9F542Iy.png
after - https://i.imgur.com/t58RlkF.png
2023-07-04 10:57:22 +05:00
Dion Moult c0402687b5 See #3334. Optimise pset getting and add simple "broadphase" filtering for all facets for faster validation. 2023-07-04 15:50:44 +10:00
Dion Moult c6fa7161b6 Fix bug where IfcTester would pass derived attribute facets.
Now that IfcOpenShell supports derived attributes, we need to explicitly make sure the attribute facet only considers forward attributes.
2023-07-04 15:50:44 +10:00
Dion Moult 64516a173a See #3334. Fix bug where get_pset didn't handle property inheritance correctly. 2023-07-04 15:50:44 +10:00
c4rlosdias f507e3e8bd Add extra formats to output file 2023-07-04 12:42:59 +10:00
c4rlosdias 700d8a3b9c Add extra formats to output file 2023-07-03 10:22:08 -03:00
Andrej730 2f15d73b30 Prevent crash on attempt to link the current .blend file 2023-07-03 17:23:49 +05:00
Andrej730 53cc6f0bd6 Storing external styles paths as posix for cross platform compatibility
Also it was wrongly referring to .blend file instead of .ifc to generate relative paths.
2023-07-03 17:09:01 +05:00
Andrej730 7680652c28 disable default vebose mode for getting shader attribute to prevent spam 2023-07-03 16:56:47 +05:00
Carlos Dias da3440d848 Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0 2023-07-03 08:48:10 -03:00
Andrej730 e8b1d00e6d adding default ifc objects added from shift-a menu to the current collection 2023-07-03 16:22:20 +05:00
Andrej730 6ec7e48423 Editiing arbitrary profile without enabling editing profile
It was a bit confusing UX since when you finish editing arbitrary profile path the data is already saved in ifc but you were still in editing profile properties
2023-07-03 15:54:51 +05:00
Andrej730 ccf09b962a Update type manager thumbnails on editing profiles
Example - https://imgur.com/a/IcV8IIR
2023-07-03 14:34:20 +05:00
Andrej730 485d41ae09 disable chaching sound running the bim tests
to save someone's ears (probably mine 😁) from running 10 chaching sounds per second
2023-07-03 12:43:26 +05:00
Dion Moult b67c5a0828 Fix #3366. Fix crash in IfcDiff if you are comparing a model with no geometry. 2023-07-03 17:28:38 +10:00
Andrej730 7b92057227 Fixed errors displaying IFC Connections for IfcRelConnectsElements
IfcRelConnectsElements type of connection wasn't handled properly resulting in errors.
Now you should be able to see connections for connected slabs, walls etc - https://i.imgur.com/LpFBKBC.png

Traceback:
Traceback (most recent call last):
  File "\blenderbim\bim\module\geometry\ui.py", line 102, in draw
    ConnectionsData.load()
  File "\blenderbim\bim\module\geometry\data.py", line 100, in load
    cls.data = {"connections": cls.connections()}
  File "\blenderbim\bim\module\geometry\data.py", line 134, in connections
    relating_element_connection_type = rel.RelatingConnectionType
  File "\blenderbim\libs\site\packages\ifcopenshell\entity_instance.py", line 171, in __getattr__
    raise AttributeError(
AttributeError: entity instance of type 'IFC4.IfcRelConnectsElements' has no attribute 'RelatingConnectionType'
2023-07-03 11:53:03 +05:00
Dion Moult a980ce1bfa Fix #3355. Reimplement graphical clash snapshots in BCF from IfcClash in the BlenderBIM Add-on. 2023-07-03 16:50:40 +10:00
Dion Moult 51b7f24a00 You can now unload BCF projects to load another one. 2023-07-03 16:50:40 +10:00
Dion Moult 136e1c3b3f Merge pull request #3364 from IfcOpenShell/interface-to-interact-with-Brickschema
Interface to interact with brickschema PR #1
2023-07-03 09:55:09 +10:00
Carlos Dias c094517a10 Update operator.py
missing output file format in arguments
2023-07-03 09:42:17 +10:00
Carlos Dias 93aa24c6d2 Update operator.py
missing output file format in arguments
2023-07-02 20:25:51 -03:00
Andrej730 b61a11d5b7 reworked detecting neighbour walls when placing new ones
hopefully it will be a bit more natural now - please give feeback

before - https://imgur.com/a/VYQt5ua
now - https://imgur.com/a/5LRAmrd
2023-07-02 19:59:18 +05:00
Andrej730 012da8fcb9 More responsive UI for IFC search 2023-07-02 15:52:24 +05:00
Andrej730 d64c1358d7 a bit of bim.join_wall refactor 2023-07-02 11:04:00 +05:00
Andrej730 0252701f7a Error editing roof profile #3357
it was assuming it's a slab and was giving errors trying to start editing slab profile

File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\model\slab.py", line 618, in _execute
if extrusion.Position:
AttributeError: 'NoneType' object has no attribute 'Position'
2023-07-02 10:44:01 +05:00
Bruno Postle 6fed9bf795 BlenderBIM Git documentation minor corrections 2023-07-01 14:35:32 +01:00
Bruno Postle b088a763d8 BlenderBIM document Git merge asymmetry (#3096) 2023-07-01 09:53:26 +01:00
Dion Moult 104fe56612 Whoops 2023-07-01 15:41:40 +10:00
Dion Moult 9e0760b8d2 Fix hppfcl segfault by bumping hppfcl and its dependencies. Remove support for py37. 2023-07-01 15:37:21 +10:00
Andrej730 f26986645a Added warning for a86456392 2023-06-30 18:19:23 +05:00
Andrej730 a86456392b improved relative path handling for textures #3365
now we're going to store all texture paths in .ifc as posix to keep them working if .ifc moved from one platform to another

previously it was saving all paths as absolute
2023-06-30 18:05:26 +05:00
Andrej730 61de0ad64c Calculating angle based on world position instead of camera pos #3362 2023-06-30 15:02:39 +05:00
Andrej730 243eee9ebf Added support for OCCLUSION textures for 3aff29dec 2023-06-30 14:44:06 +05:00
Andrej730 f23ac034c7 Shape builder - detect AdvancedSweptSolid
To avoid validation errors on creating wall mounted railings

    #143=IfcShapeRepresentation(#15,'Body','SweptSolid',(#116,#126,#129,#139,#142))
Rule IfcShapeRepresentation.CorrectItemsForType:
    IfcShapeRepresentationTypes(self.RepresentationType, self.Items)
Violated by:
    False
     +  where False = IfcShapeRepresentationTypes('SweptSolid', (#116=IfcSweptDiskSolid(#115,10.,$,$,$), #126=IfcExtrudedAreaSolid(#120,#124,#125,20.), #129=IfcSweptDiskSolid(#128,10.,$,$,$), #139=IfcExtrudedAreaSolid(#133,#137,#138,20.), #142=IfcSweptDiskSolid(#141,25.000000372529,$,$,$)))
     +    where 'SweptSolid' = #143=IfcShapeRepresentation(#15,'Body','SweptSolid',(#116,#126,#129,#139,#142)).RepresentationType
     +    and   (#116=IfcSweptDiskSolid(#115,10.,$,$,$), #126=IfcExtrudedAreaSolid(#120,#124,#125,20.), #129=IfcSweptDiskSolid(#128,10.,$,$,$), #139=IfcExtrudedAreaSolid(#133,#137,#138,20.), #142=IfcSweptDiskSolid(#141,25.000000372529,$,$,$)) = #143=IfcShapeRepresentation(#15,'Body','SweptSolid',(#116,#126,#129,#139,#142)).Items
2023-06-30 14:19:07 +05:00
Andrej730 363ede9801 set default position on creating window and door
to avoid validation errors like IfcProduct.PlacementForShapeRepresentation
2023-06-30 14:16:39 +05:00
Andrej730 18d26df24e Fixing ifc git poll errors if .ifc file is not yet saved
Errors:
Traceback (most recent call last):
  File "\Blender\3.6\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 20, in poll
    if not os.path.isfile(path_ifc):
  File "\Blender\3.6\python\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
Traceback (most recent call last):
  File "\Blender\3.6\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 48, in poll
    if not os.path.isfile(path_ifc):
  File "\Blender\3.6\python\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
2023-06-30 13:42:01 +05:00
Andrej730 0df62d5746 updated furniture library after f5031035c and a385938 2023-06-30 13:30:09 +05:00
Andrej730 f5031035c7 Shape builder - avoid duplicated indices in polylines
For example
IfcLineIndex((1,2,3,4,1))
instead of
IfcLineIndex((1,2,2,3,3,4,4,1))
2023-06-30 13:27:00 +05:00
Thomas Krijnen fc50bdd3a0 Fix openbot build 2023-06-30 09:32:10 +02:00
Kristoffer Andersen 3117d5b2e7 Update build.sh
Use only 1 cpu to reduce memory usage for conda builds
2023-06-30 09:27:15 +02:00
Riley Wong e6dc1d1acd Merge branch 'v0.7.0' into interface-to-interact-with-Brickschema 2023-06-30 00:05:20 -07:00
Trashman247 bd8afabce3 Resolve .git-ignore file conflict 2023-06-30 00:03:46 -07:00
Trashman247 01da8498f2 Move Brick.ttl ignore to main git-ignore file 2023-06-29 23:56:20 -07:00
Trashman247 a34b8d06ec Silence known rdflib_sqlalchemy TypeError warning 2023-06-29 23:42:00 -07:00
Massimo Fabbro 5764cfcbb9 Add regen button also under space tool 2023-06-30 14:34:21 +10:00
Dion Moult 1ad2465ad4 See #3283. Minor fix where IfcContext is abstract, so IfcProjectLibrary should be checked instead when loading filtered models. 2023-06-30 13:58:18 +10:00
Dion Moult f28e28abc0 Fix failing build 2023-06-30 11:59:17 +10:00
Dion Moult 97e321dd12 Bundle qhull for hppfcl on Linux too 2023-06-30 11:47:44 +10:00
Thomas Krijnen fc4b36e759 Fix openbot build 2023-06-29 22:04:18 +02:00
Thomas Krijnen 832cdce934 Fix openbot build 2023-06-29 22:03:29 +02:00
Andrej730 e45974df62 Support for door/window/stair modifiers in ifc2x3 2023-06-29 18:38:06 +05:00
Andrej730 bba118ed19 ShapeBuilder to use IfcPolyline of IfcIndexedPolyCurve to support ifc2x3
needed it to add suport for window/door modifiers in ifc2x3 in the next commit
2023-06-29 18:38:06 +05:00
Andrej730 709590401c fixing errors running tests if no tool selected in blender startup file
Error was: AttributeError: 'NoneType' object has no attribute 'idname'
2023-06-29 17:19:40 +05:00
Dion Moult ab74d1456b Bundle qhull for ifcclash on macosm1 2023-06-29 22:10:39 +10:00
Thomas Krijnen 4457da9042 Help swig not to trip over old occt handle definitions 2023-06-29 13:29:49 +02:00
Thomas Krijnen d501118eb4 Add --prefilter flag to draw.py 2023-06-29 13:29:49 +02:00
Thomas Krijnen 0a03d20133 SVG prefiltering elements based on large faces 2023-06-29 13:29:49 +02:00
Andrej730 f3f56c0891 simplified dev installation script for mac/linux 2023-06-29 16:13:37 +05:00
Andrej730 a689b31279 Fixed crash on Mac m1 on removing unused types (similar to 4d0be1972) 2023-06-29 15:34:52 +05:00
Andrej730 4d0be19720 Fix crash on Mac M1 on removing cost item
Crash happened because we were addressing `.id()` of already deleted `cost_item`.
Surprisingly for me on windows addressing `cost_item` was causing crash too but `cost_item.id()` worked fine.
2023-06-29 14:56:06 +05:00
Andrej730 fb7591caef avoid errors unregistering tools from tests 2023-06-29 13:43:08 +05:00
Dion Moult 8efaf2fbcb Attempt to bundle hppfcl for macosm1 2023-06-29 18:13:52 +10:00
Andrej730 d41068e132 Console warnings if drawing's assets not found #3325 2023-06-29 10:15:02 +05:00
Andrej730 4e65f143da unregistering spatial and structural tools on disabling addon 2023-06-28 16:54:43 +05:00
Andrej730 40656297a6 Fix for f88835b #3271
Now we do not rely on small offset to keep using inner curves to create linings, if some part of the lining is not present (which happens on mullions and transoms) we'll create U or L shape extrusion instead of rectangle with inner curve.

Long story short - this should keep ifc for windows valid.
2023-06-28 15:57:29 +05:00
Andrej730 f88835b87b Corrected L shapes in window lining after e89a9cd #3271
From this - https://i.imgur.com/hQuCcR3.png
To this - https://i.imgur.com/qZ2Lyfo.png

It's a bit hacky since we still use really small offsets to keep "The outer curve shall enclose all inner curves." rule for IfcArbitraryProfileDefWithVoids valid.
2023-06-28 15:56:38 +05:00
Andrej730 8f18db64cf Disable default stream mode for now to avoid errors #3354 2023-06-28 12:38:00 +05:00
Andrej730 fdd473234a Poll message for bim.file_unassociate/bim.file_associate 2023-06-28 10:45:53 +05:00
Andrej730 569f56f713 Fixed error on saving styles without textures after 3aff29dec 2023-06-28 10:39:57 +05:00
Andrej730 61607f9de2 Added IFC override operators to outliner/object context menus #3345
Outliner context menu - https://i.imgur.com/TkJKbLh.png
Object context menu - https://i.imgur.com/JXOEdYH.png
2023-06-28 10:32:33 +05:00
Dion Moult 40b34f6a33 Docs now point to the popular Search IFC Class website. 2023-06-28 13:30:36 +10:00
Dion Moult 89b0674b08 You can now exclude classes from streaming in ifcopenshell.stream 2023-06-28 12:41:50 +10:00
Trashman247 37e4f98857 Implement fully undo/redo with checks
While these actions are short in the backend--taking about 0.01 seconds to run--the Blender UI lags a lot leading to 2-3 second pauses because of the "refresh_brick_viewer" function being slow. This should be investigated.
2023-06-27 13:21:44 -07:00
Andrej730 e89a9cd01c adjust window offset on transoms/mullions for symmetry #3271
Before -  https://i.imgur.com/DbEzJ9H.png
After - https://i.imgur.com/0CERh86.png

Added it for modifier preview and ifc 2d and 3d repr but still need to work some things in 3d representation (L shape lining is not always detected correctly).
2023-06-27 19:30:49 +05:00
Dion Moult 20b63f530a New option to enable streaming IFC data into BBIM.
To test, go into add-on preferences and enable "Should Stream". Then load an IFC-SPF in advanced mode, and disable "Load Geometry" before loading (the geometry iterator doesn't work with streaming).
2023-06-27 21:07:37 +10:00
Dion Moult 183230b7f5 Naive implementation of file stream and Lark based IFC-SPF reader to handle huge IFCs. 2023-06-27 21:03:02 +10:00
Andrej730 7e2b40176c Fixing tests after 2dc9dc200 2023-06-27 15:29:05 +05:00
Andrej730 3aff29dec1 Support for import IfcSurfaceStyleWithTextures
Added UI for adding textures in BBIM shader graph generator

https://imgur.com/a/BI5pOZn
2023-06-27 14:30:30 +05:00
Trashman247 2ce32c6521 Change namespace selector to only show alias 2023-06-26 23:17:11 -07:00
Trashman247 9d84172f15 Add changeset versioning to Brick add/remove 2023-06-26 23:16:52 -07:00
Trashman247 8341931a62 Reformat commenting, remove prints, and remove BrickStore.project 2023-06-26 16:01:26 -07:00
Trashman247 81a4ff711c Implement fully serialize operator
- Turns out, you need the keyword "graph=" in graph_at() to actually select a graph of that name from the collection, otherwise it just returns the entire collection, so I changed that, which correctly isolates the project from the collection for serialization now.
- With this same change, I opted turn BrickStore.VersionedGraphCollection simply into BrickStore.graph and create a new BrickStore.get_project() to return the isolated graph. - This meant I should remove the reload_graph() function because I was actually just loading the entire collection into it still, and its functionality breaks when it isn't the entire collection
2023-06-26 13:59:28 -07:00
Dion Moult 2da86c170f See #3347. Hotfix latest IfcOpenShell SQLite features when making builds. 2023-06-26 22:14:59 +10:00
Dion Moult 41a176cb6d The BlenderBIM Add-on now supports loading IFCSQLite files! 2023-06-26 17:21:01 +10:00
Dion Moult 10e96239a1 You can now toggle loading geometry in advanced mode when loading a project 2023-06-26 17:13:34 +10:00
Dion Moult 897dfb1e33 ifcopenshell.sqlite wrapper now handles JSON fields by default, which is significantly more performant
f attributes holding entity lists are expanded in SQL, this means that you end up with significantly more rows. Also, you cannot have the ifc_id marked as a UNIQUE field / benefit from unique primary key index. So leaving the fields as JSON is actually significantly more efficient (almost 10X faster to load a model into BBIM).
2023-06-26 17:08:50 +10:00
Dion Moult c1d972f7bf Ifc2Sql patch now can store inverses for efficient queries. 2023-06-26 17:08:50 +10:00
Trashman247 d9196882dc Implement early testing for serialize operator (not functional)
All the right code seems to be in place, but it seems the package won't go through with the serialize function because of read/write permissions (ERRNO 13)
2023-06-25 23:56:15 -07:00
Trashman247 580f8f6218 Change graph naming to all caps 2023-06-25 23:21:27 -07:00
Trashman247 e177f5f051 Add Brick.ttl to .gitignore 2023-06-25 23:20:56 -07:00
Andrej730 1a5c501af0 Fixed typo in e3a7f7627 2023-06-26 10:48:50 +05:00
Andrej730 12c10f98a3 Fixing bug after 28cc168
Was causing some tests to fail
2023-06-26 10:33:07 +05:00
Andrej730 e3a7f76276 Avoid ui errors after 2dc9dc200 2023-06-24 10:19:35 +05:00
Trashman247 046ce2b8e7 Update BrickStore.purge()
I wanted to just have a BrickStore.clear() which would so this:

        BrickStore.VersionedGraphCollection = None
        BrickStore.graph = None
        BrickStore.path = None

(aka not also set BrickStore.schema = None, since it should theoretically just load in the same path anyway) but for some reason Blender crashes when clearing a project and loading one again this way.
2023-06-23 16:55:34 -07:00
Andrej730 6dab4501ad Unhide in render for not excluded objects #3338
Objects were hidden in render but never unhidden if they were no more in drawing's .Exlcude
2023-06-23 18:19:33 +05:00
Andrej730 2dc9dc2000 Generating IFC compatible shader graphs
Added new panel. in shader graph N-panel that allows you to create fully GLTF and IFC compatible shader graphs by just tweaking parameters from the panel. Note that it's still saved to IFC only when you hit "Save Current Style", before that it's still just stored in blender.

https://imgur.com/a/vmkoLPH

The premise is that if you want to have non-external style you'd be able to create it entirely from this panel - so there will no need to guess or to remember which parameters from the graph are supported by IFC and which are not.

It's still work in progress, still need to polish it, add support for more reflectance methods and add suport for textures (need to be able to import/export it with .ifc and set them from this panel).
2023-06-23 18:04:32 +05:00
Andrej730 addce9f0ea Fixed #3342 2023-06-23 17:15:10 +05:00
Andrej730 4a368938c3 Set shading flat by default to solve #3336
Before blender 3.6 it was setting flat shading by default, so we just keeping the same behaviour.
2023-06-22 22:00:42 +05:00
Thomas Krijnen a0f68baefc #2805 syntax 2023-06-22 16:23:32 +02:00
Thomas Krijnen 3decb48ed0 #2805 template keyword for gcc 2023-06-22 14:30:11 +02:00
Thomas Krijnen 2d330f4c90 #2805 IFC4X3 codegen 2023-06-22 14:10:55 +02:00
Thomas Krijnen 1c996013b6 #2805 Further fixes for aggregates of select 2023-06-22 14:10:55 +02:00
Thomas Krijnen 65cb47e2d8 #2805 IfcGeom dynamic casting updates 2023-06-22 14:07:34 +02:00
Thomas Krijnen e9d0b8ab66 #2805 IfcGeom updates 2023-06-22 12:07:10 +02:00
Thomas Krijnen 0bb9bcd9fb #2805 Pasta errors 2023-06-22 11:03:06 +02:00
Thomas Krijnen 997ebe48df #2805 template keyword for gcc 2023-06-22 10:48:19 +02:00
Thomas Krijnen 0cdf72fde1 #2805 Rerun codegen 2023-06-22 10:30:57 +02:00
Thomas Krijnen 97c6b99d57 #2805 Use dynamic cast for generalize() due to virtual inheritance of selects 2023-06-22 10:30:42 +02:00
Thomas Krijnen ed5d28de54 #2805 update hierarchy helper 2023-06-22 10:08:58 +02:00
Thomas Krijnen f5c102402f #2805 rerun codegen 2023-06-22 10:07:27 +02:00
Thomas Krijnen 7aa04611a1 #2805 provide aggregate typedef for select types 2023-06-22 10:07:26 +02:00
Andrej730 5c7f14cc3c option to keep the viewport position on activating drawing #3333
currently it works with alt clicking activate drawing button
https://i.imgur.com/lgvP4QA.png
2023-06-22 10:15:39 +05:00
Andrej730 9e1249d8ee Fixed #3335 caused by 36b746d 2023-06-22 09:33:40 +05:00
Bruno Postle 6cb7234cb5 BBIM fix Git panel polling repo on refresh (#3096)
Just scrolling Git panel shouldn't do any Git IO
2023-06-21 21:42:50 +01:00
Thomas Krijnen aab6a21bf3 #2805 rerun codegen 2023-06-21 19:25:05 +02:00
Thomas Krijnen c72f960ed4 #2805 statically typed select types as aggregates 2023-06-21 19:25:04 +02:00
Massimo Fabbro b63b4ce326 Add toggle space visibiity button into spatial tool menu 2023-06-21 18:57:41 +02:00
Andrej730 71113b56bf refactor with SKIP_SAVE option on operator props
Co-Authored-By: Gorgious56 <25156105+Gorgious56@users.noreply.github.com>
2023-06-21 17:49:16 +05:00
Andrej730 ef57c209a0 More options to save .ifc as relative path in blender 2023-06-21 17:39:57 +05:00
Andrej730 e99c154cb2 Fixed tests after a4a6dce 2023-06-21 14:19:26 +05:00
Andrej730 520860bdb9 Fixed test after b035129 2023-06-21 14:19:25 +05:00
Andrej730 103e8a545b Fixed test after c8c0c9a
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[...
2023-06-21 14:19:25 +05:00
Andrej730 d35c5c433f Fixed missing ifc file in api call after 28cc168
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: []
2023-06-21 14:19:25 +05:00
Andrej730 7dc98612e4 Fixed void tests after d3d2c36 2023-06-21 11:04:22 +05:00
Andrej730 3853258b27 Fixing test after 1c12a98
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
2023-06-21 10:16:03 +05:00
Andrej730 6825d26700 Small fix related to 5c2ae98c0 and a bit more descriptive operator error
FAILED test/bim/test_feature.py::test_create_project__ifc2x3 - AssertionError: Failed to run operator bpy.ops.bim.create_project
2023-06-21 09:58:41 +05:00
Andrej730 900c35e9fe Fixing collections tests related to 99d9c0f5b
FAILED test/bim/test_feature.py::test_remove_drawing - AssertionError: The collection "IfcGroup/PLAN_VIEW" does not exist
2023-06-21 09:46:44 +05:00
Bruno Postle 7aafa87b52 BlenderBIM push Git tags to remote
Shows error message if push fails
2023-06-20 16:58:55 +01:00
Andrej730 e719055d9a Fixed duplicated objects collections issue after 586707dd2
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']
2023-06-20 19:42:31 +05:00
Andrej730 a956038bfc Preserving original name on unlinking
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
2023-06-20 19:18:40 +05:00
Andrej730 5c2ae98c09 Fixed couple bugs in test_feature
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
2023-06-20 19:18:39 +05:00
Andrej730 99d9c0f5bf Fixing collectors tests after 1f43ec8 2023-06-20 17:50:30 +05:00
Andrej730 2fbb9c569b Fixing tool tests 2023-06-20 17:30:01 +05:00
Andrej730 4a9d1ff038 Fixing core tests 2023-06-20 16:31:10 +05:00
Trashman247 bcf5f07718 Rework NewBrick and LoadBrick in test_brick.py to fit with new VGC format
- VGC means VersionedGraphCollection.
- BrickStore.schema is now a filepath, so make that the case in the testing also.
2023-06-19 21:59:17 -07:00
Trashman247 a3572f3372 Implement VersionedGraphCollection to Brick module
- Reworked `load_brick_file` and `new_brick_file` to fit under the VersionedGraphCollection implementation. (Other methods may have broken).
- Added `undo_brick` and `redo_brick`.
- Kept BrickStore.graph the same as to generally still work with the rest of the code. This was done by parsing the VersionedGraphCollection with the new `reload_brick_graph` method.
2023-06-19 21:54:28 -07:00
Andrej730 6cd9161986 Fixed import error with filtering out IfcGrid's spatial element #3283
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'
2023-06-19 19:04:51 +05:00
Andrej730 982f4a4965 Fixed getting filtered spatial elements at import for ifc2x3 #3283
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?
2023-06-19 19:03:18 +05:00
Thomas Krijnen c5aab16696 Remove dependency on bootstrap 2023-06-19 14:34:14 +02:00
Thomas Krijnen 6e1b18ba33 #3120 item_id vector test case 2023-06-19 13:48:35 +02:00
Thomas Krijnen 2b3d547c99 #3120 item_id vector 2023-06-19 13:47:55 +02:00
Andrej730 a34be6ae5d Getting shader graph nodes by type rather than name #3316
Because relying on names doesn't work for non english users
2023-06-19 16:17:37 +05:00
Andrej730 dfc5a280a4 Fixed error on disabling editing window 2023-06-19 15:51:01 +05:00
Andrej730 6a2bbfa85c Added button to update current style #3293
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)
2023-06-19 11:02:42 +05:00
Bruno Postle ddef4820d0 BlenderBIM Git merge asymmetry heuristic (#3096)
`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'.
2023-06-16 19:42:57 +01:00
Thomas Krijnen e6b05b547b Further defer sql.py imports for ifcopenbot to succeed 2023-06-16 20:32:40 +02:00
Thomas Krijnen 5e8ec48d98 Comment out import mysql.connector 2023-06-16 14:16:17 +02:00
Thomas Krijnen 9c21304629 Correct if-clause 2023-06-16 14:08:48 +02:00
Thomas Krijnen 1278f98df6 Add test 2023-06-16 14:08:48 +02:00
Totally a booplicate d31b470e83 smol fix 2023-06-16 14:08:48 +02:00
Totally a booplicate 1ecb25684e fix missing else clause 2023-06-16 14:08:48 +02:00
Totally a booplicate 5999976d37 raise TypeError on invalid pset 2023-06-16 14:08:48 +02:00
Totally a booplicate 51e5f843ba rework unpack_unit_value
handle the `None` case, simplify logic
2023-06-16 14:08:48 +02:00
Totally a booplicate 3d787338fb improve naming of the new method 2023-06-16 14:08:48 +02:00
Totally a booplicate de67648f3e improve update_existing_properties
explicit class check
error out on a not supported type
better methods names
2023-06-16 14:08:48 +02:00
Totally a booplicate afa803ea62 implement _try_purge
per review comment about repeating code
2023-06-16 14:08:48 +02:00
Totally a booplicate 3a0aaee03b restructure if/elif/else chain 2023-06-16 14:08:48 +02:00
Totally a booplicate a5353e02b5 support tuples 2023-06-16 14:08:48 +02:00
Totally a booplicate 1acc743370 move prop check 2023-06-16 14:08:48 +02:00
Totally a booplicate 375f4f2a86 per review
change exception message
remove TODO
pass `Unit`
raise `NotImplementedError` when no template was found
2023-06-16 14:08:48 +02:00
Totally a booplicate d4b88fd422 resolve TODO
This is being fixed, we should always have a class to use
2023-06-16 14:08:48 +02:00
Totally a booplicate df6cc74a87 attempt to improve pset support
1. Adds support to directly passed in property entities
2. Adds support for tuples
3. Adds support for P_LISTVALUE
2023-06-16 14:08:48 +02:00
Balázs Dukai 80846061f2 Don't use importlib for version 2023-06-16 13:29:24 +02:00
Balázs Dukai 80f9590410 Get package version from pyproject.toml 2023-06-16 13:29:24 +02:00
Balázs Dukai 16cda28d16 Include GenericCityObject extension 2023-06-16 13:29:24 +02:00
Balázs Dukai 24ea024a0d Add parameters 2023-06-16 13:29:24 +02:00
Balázs Dukai e90d7ccdb1 Init package 2023-06-16 13:29:24 +02:00
Vasile-Corjan 1a3bf513a7 Update README.md 2023-06-16 08:34:05 +02:00
Vasile-Corjan a855c40426 Update README.md
I have added the parameters "minOccurs" and "maxOccurs"
2023-06-16 08:34:05 +02:00
Dion Moult c8ede38edb Run black on existing entity_instance 2023-06-16 16:17:17 +10:00
Dion Moult 704e27ecca Build testing prototype of an SQLite based file / entity_instance. 2023-06-16 16:16:22 +10:00
Dion Moult 438ddc17f5 Document two answers to frequently reported bugs: missing numpy and blend / ifc out of sync. 2023-06-16 14:13:15 +10:00
Dion Moult a8dfed50e4 Minor geometry processing documentation fix 2023-06-16 13:32:33 +10:00
Dion Moult 8cb99a77cf Convert Ifc2Sql script to IfcPatch recipe and add geometry support 2023-06-16 13:32:33 +10:00
Dion Moult f9b6e6f098 Fetch pset and qto names via pset data instead of real time to prevent UI lag on larger models. 2023-06-16 13:32:33 +10:00
Dion Moult 1365b76149 Lazily check for BBIM_Railing psets to prevent unnecessarily fetching psets for every element when loading models. 2023-06-16 13:32:33 +10:00
Dion Moult 47cc3158fd IfcPatch can now support patches that write to arbitrary files or have no output. 2023-06-16 13:32:33 +10:00
Dion Moult bac683e105 Fix bug for getting psets of materials and profiles in IFC2X3 2023-06-16 13:32:33 +10:00
Thomas Krijnen 840818d681 #3308 add assert 2023-06-15 21:27:42 +02:00
Thomas Krijnen 206933a2f2 #2819 Handle periodic bspline curves in serialization 2023-06-15 16:19:05 +02:00
Thomas Krijnen ff209b4c11 #2819 Mark rep id as AdvancedBrep 2023-06-15 16:18:29 +02:00
Sigma Dimensions 4bc987924d enable activating object type when trying to select type from an object ( whilst the type is hidden from view layer) 2023-06-14 13:11:17 +01:00
Massimo Fabbro f26cfc93ea Now generate spaces from walls considers also columns in order to create the contours 2023-06-14 12:58:39 +02:00
Thomas Krijnen 4bbb6cd2df #3305 Less pessimistic tolerance comparison in newells method 2023-06-14 11:47:24 +02:00
Thomas Krijnen 9411a1d94b #3305 one more iteration on lower fuzziness level for boolean ops 2023-06-14 11:47:24 +02:00
Sigma Dimensions 6a287ced7c temporarily hide IFC Spatial Manager for IFC2X3 models 2023-06-14 10:47:00 +01:00
Sigma Dimensions fb02ac34d4 Enable selecting group elements 2023-06-14 09:35:54 +01:00
Sigma Dimensions 81fd84223a Enable selecting a container's children from the IFC Spatial Manager panel 2023-06-13 21:17:02 +01:00
Sigma Dimensions a8f1a28ac2 fix replacing material with material profile 2023-06-13 14:04:28 +01:00
Sigma Dimensions d2f4f0d8c2 experimental patch of non parametric mep segments 2023-06-13 13:26:53 +01:00
Sigma Dimensions 1c17cccc45 fix missing import 2023-06-13 10:34:21 +01:00
Sigma Dimensions 061930bc8e Move Spatial Manager UI to "IFC Project Set-up" 2023-06-13 10:32:25 +01:00
Sigma Dimensions 28cc168b3b split material assign/unassign operators into tool and core 2023-06-13 10:28:31 +01:00
Sigma Dimensions 88f53f7931 fix delete material operator 2023-06-12 15:24:51 +01:00
Sigma Dimensions 755fa81817 Fix displaying connections for selected distribution ports 2023-06-12 15:23:24 +01:00
Sigma Dimensions 36fab12847 Refactor and re-use common spatial_tool.select_products 2023-06-12 15:21:33 +01:00
Andrej730 32393136d2 Support external shaders from currently opened blend file
Previously it was crashing if you try use shader from current .blend file as external.
I guess we now kind of support external internal shaders 🙃
2023-06-12 17:28:52 +05:00
Andrej730 c7b3331496 switch to external styles for rendered shading in viewport
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
2023-06-12 17:28:52 +05:00
Andrej730 7c0c934b4f prioritize external styles on ifc import
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
2023-06-12 17:28:51 +05:00
johanrd 62944e04e9 fix typo in README.md 2023-06-12 11:22:31 +02:00
Bruno Postle 3a93b15b55 BBIM show all fetched remote Git branches (#3096) 2023-06-11 20:49:55 +01:00
Gorgious 83cd00271b Fix #3142 : Use Tab hotkey to edit horizontally layered objects 2023-06-11 18:17:03 +02:00
Ahmad Saleem Z 820686a39b added link to aws/lambda guide in installation guide 2023-06-11 18:04:34 +02:00
Ahmad Saleem Z 4fe896a3b6 fix ARG in Dockerfile 2023-06-11 18:04:34 +02:00
Ahmad Saleem Z 975b1c444c documentation 2023-06-11 18:04:34 +02:00
Ahmad Saleem Z c3f2046491 example fixes 2023-06-11 18:04:34 +02:00
Ahmad Saleem Z 3a1557bedc added aws/lambda sample 2023-06-11 18:04:34 +02:00
Bruno Postle a71b5e1f11 BlenderBIM operator to add remote repo (#3096)
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
2023-06-10 22:04:01 +01:00
Dion Moult 4806b9a260 Toggle between full schema (i.e. all tables for every declaration) and partial schema dump into SQL 2023-06-10 23:14:32 +10:00
Bruno Postle 0d67c43e16 BlenderBIM operator to delete a Git remote (#3096) 2023-06-10 11:08:49 +01:00
Bruno Postle e2b52e7ed9 BlenderBIM fix warning writing .git/config (#3096) 2023-06-10 10:07:17 +01:00
Balázs Dukai 3c53067567 Add copyright 2023-06-10 15:39:49 +10:00
Balázs Dukai 5ad7d4bb2a Update to ifcopenshell 0.7.0 and cjio 0.8
LoD is string in v1.1
2023-06-10 15:39:49 +10:00
Balázs Dukai 3803942c5f Update to v1.1 CityObject types 2023-06-10 15:39:49 +10:00
Andrej730 678f50f17d IfcGitData update to ifcgit operators poll() methods
Added loading IfcGitData to ifcgit operator's poll() methods because it was getting a bit spammy in console if you don't use git.

Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 255, in poll
    if IfcGitData.data["ifcmerge_exe"]:
KeyError: 'ifcmerge_exe'
Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 147, in poll
    repo = IfcGitData.data["repo"]
KeyError: 'repo'
Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 18, in poll
    path_ifc = IfcGitData.data["path_ifc"]
KeyError: 'path_ifc'
Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 45, in poll
    path_ifc = IfcGitData.data["path_ifc"]
KeyError: 'path_ifc'
Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 190, in poll
    repo = IfcGitData.data["repo"]
KeyError: 'repo'
Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\ifcgit\operator.py", line 111, in poll
    repo = IfcGitData.data["repo"]
KeyError: 'repo'
2023-06-09 19:38:16 +05:00
Andrej730 04fe2bdf2e External Styles
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
2023-06-09 18:40:53 +05:00
Dion Moult ed990c3e83 Experimental support for storage of IFC in MySQL and SQLite 2023-06-09 22:16:54 +10:00
D4ve-R 741c78cd6c Revert "build scripts"
This reverts commit 6c1218d352.
2023-06-09 13:28:25 +02:00
D4ve-R 2b88c542aa build scripts 2023-06-09 13:28:25 +02:00
D4ve-R 1f6b55e639 prepare for referencing 2023-06-09 13:28:25 +02:00
D4ve-R 9f3fb13cde metersPerUnit 2023-06-09 13:28:25 +02:00
D4ve-R 42f1d9c160 usd rotateXYZop 2023-06-09 13:28:25 +02:00
D4ve-R f0875835c1 Update submodule 2023-06-09 13:28:25 +02:00
D4ve-R 0828a89b66 fix typo 2023-06-09 13:28:25 +02:00
D4ve-R a8ca66b425 refactor 2023-06-09 13:28:25 +02:00
D4ve-R 92b03c6b59 stage up axis 2023-06-09 13:28:25 +02:00
D4ve-R d316efe902 fix filename bug 2023-06-09 13:28:25 +02:00
D4ve-R 77e4e939ce filename bug 2023-06-09 13:28:25 +02:00
D4ve-R fe7504edf2 cmake warnings 2023-06-09 13:28:25 +02:00
D4ve-R a8f1ab1923 material subsets 2023-06-09 13:28:25 +02:00
D4ve-R 1b5f9497d4 works fine 2023-06-09 13:28:25 +02:00
D4ve-R a7bbb35c5e compile & link successful 2023-06-09 13:28:25 +02:00
D4ve-R 1787f064f6 materials 2023-06-09 13:28:25 +02:00
D4ve-R d1c24ebba4 Add USDSerializer to IfcConvert 2023-06-09 13:28:25 +02:00
D4ve-R cc6dacb286 Add USDSerializer write-only 2023-06-09 13:28:25 +02:00
Thomas Krijnen c67eb60fd5 #2942 Escape SVG text labels 2023-06-09 11:34:50 +02:00
Sigma Dimensions 59c482489f Merge pull request #3279 from nelsonhp3/v0.7.0
implements fileselect to export_cost_schedules
2023-06-08 23:48:30 +01:00
Andrej730 7a0963617e Fixed small error on disabling editing extrusion axis 2023-06-08 17:58:06 +05:00
Chetan e4ec1dc457 If an IFC file has an IFCRELASSOCIATESMATERIAL but did not supply an IFCMATERIAL, IfcConvert will crash. This commit prevents the crash, catches the exception and prints an error on the terminal 2023-06-08 10:01:24 +02:00
Dion Moult b035129788 Fix bug where you couldn't unassign inherited materials. 2023-06-08 16:00:31 +10:00
Dion Moult 78be8114ac Fix sync bug where unused styles would be purged when reloading a blender file. 2023-06-08 16:00:31 +10:00
Nelson Henrique 18ad025c5d implements fileselect to export_cost_schedules 2023-06-08 00:24:48 +00:00
Martin15135215 5825e0c71b CITATION.cff for BIMTester 2023-06-08 09:45:54 +10:00
Martin15135215 df64ca4cfb CITATION.cff for ifc5d 2023-06-08 09:45:54 +10:00
Martin15135215 fc1f5496a0 CITATION.cff for ifc4d 2023-06-08 09:45:54 +10:00
Martin15135215 5a9dbc5a36 CITATION.cff for ifc2ca 2023-06-08 09:45:54 +10:00
Martin15135215 eaeeede287 CITATION.cff for bsdd 2023-06-08 09:45:54 +10:00
Martin15135215 e78b3a3977 CITATION.cff for bcf 2023-06-08 09:45:54 +10:00
Bruno Postle a8ca8217ea BlenderBIM fix Git error on simple merge (#3096)
Running git commit after a simple merge (that hasn't required conflict
resolution) is a noop, but generates an annoying message anyway.
2023-06-07 22:50:20 +01:00
Dion Moult 77c2e30733 Fix #3272. See #3069. Fix incorrect refactoring when I was decoupling collections. 2023-06-07 22:13:38 +10:00
Gorgious56 5a3a387b8c Fix error when going out of edit mode with TAB when editing an arbitrary profile 2023-06-07 11:22:06 +02:00
Gorgious56 f68f60832c Fix profile based geometry not re-generating properly when exiting edit mode and the profile geometry wasn't modified 2023-06-07 11:21:43 +02:00
Martin15135215 b05417a4d8 Update author in CITATION.cff 2023-06-07 10:54:47 +02:00
Martin15135215 c2a4e30fae CITATION.cff file for BlenderBIM 2023-06-07 10:54:47 +02:00
Thomas Krijnen 1a0280928b #3201 take into account edge orientation correctly 2023-06-07 08:43:08 +02:00
Andrej730 dda16c847d ids/classes namespaces for drawings in the sheet #3047
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
2023-06-07 11:07:48 +05:00
Dion Moult 47c6c2ce9a See #3266. Write documentation on how to use IfcCSV. 2023-06-07 16:00:12 +10:00
Dion Moult 3758c454c9 Add support for Pandas DataFrames in IfcCSV and clean up function signatures 2023-06-07 15:59:20 +10:00
Dion Moult 4b6424e0e1 Fix #3264. Describe IFC to JSON conversion (and other formats) in documentation. 2023-06-07 14:30:48 +10:00
Bruno Postle d71887d846 BlenderBIM fix Git merge log history (#3096)
The GitPython commit() method isn't suitable for completing a merge as
it only sets one parent, losing all history from the merged branch.
2023-06-07 00:45:01 +01:00
Thomas Krijnen d61945a575 #3255 unreferened param 2023-06-06 13:25:13 +02:00
Gorgious56 45e6ae6708 Revert unselect non-ifc object using TAB 2023-06-06 11:59:05 +02:00
Gorgious56 ebbf30a88c Fix wall mounted handrail railing modifier not regenerating properly when going out of edit mode with the tab key if the path wasn't modified 2023-06-06 09:57:00 +02:00
Dion Moult e5769766af Fix #3226. There is now a faster deletion mode that kicks in for large models and large geometry deletions. 2023-06-06 17:40:31 +10:00
Dion Moult 64b9d2e5e3 See #3226. New batched remove_deep2() which uses serialisation for faster removal performance on large graphs. 2023-06-06 17:40:31 +10:00
Andrej730 3213ffe760 Fixed #3259 2023-06-06 10:44:27 +05:00
Bruno Postle a851689bca BlenderBIM use git shortlog to summarise merge log 2023-06-05 21:22:16 +01:00
Gorgious56 98f2bd66b6 Edit profile based representations with TAB (#3142)
* 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
2023-06-05 18:07:25 +02:00
Andrej730 1c12a98b68 Solved #3219 2023-06-05 18:45:02 +05:00
Andrej730 a3859385c4 Blender curves to IfcIndexedPolyCurve #3233
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).
2023-06-05 17:21:27 +05:00
Andrej730 c7394faf51 Display units for more pset/qset props #3235
Now current project units displayed for area and volume properties too.
https://i.imgur.com/7dgl1pC.png
Also added support for imperial units symbols.
2023-06-05 14:54:41 +05:00
Andrej730 3907ae656c small note for unsupported pset prop types 2023-06-05 12:44:50 +05:00
Andrej730 5fc31be8aa Add to scene properties whether we use relative path to .ifc #3251
Previously it was stored as operator's prop which is (turned out) reseted on reopening .blend.
2023-06-05 12:09:59 +05:00
Andrej730 7976fb4d09 Small fix for 1f43ec870
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'
2023-06-05 11:50:27 +05:00
Andrej730 01635ecd8a small fix for syntax warning after 4865b62ea
SyntaxWarning: "is not" with a literal. Did you mean "!="?
2023-06-05 11:42:28 +05:00
Andrej730 f6657113b6 Spatial/Structural Tools icons 2023-06-05 11:18:52 +05:00
Andrej730 480f1a91a6 Moving operators to Spatial Tool
Changes:
- Moved Shift A "Add boundary" from BIM Tool to Spatial Tool
- Moved Alt B "Show boundaries" from BIM Tool to Spatial Tool
2023-06-05 11:18:52 +05:00
Massimo Fabbro 4865b62ea9 Fix create spaces from walls z-value (#3248)
Co-authored-by: Dion Moult <dion@thinkmoult.com>
2023-06-05 15:17:03 +10:00
Massimo Fabbro 9a440899be New toggle space visibility button 2023-06-05 15:15:37 +10:00
Dion Moult 3ee6bdf207 You can now get decompositions non-recursively in element utilities 2023-06-05 15:11:55 +10:00
Dion Moult 1f43ec8709 Fix #3069. (Again) review all occurrences of users_collection and collection.name 2023-06-05 15:11:19 +10:00
Trashman247 d030582fbb Keep dist-info in compiling brickschema and add persistence extras 2023-06-04 20:53:23 -07:00
Bruno Postle 60a8d9b2fd Include commit summary of merged branches (#3096)
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.
2023-06-04 22:47:10 +01:00
Bruno Postle a5de5d8c0e Display multi-line commit and tag messages (#3096) 2023-06-04 18:39:03 +01:00
Sigma Dimensions b506e7dbbc Add a banner to ifcopenshell README 2023-06-04 12:53:21 +01:00
Bruno Postle db8f1a9b70 Operator to delete a Git tag (#3096) 2023-06-04 11:17:45 +01:00
Bruno Postle 032f52d434 Operator to view selected object Git history #3096
A new BlenderBIM > Git History side-panel to show the raw Git log
for the step entity of the selected object
2023-06-04 09:52:30 +01:00
Sigma Dimensions 1003e8de91 Prototype Building Storey Manager #3246 2023-06-03 21:07:20 +01:00
Sigma Dimensions c6ef402b60 fix draw_project_not_saved_ui for BIM documentation 2023-06-03 11:55:44 +01:00
Andrej730 5805653431 same generate_pset_templates.py for ifcopenshell and ifc dev repos
same script will be easier to maintain
2023-06-03 12:57:48 +05:00
Andrej730 186da73135 Fixed validation errors in pset templates library
- missing project and IfcRelDeclares guids
- missing RelatingContext in IfcRelDeclares
2023-06-03 11:00:29 +05:00
Andrej730 528481e774 Fixed missing PrimaryMeasureType for P_LISTVALUE in pset templates #3236
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).
2023-06-03 10:34:13 +05:00
Sigma Dimensions 886ab52556 You can now review and assign currencies from the Cost Schedule Panel 2023-06-02 14:52:10 +01:00
Sigma Dimensions 8196f31d82 Display currency on cost item values and total cost 2023-06-02 14:49:59 +01:00
Andrej730 de3b844829 Placeholders for spatial and structural tools 2023-06-02 17:57:44 +05:00
Andrej730 fa4e19eba7 Tests for external svg references 2023-06-02 12:01:44 +05:00
Trashman247 1488ae40ee Update Makefile 2023-06-02 14:09:58 +10:00
Sigma Dimensions aa004ef0c6 auto refresh tasks assigned to products when filtering by active schedule 2023-06-02 00:34:08 +01:00
Sigma Dimensions 0c946fae36 fix removing cost item value 2023-06-02 00:31:50 +01:00
Sigma Dimensions f297739836 BBIM 5D: Various Cost Schedule UI Improvemements 2023-06-02 00:30:49 +01:00
Thomas Krijnen b33e58f40b fix syntax error on gcc 2023-06-01 22:03:31 +02:00
Thomas Krijnen 30d9743ae7 typename :( 2023-06-01 21:47:07 +02:00
Thomas Krijnen c974306636 #3141 eliminate_narrow_operands() 2023-06-01 21:42:31 +02:00
Thomas Krijnen 602176815a Commit obsolete fix just in case 2023-06-01 21:41:08 +02:00
Thomas Krijnen 7652144184 Fix IfcFile::getInverse<T>() 2023-06-01 21:39:08 +02:00
Andrej730 0fd94d291b References for adding external svgs to the sheets
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
2023-06-01 21:41:06 +05:00
Sigma Dimensions 3c9f09f246 Use util.element.get_predefined_type() #065bda6 2023-06-01 13:07:00 +01:00
Thomas Krijnen d60fbd2c09 Don't assert but just if-check for not terminating rule execution on very invalid files 2023-06-01 14:06:41 +02:00
Sigma Dimensions 9d869ebb6d Run costing tests and rename changed methods 2023-06-01 13:02:01 +01:00
Dion Moult 971e508e3d See #3069. Continued refactoring to not rely on users_collection[0]. 2023-06-01 21:18:32 +10:00
Dion Moult 7020caf682 See #3069. More cleanup moving away from collection names and assumed single collections. 2023-06-01 17:39:36 +10:00
Dion Moult 7cd7ad1281 Fix regressions after making aggregate based on selected objects. 2023-06-01 16:59:53 +10:00
Dion Moult 586707dd28 Fix #3069. WARNING: dangerous change. Objects that have their own collection now have a pointer to that collection. This fixes a variety of subtle sync bugs. 2023-06-01 16:59:53 +10:00
Andrej730 4bb46fa607 Remove test to reproduce #3169 as irrelevant 2023-06-01 10:01:14 +05:00
Andrej730 7d5beb6c80 Added test to cover 2629172ff 2023-06-01 10:01:13 +05:00
Andrej730 ecc0263062 Fixed bug with saving data to Pset_StairFlightCommon not in project units 2023-06-01 10:01:13 +05:00
Dion Moult 39c5dc6ea4 Merge pull request #3214 from maxfb87/new_patch_recipie
New patch recipe
2023-06-01 09:55:10 +10:00
Thomas Krijnen e6d6ab6da7 More informed invalid shape reporting 2023-05-31 22:15:26 +02:00
Thomas Krijnen d7c3b5a990 #3201 apply boolean results in batches as well 2023-05-31 22:15:01 +02:00
Thomas Krijnen 3409cd7c29 #3201 approximate circular sharp corners 2023-05-31 22:13:53 +02:00
Massimo Fabbro 91176349f7 Remove old patch file 2023-05-31 21:07:34 +02:00
Massimo Fabbro 6634025346 Move the recipe into the blenderbim script folder and rewrite it as a script 2023-05-31 21:02:29 +02:00
Sigma Dimensions a771061495 Exporting cost schedules opens the folder directory 2023-05-31 16:21:19 +01:00
Andrej730 2629172ff4 Displaying project units for length values in psets and qsets
Examples:
- https://i.imgur.com/ww7MJ7w.png
- https://i.imgur.com/N1rOELc.png
2023-05-31 18:16:01 +05:00
Andrej730 36b746da7a Railing, Door Modifiers - project units props
Example - https://i.imgur.com/SJOQMMm.png
2023-05-31 14:33:18 +05:00
Burak Yildiz d3aa2e87c9 fix ifcopenshell.version 2023-05-31 10:12:16 +02:00
Andrej730 c6090ef9b3 black format 2023-05-31 12:06:03 +05:00
Andrej730 6354a11645 maintaining same roof thickness for different rafter edge angles
PS roof code is not getting simpler to work with 🥲
2023-05-31 12:04:10 +05:00
Dion Moult 11ec8e04c2 Removing authoring mode which was an outdated concept. 2023-05-31 15:35:53 +10:00
Dion Moult 8a9998bc65 Fix #3163. Use text in lieu of inability to use URIReferences in drawing pset. 2023-05-31 15:14:53 +10:00
Sigma Dimensions 065bda604e Cost schedule name label now shows the predefined type 2023-05-31 04:38:21 +01:00
Dion Moult 471aeab439 Fix #3120. Don't remove doubles as it may break mesh manifoldness. 2023-05-31 13:26:53 +10:00
Dion Moult f2c757b1bb Fix #3113. Support regex in selector filter values. 2023-05-31 13:23:51 +10:00
Andrej730 f6e72ec06f rafter edge angle and roof thickness #3092
Added option to adjust rafter edge angle and roof thickness
Short demonstration - https://imgur.com/a/TsYSs6i
2023-05-30 18:03:35 +05:00
Andrej730 9dd82036ba Roof modifier - asymmetrical gable #3093
Example - https://i.imgur.com/EHaSt16.png
2023-05-30 18:03:34 +05:00
Dion Moult ff2fa70776 Close #3139. Bump IfcOpenShell. 2023-05-30 21:06:09 +10:00
Dion Moult e4b1f56f6d Fix #3211. Generated fills now are siblings to the element that they void. 2023-05-30 16:07:31 +10:00
Andrej730 0d7a789ed8 Schedule Builder - text/background color support #3154 2023-05-30 10:58:56 +05:00
Andrej730 d73e77c5ed separate ifc text literals in svg with newline #3207 2023-05-30 10:30:22 +05:00
Dion Moult dddbf64e93 Fix #3212. Bug where viewport camera bisection didn't have enough tolerance and sometimes wasn't visible. 2023-05-30 14:31:03 +10:00
Dion Moult 1d5891fde7 Fix #3209. Handle loading of custom scales, fix incomplete NTS implementation, and use Lark for more reliable imperial scale parsing. 2023-05-30 12:53:02 +10:00
Dion Moult c5de64de51 Merge pull request #3177 from IfcOpenShell/elevation_tweaks
a few plan level tweaks
2023-05-30 09:53:42 +10:00
Dion Moult a43b2a2ae8 Merge branch 'v0.7.0' into elevation_tweaks 2023-05-30 09:53:19 +10:00
Massimo Fabbro 7ab92dfa0b IfcPatch ReplaceDrawingPath recipie improved: now it's possible to use it on Linux and on Windows 2023-05-29 20:01:45 +02:00
Massimo Fabbro ff81286874 Now it's possible to fix drawing reference path problem saved in Windows and opened in Linux 2023-05-29 17:14:06 +02:00
Andrej730 51ad31f5a3 Fixed Stair annotation bug introduced in 762299124
in 762299124 I've changed number of segments and verts but never adjusted StairDecorator - so it wasn't drawing parts of the annotation
2023-05-29 17:13:51 +05:00
Andrej730 6336db0069 Optimized iteration over objects for viewport annotations #3198
This commit should increase viewport annotations performance significantly on large projects. Described in #3198
2023-05-29 16:47:47 +05:00
Dion Moult 7d7122ee4c Fix #3210. Revert "BBIM Drawings: Exclude ifc objects hidden from render view"
This reverts commit 6f39648077.
2023-05-29 20:31:23 +10:00
Dion Moult 7d852f9e51 Fix #3138. Remove manual copy class and be more intelligent about what classe can be reassigned. 2023-05-29 17:21:05 +10:00
Andrej730 605097de76 Same distance function for viewport and svg #1321 #3198 2023-05-29 12:11:29 +05:00
Dion Moult 07638dac27 Fix #3200. Bug where include / exclude filters could break the drawing. 2023-05-29 15:27:48 +10:00
Sigma Dimensions 6f39648077 BBIM Drawings: Exclude ifc objects hidden from render view 2023-05-28 14:47:47 +01:00
Sigma Dimensions 90c19f8454 Ctrl+P and Alt+P BIMTool Hotekys to assign/unassign aggregation 2023-05-28 14:45:57 +01:00
Bruno Postle 929aa3a49b Select new/changed objects in visual diff (#3096)
When visualising differences between current/selected revision,
new/changed objects are selected as well as colourised
2023-05-28 11:22:01 +01:00
Bruno Postle 83e97b7205 Fix checkout version equivalent to a remote HEAD 2023-05-28 11:02:46 +01:00
Dion Moult 5d583741b9 See #3184. Preserve parametric layerset axis direction hints when changing types. 2023-05-28 17:29:00 +10:00
Dion Moult d3d2c3608b Fix #2106. You can now assign an opening to another element. 2023-05-28 15:02:55 +10:00
Dion Moult a0edd66b92 Fix #3050. Unlinking now gives you an option to delete as well. 2023-05-28 13:52:23 +10:00
Dion Moult c8c0c9a621 Fix #3169. Don't allow the user to create invalid material sets without items. 2023-05-27 22:50:59 +10:00
Dion Moult 00c010e04d See #3169. Fix bug where non walls and slabs didn't get semantic classes in drawings. 2023-05-27 21:32:13 +10:00
Andrej730 1d2c9780da Revision Clouds - new annotation type
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.
2023-05-27 15:22:07 +05:00
Dion Moult adec3853e8 Fix #3202. 2023-05-26 19:54:26 +10:00
Dion Moult d3251c5ca1 New get_shape_matrix utility. 2023-05-26 19:31:01 +10:00
Dion Moult 68f8d8798a Fix #3181. 2023-05-26 19:31:01 +10:00
Bruno Postle 4c793be5f7 BBIM Ensure LF end-of-line in Git repo (#3096)
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 ¯\_(ツ)_/¯
2023-05-26 08:28:20 +01:00
Andrej730 812eb5eaef Small documentation note 2023-05-25 16:09:43 +05:00
Andrej730 6c2be8f886 Procedurally generating list of props for shading styles to cover more props
If it will be too much we still have option to exclude some of them
2023-05-25 14:50:45 +05:00
Gorgious56 301d4fecf8 Remove the cryptic (and slightly annoying) console warning logs when trying to display the type manager when there is no element type in the file 2023-05-24 16:54:57 +02:00
Gorgious56 604dfa8cf4 Fix annoying tooltip when using the eyedropper to copy a type 2023-05-24 16:06:33 +02:00
Andrej730 8bb4ab91b8 Fixed problem with ifccsv set_element_key #3192
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.
2023-05-24 18:02:53 +05:00
Andrej730 0cdd9a0cde Window Modifier - support typing units in props
Example - https://i.imgur.com/C99RRs9.png
2023-05-24 17:41:10 +05:00
Andrej730 4768ea23e4 More descriptive exception for reassign_class #3192
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
2023-05-24 16:45:07 +05:00
Andrej730 659cbe69c3 Stair Modifier - support typing units in props
Example - https://i.imgur.com/XQsVge1.png
2023-05-24 16:45:07 +05:00
Andrej730 e22f4dd001 Array Modifier - support typing units in props
Example - https://i.imgur.com/a0r0vUs.png
Also accidentally fixed input_cursor_array not working properly for projects with non-meters units.
2023-05-24 16:45:07 +05:00
Andrej730 394b2003b3 Small error message on aggregating objects 2023-05-24 16:45:07 +05:00
Dion Moult d72ac7827b Fix #3193. Revert "partially addresses #3103."
This reverts commit 1b2ab4e3f0.
2023-05-24 21:31:41 +10:00
Dion Moult 610ec7d8ad Fix #3086. 2023-05-24 19:33:14 +10:00
Gorgious 8f41ae0c1b Using the eyedropper on a type automatically sets the type and validates assign_type. However it does display an annoying message saying the value was not set, I don't know how to get rid of it. 2023-05-24 11:10:35 +10:00
Gorgious f8113d4857 You can now eyedrop an object in the 3D viewport to fill in its class in the type selector 2023-05-24 11:10:35 +10:00
Gorgious 72169d06ad Fix Relating type enum not correctly initializing 2023-05-24 11:10:35 +10:00
Gorgious 2b78871c01 The type manager now switches to the type when clicking on the "select type" button. Duplicating a type also changes the active type in the type manager 2023-05-24 11:10:35 +10:00
Gorgious 1ce254cc9a Selecting types and instances now show a helpful tooltip when the object is not selectable (due to being hidden or in a hidden collection) 2023-05-24 11:10:35 +10:00
Gorgious 3b07c086a8 You can now duplicate a type from the properties panel
+ change the "paste" icon for the  "duplicate" icon
2023-05-24 11:10:35 +10:00
Gorgious ff7b101b71 "Select instances" button is now grayed out when the type doesn't have any instance 2023-05-24 11:10:35 +10:00
Bruno Postle 92405d819b BlenderBIM set gitattributes and autocrlf
Force Git to always treat IFC files as text.
Store IFC in Git with LF line-endings, but checked-out files are
CRLF on Windows.
2023-05-23 22:45:41 +01:00
Andrej730 c367989ebd Roof modifier - more descriptive errors on invalid footprints #3171 2023-05-23 18:46:27 +05:00
Andrej730 7cae099fb4 Default material layer thickness for adding new layers
Same as when you create IfcMaterialLayerSet
2023-05-23 16:20:06 +05:00
Andrej730 7dcccf9ea5 UI problem with creating empty material layer set causing issues #3169
Now it's also possible to select some material that will be used for they first layer of material layer set.
2023-05-23 15:59:15 +05:00
Ryan Schultz 535e974cc3 bulk assignment of objects to an aggregate. 2023-05-22 22:06:08 -05:00
Andrej730 629aff1e50 Added a descriptive error on attempt of deleting last material layer 2023-05-22 16:37:31 +05:00
Andrej730 628b6830db Fixed error loading .ifc and activating view for drawing with underlay 2023-05-22 15:47:28 +05:00
Ryan Schultz 1b2ab4e3f0 partially addresses #3103. 2023-05-21 15:07:08 -05:00
Sigma Dimensions f97752c368 fix contracting/expanding schedule of rates 2023-05-21 13:25:15 +01:00
Sigma Dimensions d2d5db9bf6 Fix selecting unassigned work/cost schedule products 2023-05-21 12:59:54 +01:00
Sigma Dimensions a8554d9e56 small fix for work schedule derived start/end dates 2023-05-21 12:52:05 +01:00
Sigma Dimensions 11a38af901 BBIMD: enable deleting sequence relationships from list of predecessors/successors 2023-05-21 12:48:34 +01:00
Sigma Dimensions 27a4976b9d remove annoying print statement 2023-05-21 12:45:28 +01:00
Sigma Dimensions eb54f5a0cb ios api task fix: remove orphan IfcRelNests when deleting tasks 2023-05-21 12:45:04 +01:00
Sigma Dimensions a4a6dce6de BBIM D: Copy cost items, export Cost Schedules individually, start improving Cost Schedule UI 2023-05-21 12:42:50 +01:00
Sigma Dimensions 4184e25c68 Easier grouping of materials by allowing material attributes editing from the IfcMaterial subpanel in the scene properties tab 2023-05-21 12:33:41 +01:00
Bruno Postle d98b0766c2 Allow missing/broken GitPython
`import git` can fail badly with a broken xcode installation, so
we let blenderbim run anyway
2023-05-21 09:11:26 +01:00
Bruno Postle b8990dd0a4 Fix merging of remote branches (#3096)
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.
2023-05-20 09:25:33 +01:00
Andrej730 2198201e0b Detect BBIM railings at import to import as meshes not curves #3144
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.
2023-05-19 17:33:45 +05:00
Andrej730 53e58848f3 Reset active drawing id if we removed the active drawing
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
```
2023-05-19 15:40:58 +05:00
Andrej730 9c367d1702 fixed neg values in format_distance & section/plan level #3175 2023-05-19 15:28:45 +05:00
Andrej730 db18a81035 Added default Model/Annotation/PLAN_VIEW to support e68fdb2db 2023-05-19 12:33:56 +05:00
Andrej730 d1d6b00f92 Test that drawing styles are loaded 2023-05-19 12:00:00 +05:00
Andrej730 32fc147a7c Fixed error on rebuilding sheet with underlays
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
```
2023-05-19 11:48:35 +05:00
Andrej730 d98054234c Update drawing styles on changing Underlay checkbox #3172 2023-05-19 10:52:52 +05:00
Ryan Schultz d6460026f2 allow elevations to show negative values
removed RL - not standard throughout the world
2023-05-18 22:38:12 -05:00
Bruno Postle 88ba6514e8 Git remote fetch and push operations (#3096) 2023-05-19 00:27:37 +01:00
Andrej730 894a688bd8 Added test scenario to reproduce #3169
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.
2023-05-18 18:36:07 +05:00
Andrej730 c69ead4893 Test to cover drawing maintaining sheet position #3155
Updated to gitignore to include some new folders that are created during tests
2023-05-18 17:30:04 +05:00
Andrej730 e68fdb2db7 3d annotations for FALL, SECTION_LEVEL, PLAN_LEVEL #3145
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.
2023-05-18 14:19:36 +05:00
Andrej730 ae9372c3d3 Maintaining drawing's sheet position on raster x/y changes #3155
Example - https://i.imgur.com/uiNWhIq.png
2023-05-17 19:23:42 +05:00
Andrej730 0365c6d43b More consistent PlanLevel and SectionLevel in viewport and svg
Now it's using first vert instead of last to calculate height (same way svgwriter does it)
2023-05-17 14:50:52 +05:00
Andrej730 18b6969221 Showing decorations on activating view #3146 2023-05-17 12:35:53 +05:00
Andrej730 a1935acb3d AngleDecorator - changed edges / arc colors
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
2023-05-17 12:20:08 +05:00
Andrej730 9548c5e657 Positioning AngleDecorator text at the center of the arc
Before - https://i.imgur.com/0VxFkg9.png
After - https://i.imgur.com/ibDnlbE.png
2023-05-17 11:52:14 +05:00
Andrej730 762299124f More smoothed lines for annotations with angles and circles 2023-05-17 11:32:01 +05:00
Andrej730 f682bf5688 Added some tests for changing ifc text 2023-05-17 11:18:24 +05:00
Andrej730 f7ed3a8727 Fixed bug with annotations update #3159
toggleDecorations was interrupted because it was trying to update text for non text element
2023-05-17 10:44:26 +05:00
Andrej730 c124506e41 Fixing bug with changing text size #3159
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.
2023-05-16 17:58:26 +05:00
Andrej730 273cdc6ea8 Fixed ifc text annotation preview not showing during edit #3159
Error was:

```
Traceback (most recent call last):
  File "\scripts\addons\blenderbim\bim\module\drawing\decoration.py", line 1899, in __call__
    decorator.decorate(context, obj)
  File "\scripts\addons\blenderbim\bim\module\drawing\decoration.py", line 1451, in decorate
    self.draw_text(context, obj)
  File "\scripts\addons\blenderbim\bim\module\drawing\decoration.py", line 540, in draw_text
    symbol = text_data["Symbol"]
KeyError: 'Symbol'
```
2023-05-16 16:53:38 +05:00
Andrej730 0ef6ea6bd4 Schedule Builder - some naive support for font size in text #3154 2023-05-16 16:43:39 +05:00
Andrej730 607d9a06ec Schedule Builder - support for bold and italic text in cells #3154 2023-05-16 16:31:26 +05:00
Andrej730 1b472ca5f2 Schedule builder - fixing cell alignment #3154
Noticed that it's actually not merging cell style with col style as I did before but just prioritizing cell style if it's defined
2023-05-16 15:24:39 +05:00
Andrej730 18568d6ba7 Schedule cells limit without print range to prevent system freeze
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.
2023-05-16 15:16:48 +05:00
Andrej730 bfb59dd387 Scheduler builder enhancements #3154
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
2023-05-16 14:44:45 +05:00
Andrej730 38cf88d5d2 Saving drawing shading styles to ifc #2991
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.
2023-05-15 16:43:56 +05:00
Bruno Postle 7ca6f9d7a1 BlenderBIM Git clone repository operator (#3096) 2023-05-14 21:10:53 +01:00
Gorgious 5874508263 use tool module instead of local function to activate object 2023-05-13 19:57:52 +02:00
Bruno Postle 954de793dd BlenderBIM Git tagging documentation 2023-05-13 10:37:29 +01:00
Bruno Postle df74d5efbe BlenderBIM list and create git tags #3096 2023-05-13 09:57:10 +01:00
Andrej730 f7b9a7bfb5 Multiline in dimension description / suffix / prefix #3005
Also added some offset for dimension text in viewport to make it more similar to svg
2023-05-12 14:54:22 +05:00
Thomas Krijnen 63eaa88d3d #3139 Capture parsed selected simple type values 2023-05-12 10:19:15 +02:00
Andrej730 f518521ea1 Option to add prefix and suffix to dimension annotation #3005
Example - https://imgur.com/a/0NkStWm
2023-05-11 17:38:48 +05:00
Andrej730 5e1ee22bcd Ifc CSV Export template now also saves the expression #3034
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"]}`
2023-05-11 14:18:51 +05:00
Andrej730 ca09ff2ef0 Not all curve annotation types were detected at the import #3090 2023-05-11 10:54:27 +05:00
Bruno Postle 8643aff800 Merge branch 'v0.7.0' of github.com:IfcOpenShell/IfcOpenShell into v0.7.0 2023-05-10 22:53:00 +01:00
Gorgious 2e88993654 Fix #3128 : RefLatitude and RefLongitude attributes now show their description on right click + add a snippet to tell the user how to format the values 2023-05-10 22:51:30 +01:00
Bruno Postle b77849d279 Report ifcmerge conflicts in pop-up #3096 2023-05-10 22:45:22 +01:00
Gorgious c7e288466f Fix #3128 : RefLatitude and RefLongitude attributes now show their description on right click + add a snippet to tell the user how to format the values 2023-05-10 21:31:19 +02:00
Kristoffer Andersen bb48d4aac1 Update meta.yaml
pin daily conda builds to occt 7.7.0
2023-05-10 20:43:22 +02:00
Gorgious56 2b99cc1e58 Fix typo in get_pset docstring 2023-05-10 16:41:19 +02:00
Andrej730 ca286f8d19 Migrating shaders to builtins to support M1 #2897
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).
2023-05-10 18:19:00 +05:00
Bruno Perdigão 73a3cc2cc5 changed custom scale input 2023-05-10 09:11:09 +10:00
Bruno Postle 169709ed04 Selecting a git revision updates info box 2023-05-09 22:15:57 +01:00
Sigma Dimensions 2e746242ce Fix task json issue due to "Bad control character in string literal in JSON at position XXXX" 2023-05-09 15:43:12 +01:00
Sigma Dimensions 951b8e2b15 Convenient Pie Menu shortcut to aggregate selected objects to active object 2023-05-09 14:24:31 +01:00
Sigma Dimensions ede3edcf1e fix toggle_cost_item_parent 2023-05-09 13:25:21 +01:00
Sigma Dimensions 184c9f87b2 Fix baseline gantt chart bug when new tasks are added to the planned schedule 2023-05-09 13:03:57 +01:00
Dion Moult 0793a4602d Minor improvements to shape utility. 2023-05-09 20:51:08 +10:00
Dion Moult bb285c47dc See #2673. Bundle IfcTester for PyPI. 2023-05-09 20:49:08 +10:00
arun 4cb6fc05d6 corrected get_extrusions function 2023-05-08 20:18:57 +02:00
Kristoffer Andersen a302e5db64 add zlib to conda build dependency
zlib is now longer indirectly included from the vtk package now that we have a new occt variant novtk that does not depend on vtk
2023-05-08 14:12:03 +02:00
Bruno Postle ff21749da4 Merge branch 'v0.7.0' of github.com:IfcOpenShell/IfcOpenShell into v0.7.0 2023-05-07 13:12:22 +01:00
Bruno Postle 23b5da7670 BlenderBIM ifc file association (linux only) #2399 2023-05-07 13:08:28 +01:00
Bruno Postle c31e479f47 Rename blenderbim.sh, better initialisation #2399 2023-05-07 09:46:15 +01:00
Dion Moult 260eb31a69 Add shape utility to easily get profiles and extrusions 2023-05-07 17:32:46 +10:00
Dion Moult 1fb6dac6fb Fix failing tests in preparation for release. 2023-05-06 11:05:13 +10:00
Dion Moult 34d947c51f Fix #3084. Issue where drawings with no elements couldn't be generated. 2023-05-06 11:02:41 +10:00
Sigma Dimensions 23f7a6d5a6 fix test-related sequence bug
Fix baseline gantt chart bug
2023-05-06 00:21:57 +01:00
Sigma Dimensions b15926c20a Fix baseline gantt chart bug when new tasks are added to the planned schedule 2023-05-05 23:43:27 +01:00
Sigma Dimensions 0a7ef80ca7 BBIM4D: Enable filtering by active work schedule when retrieve tasks related to objects 2023-05-05 18:26:32 +01:00
Sigma Dimensions be08406cc1 Auto-refresh task sorting 2023-05-05 17:11:24 +01:00
Bruno Postle cc9777b1e8 Basic user documentation for BlenderBIM Git functionality (#3096) 2023-05-04 23:53:37 +01:00
Dion Moult 539b3a243b Fix fundamental bug where area and volume units were ignored on new projects. 2023-05-04 21:43:48 +10:00
Andrej730 41e58a3d46 Small addition to 8c302ed85 2023-05-04 16:00:12 +05:00
Andrej730 8c302ed85c Changed x_angle subtype to degrees
Now BIMModelProperties.x_angle stores data in radians internally but for user it still appears as degrees
2023-05-04 15:53:29 +05:00
Dion Moult dc4dc46b62 See #1676. Fix space boundary generation for IFC4 RV where openings are already subtracted from the body. 2023-05-04 20:22:29 +10:00
Dion Moult a07fa5a2c2 Accommodate invalid named units when loading IFCs. 2023-05-04 19:55:54 +10:00
Dion Moult ad9dbce003 See #3085. Don't bundle numpy as Blender already has it and it causes conflicts. 2023-05-04 19:45:04 +10:00
Andrej730 d0526d0ae5 Updating BIM Tools props on active object change #3102
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.
2023-05-04 12:55:40 +05:00
Andrej730 75e9c3265d Fallback to abs path adding schedule rel path is not available #3106 2023-05-04 11:32:05 +05:00
Andrej730 b37705ab6e Updating drawing's size on sheet to match it's scale #2965 2023-05-04 11:25:16 +05:00
Massimo Fabbro d9d5f86a6e Now it's possible to regenerate a space that it was created automatically from walls 2023-05-04 11:37:42 +10:00
Sigma Dimensions 1f3ad95c00 remove annoying print statement, run black on cost 2023-05-03 19:46:15 +01:00
Sigma Dimensions 9e360f7efa remove annoying print statement, run black on cost 2023-05-03 19:45:01 +01:00
Sigma Dimensions 64fd6a1f52 fix copying relationships when duplicating tasks 2023-05-03 19:43:05 +01:00
Sigma Dimensions ba04df4ce3 BBIM 4D: implement human readable duration to read/edit durations.
new IOS Fuzzy Duration Parsing utility
2023-05-03 16:09:27 +01:00
Sigma Dimensions cd27a026fd fix editing null task duration values #3091 2023-05-03 16:01:58 +01:00
Dion Moult baedf71106 Minor documentation update to describe how add-ons with conflicting deps / hotkeys are incompatible. 2023-05-04 00:31:44 +10:00
Dion Moult 4f6c95b119 See #1676. Space boundary generation now accounts for voids and fills. 2023-05-04 00:31:24 +10:00
Dion Moult b1761ac393 See #1676. Space boundaries default to physical internal boundaries. 2023-05-03 21:21:55 +10:00
Dion Moult fcdf3e583f See #1676. You can now set the type of boundary class prior to generating boundaries. 2023-05-03 21:03:54 +10:00
Andrej730 2001119dff A bit more intuitive adding drawing/schedule to the sheet
Now it will detect currently active sheet even if you have sheet's drawing/titleblock/schedule selected.
2023-05-03 15:39:53 +05:00
Dion Moult 60a9d96ac8 See #1676. You can now duplicate space boundaries. 2023-05-03 20:38:09 +10:00
Andrej730 6bd177d250 Annotation Tool - always show "Add type" button
It wasn't showing if you had some objects selected which seems a bit counterintuitive - the need to deselect everything to create a new type.
2023-05-03 15:00:58 +05:00
Andrej730 1ece84e31d Fixed error during building schedule from ods
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.
2023-05-03 14:55:45 +05:00
Andrej730 40ea9457a8 Apply scale and rotation to ifc text symbols #3094
Before symbols attached to ifc text were not rotated / scaled if they didn't have "text-template" fields in them.
2023-05-03 14:39:43 +05:00
Andrej730 e95d91a91e Support multiline text in the schedule #3010
Before - https://i.imgur.com/gff5jo3.png
After - https://i.imgur.com/meyXBYb.png
2023-05-03 12:33:07 +05:00
Andrej730 c8fb92175f Added some (naive) text wrapping in the schedule #3010
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).
2023-05-03 12:25:08 +05:00
Sigma Dimensions a6fb4cbfbf BBIM 4D: Enable displaying task tooltip in the gantt chart & add resource columns 2023-05-03 04:34:55 +01:00
Sigma Dimensions 30bb6d05c5 BBIM 4D: You can now visualize & print work schedule baselines with Gantt Charts 2023-05-03 04:33:16 +01:00
Sigma Dimensions 9422f804fb minor fix 2023-05-03 04:22:02 +01:00
Sigma Dimensions 415a7746be BBIM 4D Gantt: Support multiple languages, human readable durations, add convenient Print Function with different Sheet Formats,
start improving overall page style; refactor code to split js and css code away from mustache file
2023-05-02 17:27:47 +01:00
Andrej730 ee903208dc Small fix for text alignment in scheduler 2023-05-02 17:41:56 +05:00
Dion Moult f89e834fea Fix #3085. Prioritise shipped BlenderBIM Add-on packages instead of system packages to avoid dependency clashes. 2023-05-02 22:20:34 +10:00
Dion Moult e8b4335741 Minor UI cleanup. Remove align buttons from architectural tool panel. 2023-05-02 22:20:34 +10:00
Dion Moult 83010f0542 See #1676. You can now add basic space boundaries with the BIM Tool with Shift-B, either by selecting both a space and an element (e.g. wall) or selecting a space and placing the 3D cursor on a face. 2023-05-02 22:20:34 +10:00
Dion Moult 04e5f5036c See #1676. Deleting space boundaries now also removes connection geometry. 2023-05-02 22:20:34 +10:00
Andrej730 5d86d38a14 Support cells text alignment building schedule from ods #2885
Before - https://i.imgur.com/9QZ2YW2.png
After - https://i.imgur.com/M7ZHSJq.png
2023-05-02 17:04:48 +05:00
Andrej730 a82db1f622 Support merged columns building schedule from ods #2885
Before - https://i.imgur.com/p1l6ugn.png
After - https://i.imgur.com/9QZ2YW2.png
2023-05-02 16:24:30 +05:00
Andrej730 fb618d536b Keep rows height building svg schedule from ods #2885
Before - https://i.imgur.com/erMH4Ku.png
After - https://i.imgur.com/p1l6ugn.png
2023-05-02 14:56:05 +05:00
Andrej730 23f96779fa More safe adding roof modifier #3080 2023-05-02 10:38:25 +05:00
Dion Moult 7b67854654 Fix #3088. Prioritise body curves to be loaded before trying to load 2D annotations. 2023-05-02 13:11:01 +10:00
Sigma Dimensions 2e7f941465 BBIM 4D: Auto Update Resource Usage from resource tree 2023-05-02 02:47:22 +01:00
Sigma Dimensions 1c1706fde3 BBIM feature to create & view work schedule baselines 2023-05-02 02:43:54 +01:00
Sigma Dimensions ca77a895e0 IOS.API consider removing baseline tasks when deleting tasks 2023-05-02 02:31:48 +01:00
Sigma Dimensions 0f447f964e IOS.API usecase to create a work schedule baseline 2023-05-02 02:30:38 +01:00
Sigma Dimensions 2c31fc6b25 run black 2023-05-02 02:27:32 +01:00
Dion Moult 0ba79dc105 Accommodate space boundaries with no connection geometry, fetch spatial structure for IFC2X3, and fix scale bug when editing boundary profiles. 2023-05-02 10:23:54 +10:00
dependabot[bot] 52c686b656 Bump flask from 2.0.1 to 2.3.2 in /src/opencdeserver
Bumps [flask](https://github.com/pallets/flask) from 2.0.1 to 2.3.2.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/2.0.1...2.3.2)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-02 10:06:31 +10:00
Thomas Krijnen 64d98f1295 #2676 2023-05-01 20:16:39 +02:00
Andrej730 ceb2c4075c Option to scale symbol from ifc tag by scaling ifc text object #2946
Also added some text scaling in viewport if there is some symbol associated with text annotation to roughly visually indicate how big this thing is going to be in the svg.

Example - https://user-images.githubusercontent.com/9417531/235445393-447f3aba-8425-4da6-81d0-6bf9004fcf2b.mp4
2023-05-01 16:25:04 +05:00
Andrej730 166e7d52ec Keep text rotation for text annotation with symbols #2946 2023-05-01 16:25:04 +05:00
Dion Moult 644c2652ea See #1676. You can now toggle boundaries on or off in the BIM tool via Alt-B, with a special boundary decorator. 2023-05-01 21:19:29 +10:00
Andrej730 63b201fd95 Test command to load blend file during test scenario for debugging 2023-05-01 15:35:27 +05:00
Andrej730 d70616056c Moving decorators colors from scene to addon props #3033 2023-05-01 14:54:47 +05:00
Dion Moult a65e376886 See #1676. Tab now toggles space boundary surface profile editing. 2023-05-01 19:40:49 +10:00
Andrej730 a985c70f0c Fixed error on adding Roof modifier to non-footprint objects #3080 2023-05-01 14:03:28 +05:00
Andrej730 0d09e02e7e Fixed bug with double conversion of height/extrusion length #3073
Also fixed some tests
2023-05-01 13:46:24 +05:00
Thomas Krijnen 23e3551f27 Fix regex escape in rule_executor.py 2023-04-30 19:09:43 +02:00
Shohei Kunimatsu 885bca0865 Fix wrong attribute name usage (ValueComponent -> UnitComponent) in IfcFile::getUnit 2023-04-30 19:06:58 +02:00
Sigma Dimensions 0f874dad51 BBIM 4D features & fixes:
- feature to re-order tasks
- fixes for task sorting
- further workSchedule UI/UX improvements
- forgotten bits and bobs
2023-04-30 15:44:13 +01:00
Sigma Dimensions 107873cf6e - refactor IOS.API resource calculation to re-use shared utilities
- run black
2023-04-30 15:35:17 +01:00
Sigma Dimensions 4a8f5af7ba - BBIM 4D: features to review and edit Resource productivity data on the fly
- IOS: new resource utilitiy functions
2023-04-30 15:31:36 +01:00
Dion Moult 83084aeb7b Add profile-style (like slab editing) enable editing, edit, and disable editing operators for energy boundary surface geometry. 2023-04-30 20:57:51 +10:00
Dion Moult 51640ccc28 Fix #3030. Don't bother layerset slicing walls with a single layer. 2023-04-30 13:43:43 +10:00
Dion Moult aefbc134ea Cut merging now only applies to particular elements for the majority of cases. Drawing generation can be twice as fast due to this. 2023-04-30 13:43:43 +10:00
Massimo Fabbro 29e1d70334 Generate space from walls refactor and cleaning around 2023-04-29 22:33:19 +02:00
Massimo Fabbro 9118e529e6 Add generate space button in UI in N-Panel -> BlenderBim -> Architectural 2023-04-29 22:33:19 +02:00
Massimo Fabbro 8ee0a1611d Now it's possible to create spaces automatically from selected walls 2023-04-29 22:33:19 +02:00
Sigma Dimensions 2af4388f40 Fix duplicate task logic in IOS.API 2023-04-29 13:53:04 +01:00
Dion Moult 93a2d18ea6 Filter elements visible in the camera view. Drawing generation is now significantly faster on larger projects (e.g. 24s down to 10s for a portion of the Revit sample project) 2023-04-29 16:33:44 +10:00
Dion Moult fc49859ea4 Fallback to unmerged polygons if merging fails. More investigation needed. 2023-04-29 16:30:40 +10:00
Dion Moult c0ac9cb380 Viewport layerset slicing now uses a cache for speed. 2023-04-28 22:46:49 +10:00
Andrej730 d5cc6c3c8e Fixed double conversion in bim tool props after b4b6404
No more 1000000 and 3000000 mm values
2023-04-28 17:32:19 +05:00
Andrej730 9b22b5000f Added support for different railing cap types
Very similar to this - https://i.imgur.com/SNyvfgh.png
2023-04-28 17:24:41 +05:00
Dion Moult 3b69a4cc78 Fix bug where numerical tolerance caused certain objects to be unnecessarily updated. 2023-04-28 22:15:09 +10:00
Dion Moult adf54efcc5 Fix bug in cut decorator layersets where walls could be joined to odd non-layered things. 2023-04-28 22:14:26 +10:00
Dion Moult f6962eb58e Fix #3053. Bug where very thin meshes (<1mm) couldn't be reverse engineered into extrusions. 2023-04-28 21:05:13 +10:00
Andrej730 11601d6532 Fixed bug with wrong position of support in wall mounted railing
The problem was that that support's disk was not rotated according to the railing path.
2023-04-28 11:43:15 +05:00
Sigma Dimensions be2131d62c BBIM 4D: Auto-refresh task re-ordering 2023-04-27 13:58:08 +01:00
Dion Moult 3ffbf46ac2 Fix #3066. Regression crash when deleting openings. 2023-04-27 22:24:12 +10:00
Sigma Dimensions 3943107eec forgotten core functions & run black 2023-04-27 13:05:51 +01:00
Sigma Dimensions 94e3f75341 Sequence Tools clean-up 2023-04-27 13:03:32 +01:00
Sigma Dimensions 8bc8b950e7 BBIM 4D: Features to select a Work Schedule's assigned / unassigned products 2023-04-27 12:55:31 +01:00
Sigma Dimensions 05a95ac666 Work Schedule Panel UX improvement 2023-04-27 12:53:27 +01:00
Sigma Dimensions f016c803e4 Fix schedule task sorting 2023-04-27 12:49:27 +01:00
Dion Moult bac0dd37fa Fix #3052. Deep deletion of large geometries is now thousands of times faster. 2023-04-27 20:15:17 +10:00
Bruno Postle 75a37cf737 Fix crash when switching between git revisions 2023-04-26 23:50:36 +01:00
Bruno Postle bb7e9c4610 Fix check for invalid Git branch name 2023-04-26 22:25:27 +01:00
Andrej730 ee2f18349f WALL_MOUNTED_HANDRAIL type for Railing modifier
Added WALL_MOUNTED_HANDRAIL type for railing modifier. It's still a bit work in progress - still need to add support for different railing termination types.

Here's the short demonstration - https://user-images.githubusercontent.com/9417531/234582621-6c6f948b-9cdc-4be6-b380-17ddbf5803bf.mp4
2023-04-26 18:04:39 +05:00
Dion Moult 8829a3cbe9 See #1227. Minor fix. 2023-04-26 22:24:37 +10:00
Dion Moult b210e39c7e See #1227. Experimental viewport layerset visualisation. 2023-04-26 22:10:34 +10:00
Bruno Postle 4d4500f061 Fix some refresh glitches in IFC Git panel 2023-04-26 00:07:22 +01:00
Thomas Krijnen 79860a0c04 Fix iterator::get() invalid cast on nullptr 2023-04-25 21:00:01 +02:00
Bruno Postle d53fcdc616 Format ifcgit code with black 2023-04-25 07:30:35 +01:00
Dion Moult 5e6a094ac6 Fix #3046. Renaming drawings now updates all drawing references on sheets. 2023-04-24 22:41:38 +10:00
Andrej730 757bf4e916 Fixing error on using bim.override_mode_set_edit with no active object
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'
2023-04-24 11:17:08 +05:00
Andrej730 7bb57b3ab9 Fixed blurred text with background after bfbced3
before commit - https://user-images.githubusercontent.com/9417531/233907917-f86ad10b-0227-4180-9488-a8b71a00f099.png
after commit https://user-images.githubusercontent.com/9417531/233907920-d100c73a-e206-42fd-bb41-f7257ea6f98c.png

Tested it on firefox too
2023-04-24 10:33:38 +05:00
Dion Moult cb22b5804d Fix #3055. Get paths using forward slashes for platform compatibility. 2023-04-24 13:11:42 +10:00
Dion Moult bfbced3859 Fix #3051. Text background filter now applied on <text> element to make it work on Firefox. 2023-04-24 12:58:36 +10:00
Dion Moult c090ee9b83 Fix #3040. View title template variables now have access to sheet attributes prefixed with "Sheet". 2023-04-23 22:04:49 +10:00
Dion Moult b6caf069d0 Fix #3001. User can now specify join criteria in drawings. Only elements where all the criteria have the same values are merged. 2023-04-23 21:32:00 +10:00
Dion Moult 5b4449eea0 Fix #3054. Edit sheet is now implemented for drawings, schedules, and titleblocks. 2023-04-23 17:49:51 +10:00
Bruno Postle 7dc17a3653 Include git, gitdb and smmp libs in blenderbim zip 2023-04-23 08:35:39 +01:00
Bruno Postle 598bf799de Install GitPython *before* removing the working folder 2023-04-23 08:12:49 +01:00
Bruno Postle 4774a37d48 Add GitPython dependency 2023-04-23 08:03:19 +01:00
Dion Moult d9a1e6f4b1 New default patterns for stack and stretcher bond tiles and floorboards. 2023-04-23 12:44:35 +10:00
Bruno Perdigão 72dae8e9ad applyed the patch by Bruno Postle 2023-04-23 12:05:57 +10:00
Bruno Perdigão b2d7fb9443 changed imports to integrate with blenderbim 2023-04-23 12:05:57 +10:00
Bruno Perdigão bf945e36bd initial commit 2023-04-23 12:05:57 +10:00
Dion Moult 2bcfe93dd2 See #3002. Spaces are now managed separately so that they don't conflict with projection polygon merging and raycasting. 2023-04-22 23:59:33 +10:00
Dion Moult 195ef743c6 See #3002. Experimental SVGFill approach to polygon merging. 2023-04-22 13:05:42 +10:00
Thomas Krijnen 8478eb9aa0 Update draw.py 2023-04-21 16:29:04 +02:00
Andrej730 47f57d20cd Fixed couple bugs in furniture library
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)
2023-04-21 18:24:32 +05:00
Dion Moult 8f8eb06d6b See #3002. Experimental shapely approach to polygon merging for semantic projection elements. 2023-04-21 22:33:08 +10:00
Andrej730 7d6803f325 Roof modifier - remove redundant context fill causing visual artifacts 2023-04-21 16:49:44 +05:00
Andrej730 f9b7a8b92b Roof modifier - removing bottom chord if angle = 90 degrees
This - https://i.imgur.com/75AmYGI.png
instead of https://community.osarch.org/uploads/editor/yp/zcaqxx9b33wu.png
2023-04-21 16:49:44 +05:00
Andrej730 7ee0c047e5 Roof Modifier - separating vertices on defining gable roof angle
Added option (which is activated by default) - when you set gable roof angle for some edge it will duplicate the top vertex instead of just moving which allows you to do shape like this - https://imgur.com/a/OEFZ4pw

Previously you would get something like this in that case - https://community.osarch.org/uploads/editor/ap/hlt70rbw5r1l.png
2023-04-21 16:49:44 +05:00
Andrej730 bfbfe17644 OverrideDelete - remove objects with X if they are not related to ifc
It was a bit frustraiting when you added a cube and can't just get rid of it with X hotkey 😅
2023-04-20 17:15:17 +05:00
Andrej730 046940f949 Fixed error in disabling text exiting after deleting text literal 2023-04-20 14:27:37 +05:00
Dion Moult 2950ddcf4f Fix validation error where IfcURIReference cannot be used as a property data type :( 2023-04-20 18:06:35 +10:00
Dion Moult 3d441b4ad3 Fix #3038. Fix #3039. Selector should default to none instead for throwing errors if the query doesn't have a result. 2023-04-20 17:41:52 +10:00
Dion Moult caa5e8983b Fix #3021. IfcSpatialElements are included in drawings by default. 2023-04-20 17:34:24 +10:00
Andrej 59b7944d8e Merge pull request #3032 from IfcOpenShell/quantities_project_units
Converting quantities to project units to fix #3025
2023-04-20 11:03:12 +05:00
Andrej730 648eb8fdd1 Converting to project units inside QtoCalculator.guess_quantity
Also added some error message if `calculate_quantity` failed to calculate a quantity
2023-04-20 11:01:38 +05:00
Andrej730 f160516772 tool.Qto.convert_to_project_units 2023-04-20 10:32:36 +05:00
Andrej730 4beb7780f8 bim.calculate_quantity - remove convertion part
now the convertion already happens in QtoCalculator.calculate_quantity
2023-04-20 10:32:24 +05:00
Kristoffer Andersen d44b6d40e9 pin lief version for conda build 2023-04-20 06:48:44 +02:00
Kristoffer Andersen 8fd9f5a8cb Add conda to conda daily build trigger path 2023-04-20 06:43:31 +02:00
Kristoffer Andersen 414af2f55e Change conda lief version 2023-04-20 06:40:44 +02:00
Kristoffer Andersen 8624be6bcf Fix conda env 2023-04-20 06:36:10 +02:00
Andrej730 4aa26b613b test_qto.py black format 2023-04-19 19:05:11 +05:00
Andrej730 57cb062d48 Tests for calculating quantities for prefix and imperial project units 2023-04-19 19:04:05 +05:00
Andrej730 b4b6404b65 Added DISTANCE subtype to BIM Tool Extrusion Depth and Length
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'.
2023-04-19 18:03:26 +05:00
Andrej730 989dd2be50 qto_calculator.py black format 2023-04-19 17:04:15 +05:00
Andrej730 50b8baddec Update QtoCalculator to convert to project units at the end
Before this commit it was calculating all values in meters not taking into account actual project units.
2023-04-19 17:03:32 +05:00
Andrej730 2e00c3db0b Update viewport on bim.activate_model
To see the changed context right away in the viewport
2023-04-19 12:12:11 +05:00
Andrej730 232260787e Fixed bug with wrong text value in viewport on canceling text editing
Actual text was replacing with "TEXT" default value if you cancel text editing instead of applying changes
2023-04-19 11:37:10 +05:00
Andrej730 54054c4aee Fixed bug in get_object_bounding_box #3023 2023-04-19 11:27:45 +05:00
arun 1a7843a6b5 Nesting added to util.get_decomposition function 2023-04-19 15:46:51 +10:00
Sigma Dimensions ed4ba4d0d3 fix "cost_item quantity updates" bug when editing a QTO 2023-04-19 01:01:44 +00:00
htlcnn 849d6118d0 fix EditBcfTopic and EditBcfTopicName 2023-04-19 09:23:50 +10:00
Andrej730 364138d408 CutDecorator color connected to preferences too #2987 2023-04-18 18:13:04 +05:00
Dion Moult 32c8da06ca New default triangle, hexagon, capsule, circle, and space tag symbols 2023-04-18 22:32:09 +10:00
Andrej730 2df4c5825f Added some decorator colors to addon preferences #2987
For ProfileDecorator (editing profiles, roof preview) and DecorationsHandler (openings).
Still need to add CutDecorator colors to preferences
2023-04-18 17:29:07 +05:00
Andrej730 527cbc3ae0 Some descriptions for EPset_Drawing 2023-04-18 16:59:07 +05:00
Andrej730 4fee8744d6 Fixed text annotation rotation in viewport #3017
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.
2023-04-18 16:59:07 +05:00
Thomas Krijnen 8f8862d23d get_mappeditem_transformation() 2023-04-18 13:17:20 +02:00
Thomas Krijnen 836f36fd8e Add util.placement.get_cartesiantransformationoperator3d() 2023-04-18 13:15:13 +02:00
Thomas Krijnen a1326cb5ed Normalize vectors in a2p() 2023-04-18 13:13:29 +02:00
Vukas Pajic 4bfda8851c Update failure reason #3018 2023-04-18 13:12:24 +02:00
Andrej730 f02f15cbfb unsuppress zero inches in formatting distance #3011
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
2023-04-18 14:17:40 +05:00
Dion Moult 30182684d5 Fix bug where you could save geometry with no data (no vertices / splines) which is invalid. 2023-04-18 18:10:01 +10:00
Dion Moult 7df80af30b Fix #2913. Bug where properties with multiple inverses were not correctly purged. 2023-04-18 18:08:24 +10:00
Dion Moult 6b2e867107 Fix #2916. Bug where joining swept solids didn't merge styles correctly. 2023-04-18 18:07:44 +10:00
Vukas Pajic d333090b09 cleanup 2023-04-18 09:17:23 +10:00
Vukas Pajic 8ae7763ac5 added new tests for case where spec has no requirements 2023-04-18 09:17:23 +10:00
Andrej730 51ac86be79 Fixed bug in bim.select_assigned_product
It was trying to call method `Drawingcls.get_active_object()` that didn't exist
2023-04-17 14:47:11 +05:00
Andrej730 552078c8a2 TEXT_LEADERS BoxAlignment, FontSize, multiline in viewport preview #3008
Moved code for drawing text in viewport to a separate reusable method `draw_text` in BaseDecorator.
2023-04-17 11:21:07 +05:00
Dion Moult 4b4ede733f Add support for loading IfcProxy 2023-04-17 10:37:30 +10:00
Dion Moult d07e8bc747 Add support for editing ref latitude/longitude 2023-04-17 10:14:22 +10:00
Massimo Fabbro 8850d78e5a Small fix 2023-04-17 09:25:21 +10:00
Massimo Fabbro 4fbf4e7d42 Now it's possible to specify the digits number in a drawing. Fix #2993 2023-04-17 09:25:21 +10:00
Ryan Schultz d6e1a670b9 Library - changed to correct class 2023-04-17 09:24:35 +10:00
Dion Moult 1a32c8827e Fix #3003. 2023-04-17 09:11:33 +10:00
Dion Moult 784b5156df Fix #2975. Fix bug where imperial projects still created drawings with metric scales by default. 2023-04-16 23:18:22 +10:00
Dion Moult 6e3336afb1 See #2975. Fix bug where custom scales were not loaded correctly. 2023-04-16 23:17:56 +10:00
Dion Moult d0ddee3623 Fix bug where changing object visibility didn't first check for view layer existence. 2023-04-16 21:50:58 +10:00
Ryan Schultz 9cf55033d4 Fix #2989 2023-04-16 08:05:05 +10:00
Dion Moult 7371efde17 Fix #2980. Minor cleanup to polish array panel UI. 2023-04-15 16:01:50 +10:00
Dion Moult 156269a53f Fix #2988. Imperial dimensions in viewport are now split between feet and inches. 2023-04-15 15:33:01 +10:00
Ryan Schultz ed7e5fb482 Fix #2990 2023-04-14 15:57:36 -05:00
Andrej730 2e973a4591 Fixed bugs with furniture library toilets and basins #2976
Bug was introduced in cf6acd5 when `shape_builder.get_rectangle_coords` started returning coords in counter-clockwise order instead of clockwise.
2023-04-14 19:07:38 +05:00
Andrej730 f1bd82d301 Dimension description in viewport/option to hide the measurements #2918
same thing for diameter annotations since they are just reusing dimension annotations

+ some refactor along the way
2023-04-14 17:52:54 +05:00
Dion Moult f51bfa314d Fix #2986. Reimplement Metadata property of EPset_Drawing to include arbitrary metadata as CSS classes. 2023-04-14 20:24:02 +10:00
Dion Moult 7b3410c7b1 Fix #2985. Purge obsolete vector style feature. 2023-04-14 20:04:33 +10:00
Dion Moult 6b0e7d51b1 Fix #2979. Batch drawling unselected and selected cut lines. 2023-04-14 18:24:01 +10:00
Andrej730 4e5659efad Annotation Tool
Added Annotation Tool that allows you create annotation types and their occurences. It will also allow us to get rid of "Annotation" panel in N-panel.

I've recorded bunch of short videos to demonstrate the features:

- bulk tagging - currently works only for "Text" and "Stair arrow" type of annotations, adds annotations to all selected objects, automatically assigns products to the annotations
https://user-images.githubusercontent.com/9417531/231968358-28cbb762-3349-470a-beef-d1ab21882769.mp4

- creating annotation type with representation - all occurences will share the same representation which makes bulk tagging really powerful if you use variables like {{PredefinedType}}, {{GlobalId}}, {{Name}}, {{Description}}, {{ObjectType}}, {{Tag}}

https://user-images.githubusercontent.com/9417531/231970500-333514c6-6406-4ef5-a9e7-fddfcc9a2436.mp4

- creating annotation type without representation - it allows occurences to have unique text or line geometry but still share the same classes from inherited property set

Examples:
  creating text type without representation to create title case annotations
  https://user-images.githubusercontent.com/9417531/231969361-bda5f924-a8c8-4f5a-ba61-461aa7101f73.mp4

  creating type for oblique dimension annotations
  https://user-images.githubusercontent.com/9417531/231969902-38e8c3f4-45a6-4c98-bba4-2956288ce10a.mp4

- readjusting - if you created some annotations using bulk tagging but the products were changed / moved afterwards now you can select those annotations and "readjust" them according to new product's position / measurements
https://user-images.githubusercontent.com/9417531/231968975-ee8d6589-60ee-4575-9be2-b0ce68d43ffa.mp4

PS In this commit I've also moved all icons to 1 .blend file and added instructions how to regenerate them.
2023-04-14 12:40:53 +05:00
Dion Moult 66f10adde8 Fix #2980. Array deletion now uses delete tool. Delete moved into tool so it can be used by other functions. 2023-04-14 09:56:55 +10:00
Dion Moult 459c4d7fcc See #2978. Fix crash upon drawing deletion. 2023-04-14 09:36:51 +10:00
Dion Moult 03d9efb790 Fix #2955. Drawings can now set a precision. 2023-04-13 22:20:18 +10:00
Dion Moult 33bd6099ee Fix #2971. Only update placement if object actually moved. 2023-04-13 21:56:32 +10:00
Dion Moult 850a1d326b Purge old code from timer-based type browser system 2023-04-13 21:39:54 +10:00
Thomas Krijnen f0bb19d48d Fixes to validation of selected simple type / enum 2023-04-13 13:16:48 +02:00
Dion Moult a56eac0131 Minor fix 2023-04-13 18:48:20 +10:00
Dion Moult d3201809ab Fix #2968. Deletions are no longer postponed. Should fix or reveal a lot of sync errors. 2023-04-13 18:38:28 +10:00
Dion Moult 3628a0e241 Fix bug where switching representations didn't update the material checksum, leading to unnecessary material syncs at export time. 2023-04-13 18:15:28 +10:00
Dion Moult 07badd3df5 Styles are applied per mesh data now (potentially dangerous). Fix crash when switching to representation which has styles from an unstyled mesh. 2023-04-13 16:10:00 +10:00
Dion Moult f63091ce05 Fix #2974. Type property sets are now properly copied. 2023-04-13 14:08:02 +10:00
Dion Moult 617b2978c0 New activate model operator to switch back to a MODEL_VIEW target view subcontext 2023-04-12 21:27:43 +10:00
Dion Moult 364e96ad1e Activating a drawing now automatically switches to the preferred target view representation of all elements 2023-04-12 21:27:43 +10:00
Dion Moult 9170e5ca65 New "cut decorator" that draws cut lines in drawings. 2023-04-12 21:27:43 +10:00
Dion Moult cbe71f221c Only activate drawing styles if underlay enabled, and default to default Blender styles to prevent confusion 2023-04-12 21:27:43 +10:00
Dion Moult c039c01407 Regenerating fills now maintains the active representation 2023-04-12 21:27:43 +10:00
Dion Moult 629ba41f5f Only allow drawing / sheet / schedule creation once the IFC is saved to enforce correct relative paths. 2023-04-12 21:27:43 +10:00
Andrej730 198fa67cc1 Focus on text field on edit Ifc Text with BIM Tool hotkey (once again)
This option was here before but it was accidentally discarded after f7181aa
2023-04-12 11:51:50 +05:00
CyrilWaechter e7830e3d55 Fix #2964 2023-04-11 22:03:26 +02:00
Andrej730 90bfb25f41 restoring selection on bim.override_mode_set_edit if nothing worked
it was a bit confusing when you're trying to edit some object, you get error message but you also lose object selection
2023-04-11 19:17:03 +05:00
Andrej730 037cb00caa Fixed bug with roof created in projects with milimeters units
the problem was that operators were converting angle using SI and angle was set to 10000
2023-04-11 19:17:03 +05:00
Andrej730 f002124c38 Fixed error in PLAN_LEVEL elevation value in printed svgs #2961
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
2023-04-11 19:06:59 +05:00
Andrej730 ac42f9f599 Changed roof preview colors and it's now transparent
Changed roof preview colors to the same as openings
2023-04-11 19:06:58 +05:00
Andrej730 88d4640d3f fixed mistake in tool.Blender.apply_bmesh
was resulting in error when you apply roof path
2023-04-11 17:30:29 +05:00
Andrej730 d2da01041c Added checkboxes to drawing list to mark multiple selected drawings
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
2023-04-11 17:14:10 +05:00
Dion Moult 75c17b820f Fix bug where invalidly mapped representations shouldn't be edited. 2023-04-11 21:50:28 +10:00
Thomas Krijnen 2dc4bbf8cd Support rule compilation and execution on latebound schema 2023-04-11 13:24:32 +02:00
Thomas Krijnen c9a5abc3be Some small fixes for rule compliance in template.py 2023-04-11 09:46:50 +02:00
Thomas Krijnen 7ea468a9a6 Update build-all.py 2023-04-11 08:47:46 +02:00
Dion Moult c6223520e0 Fix #2947. Embarrassing bug where slabs didn't consider the total thickness. 2023-04-11 16:24:39 +10:00
Dion Moult 176cbf9861 Fix #2948. Bug where IFC array tool didn't track undo properly causing crashes. 2023-04-11 15:21:04 +10:00
Dion Moult 00315a6f2d See #2516. Titleblocks dropdown now also shows project titleblocks. 2023-04-11 14:08:48 +10:00
Dion Moult 2145b2f8e2 Fix #2955. You can now store default paths in a project pset. 2023-04-11 14:06:31 +10:00
Dion Moult 31155e7bc9 See #2516. Fix issue where getting sheet layout URIs were not explicit. 2023-04-11 12:26:05 +10:00
Trashman247 2d07208d0f Reformat parametrized "Save" in IFC project (again) 2023-04-11 10:26:48 +10:00
Trashman247 35ad7e16c6 Reformat parametrized "Save" in IFC project 2023-04-11 10:26:48 +10:00
Trashman247 27c52fe6d5 Add dynamic tool tip for parametrized "Save" in IFC project 2023-04-11 10:26:48 +10:00
Andrej e153f63a23 Merge pull request #2962 from maxfb87/fix_bug
Fix minor bug
2023-04-11 01:23:58 +05:00
Andrej 2cbbc360c0 Merge branch 'v0.7.0' into fix_bug 2023-04-11 01:23:27 +05:00
Thomas Krijnen 8a4a42777f Property transfer ownership of schema from py to c++ upon register_schema() 2023-04-10 22:01:53 +02:00
Thomas Krijnen 352d6b5ef9 Attempt load schema from cwd (IS THIS DANGEROUS?) 2023-04-10 20:31:56 +02:00
Thomas Krijnen cc49b0efdc Don't fail on unmapped attribute types (IFC4.4) 2023-04-10 20:17:26 +02:00
Andrej730 e71ee988bf Fixed error on disabling BlenderBIM addon
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'
2023-04-10 18:05:40 +05:00
Dion Moult 937a5b2c2d Fix #2516. Add/build/remove/view/rename/copy sheet/drawing/schedule now all references and updates user configurable relative paths. 2023-04-10 22:30:33 +10:00
Dion Moult 92221e19c3 Fix bug where unassigning a document was too aggressive and deleted relationships where it shouldn't. 2023-04-10 22:30:33 +10:00
CyrilWaechter e5c920864c Add ifczip and ifcxml to x-ifc mime-type 2023-04-10 11:43:26 +02:00
Nathan Hild 6f63682bdf Correct tooltip messages for enabling and disabling edit buttons 2023-04-10 10:28:10 +02:00
Andrej730 7623eddcd7 Including/Excluding IfcAnnotations from drawing #2903
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.
2023-04-10 12:37:39 +05:00
Andrej730 d1dee1e908 Fixed errors from 9bca705 2023-04-10 12:30:51 +05:00
Andrej730 8b302f8d21 Make BIM Tool alignment buttons clickable and some hotkeys code cleanup 2023-04-10 11:22:17 +05:00
Dion Moult dfeebd6b6b Fix #2960. 2023-04-10 09:01:34 +10:00
Massimo Fabbro df53ce9f6e Better fix about cls without is_registered method 2023-04-09 22:33:37 +02:00
Massimo Fabbro 9bb2c00b6d Fix bug related to operators without is_registered method 2023-04-09 21:58:11 +02:00
Dion Moult 641253c4c6 Document list now shows description and locations instead of names as names are inherited. 2023-04-09 23:03:10 +10:00
Dion Moult 6ce49b7130 See #2516. References to titleblocks, layouts, and published sheets are now explicitly stored. Titleblock paths are now configurable. Generated filenames are sanitised. 2023-04-09 23:03:10 +10:00
Andrej730 804ad0cece Prevent flickering for SectionLevel and Grid decorators 2023-04-09 18:03:08 +05:00
Dion Moult 6c60d14c05 Fix #2959. Oversight when disabling mesh edit mode. Edit grid axes should be allowed. 2023-04-09 12:52:10 +10:00
Dion Moult def2d2bcc9 See #2516. WARNING: breaking changes! Restructure drawing system to use relative paths based on IfcDocumentReference Locations. 2023-04-08 21:59:53 +10:00
Andrej730 9bca705dc3 Solved producing orphan objects data on drawing deletion 2023-04-08 11:37:35 +05:00
Andrej730 2dcc271dff Updating sheet name from UI #2950 2023-04-07 19:06:41 +05:00
Thomas Krijnen 33415fa1af #2685 Fix AttributeError 2023-04-07 16:02:11 +02:00
Andrej730 10315e0e29 annotation and gizmo shaders rework for smoothed lines without bgl #2897
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.
2023-04-07 17:36:58 +05:00
Dion Moult f321cc81c8 Minor improvement to add error message when mirror elements called without a mirror axis. 2023-04-07 20:07:38 +10:00
Bruno Perdigão 68b685f580 minor fix, sets a minimum to 'count' 2023-04-07 19:58:33 +10:00
Bruno Perdigão c87c79b937 Fix #2937. IFC Array now have the option to sync children 2023-04-07 19:58:33 +10:00
Sigma Dimensions de3dfcdc43 BBIM 4D Features to:
- 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
2023-04-07 04:33:56 +02:00
Kristoffer Andersen 657ddc0fa1 conda daily pin occt version 2023-04-06 21:38:42 +02:00
Dion Moult 1da01489f1 Fix #2935. Duplicating objects clear any parametric array relationships. 2023-04-06 21:18:36 +10:00
Massimo Fabbro 64a27614ff Fix bug #2825 2023-04-06 21:12:18 +10:00
Dion Moult 6c5acfc8bb Fix #2945. Selector should expand enumerated list properties so that you can match any of them. 2023-04-06 19:21:22 +10:00
Andrej730 884ee5b587 Warning when user loading sheets and some svgs are missing
Added this warning because missing svgs can lead to errors later on.
2023-04-06 13:51:12 +05:00
Andrej730 c2320a3c1e ChangeSheetTitleBlock operator
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.
2023-04-06 13:51:07 +05:00
Bruno Perdigão ab23030051 ifc array modifier: get cursor position in relation to the object local axes 2023-04-06 10:45:47 +10:00
Bruno Perdigão 699c692f6c ifc array modifier: adds the option to get the dimensions from the 3d cursor 2023-04-06 10:45:47 +10:00
Bruno Perdigão 0c85e26950 ifc array modifier: bugfix, prevent divider from being zero. 2023-04-06 10:45:35 +10:00
Bruno Perdigão 2cd7e737cd ifc array modifier: adds the option to choose between "total" and "increment" as dimension input 2023-04-06 10:45:35 +10:00
Gorgious56 a1adbe2b34 You can now change the section line decorator width in the UI 2023-04-06 09:37:01 +10:00
Gorgious56 a144c2b7ea Add new shader to display the section as a thick line on the mesh 2023-04-06 09:37:01 +10:00
Gorgious56 201c056ffa Add new decorator utility to the Compare node group 2023-04-06 09:37:01 +10:00
Andrej730 2e95168610 Title case naming for operators 2023-04-05 17:49:58 +05:00
Andrej730 b18c05cbb9 Open all drawings at once with shift+click (similar to print all)
Also added filepath check to make sure all drawings were printed first.
2023-04-05 17:47:27 +05:00
Andrej730 102a4c6110 Title case naming for operators 2023-04-05 17:47:27 +05:00
Dion Moult b6c0ef3d19 Fix #2936. Unassigning a type now also unmaps representations. 2023-04-05 22:33:11 +10:00
Andrej730 ea3065dbc2 Sync viewport visibility based on EPset_Drawing/Include Exclude #2613
It's not real time, it's triggered on using "Activate view" button in "Drawings" section.
2023-04-05 16:34:43 +05:00
Gorgious56 534c3ad329 Fix temporary section cutaway socket inputs/outputs not initializing properly
Related to #2547
2023-04-05 13:30:35 +02:00
Dion Moult 90a7d807a1 Fix #2938. Unlinked objects should no longer synchronise edits after they've changed. 2023-04-05 21:07:44 +10:00
Dion Moult 4baafb5e2f See #2938. Fix issue where unlinking didn't consider other users of the object's data or material. 2023-04-05 20:58:24 +10:00
Andrej730 f911765cdb Support for SECTION_LEVEL annotations description in viewport
Example - https://i.imgur.com/ATF9Fp6.png
(similar to svg)
2023-04-05 14:44:27 +05:00
Andrej730 d0a36c79d5 Small fix 2023-04-05 13:10:41 +05:00
Andrej730 ffea5320a0 Background for Ifc Text annotations in SVG
Added option to fill background of Ifc Text annotation with white color.

To make it work need to add "fill-bg" class to EPset_Annotation - https://i.imgur.com/ig2EhkQ.png.

Result - https://i.imgur.com/mq4hzAM.png
2023-04-05 12:38:36 +05:00
Andrej730 0b54e41a40 Small editing assigned product UI fix
Previously checkmark didn't worked at all if the existing and new product were the same.
2023-04-04 19:02:07 +05:00
Andrej730 26c67f770a Sliding doors - more consistent 2d repr between door types #2919 2023-04-04 18:53:59 +05:00
Andrej730 f6623db0e6 Sliding doors - moved annotation arrow to Annotation/PLAN_VIEW #2919 2023-04-04 18:38:44 +05:00
Dion Moult d7844ee8e8 Fix #2114. Duplicate overrides are now defined as macros which means that repeating last function now works. 2023-04-04 22:01:45 +10:00
Andrej730 1c8970bbf2 removed redundant parts from generate_steel_profiles_library.py
removed never used methods and contexts
2023-04-04 14:23:21 +05:00
Dion Moult eb70849a30 Fix #2898. Explicitly check for changed active material in material UI panels. 2023-04-04 17:04:32 +10:00
Andrej730 77ce3c9067 Fixed ifc validation errors for generated openings #2925
Now ELEVATION_VIEW 3d curves converted to 2d to be extruded later on to create opening representation.
2023-04-04 11:18:29 +05:00
Dion Moult 56cd226a27 Deprecate mode subscriptiosn of profiles and walls 2023-04-04 13:59:10 +10:00
Dion Moult a1acdc0977 See #2881. Allow indices in the selector instead of relying on external evaluations. 2023-04-04 09:58:23 +10:00
Dion Moult 1a624c957b See #2916. Minor fix. 2023-04-04 09:43:58 +10:00
Andrej730 1c9eeb2aca Revert "Fixed ifc validation errors for generated openings #2925"
This reverts commit 66a53b486a.
2023-04-03 23:04:27 +05:00
Gorgious56 45f06eeea7 Interface now displays a hint when trying to edit a non-mesh-like object
& Fix case where the active object would go into edit mode even if not mesh-like when multiple objects were selected
2023-04-03 17:55:44 +02:00
Andrej730 66a53b486a Fixed ifc validation errors for generated openings #2925 2023-04-03 19:53:43 +05:00
Andrej730 fc45f5b48f Fixed ifc validation errors for furniture library #2925
Fixed bunch of validation errors with furniture library:

- IfcSpaceType PredefinedType wasn't optional
`<attribute PredefinedType: <enumeration IfcSpaceTypeEnum: (EXTERNAL, GFA, INTERNAL, NOTDEFINED, PARKING, SPACE, USERDEFINED)>> Not optional`

- some object had 0.0 depth extrusion
```
Rule IfcPositiveLengthMeasure_WR1:
    (self > 0.)
Violated by:
    (0.0 > 0.0)
```

- some orphan representations violating:
```
Rule IfcShapeModel_WR11:
    ((sizeof(self.OfProductRepresentation) == 1) ^ (sizeof(self.RepresentationMap) == 1) ^ (sizeof(ofshapeaspect) == 1))
Violated by:
    ((0 == 1 ^ 0 == 1) ^ 0 == 1)
     +  where 0 = sizeof(())
     +    where () = #9091=IfcShapeRepresentation(#15,'Body','SweptSolid',(#9090)).OfProductRepresentation
     +  and   0 = sizeof(())
     +    where () = #9091=IfcShapeRepresentation(#15,'Body','SweptSolid',(#9090)).RepresentationMap
     +  and   0 = sizeof(())
```
2023-04-03 19:53:43 +05:00
Andrej730 c7105a22e6 Fixed validation error for ELEVATION_VIEW curves #2925
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
```
2023-04-03 19:53:43 +05:00
Andrej730 e1fc7cad44 Fixed all unit.add_si_unit uses after fd87747
Now they were causing `TypeError: Usecase.__init__() got an unexpected keyword argument 'name'`
2023-04-03 19:53:42 +05:00
Andrej730 afeeaeb984 Fixed some validation errors for doors and windows #2925
Fixed the ones caused by using 3d curves as inner/outer curves in profiles.
2023-04-03 19:53:42 +05:00
Andrej730 2bc60b87f2 Fixed issue with tool.Blender.apply_bmesh 2023-04-03 19:53:42 +05:00
Dion Moult 4ad9ecb7db FixRevitTINs patch recipe now also purges non up-facing polygons as Revit doesn't handle them very well. 2023-04-03 21:28:34 +10:00
Dion Moult 3ec7b82b85 Fix #2930. Do not require entity applicability in IfcTester. 2023-04-03 21:28:00 +10:00
Dion Moult 48666def6b Fix #2910. Bug where style colours were not synced prior to duplication. 2023-04-03 20:16:43 +10:00
Chun 5732921fb6 a simplifier workflow and a more consistent coding style 2023-04-03 19:50:53 +10:00
Chun b86c11e1dc Unify variable 2023-04-03 19:50:53 +10:00
Chun 1bae4b219a Update functions of get_connected_to and get_connected_from compatible with IFC4 and IFC2X3 2023-04-03 19:50:53 +10:00
Chun 70ff73f805 Add IFC4 support for functions get_connected_to and get_connected_from in util.system 2023-04-03 19:50:53 +10:00
Chun a9636c5038 Add IFC4 support to get_connected_to and get_connected_from functions 2023-04-03 19:50:53 +10:00
Dion Moult a406b9f7ef Fix #2928. 2023-04-03 18:12:32 +10:00
Dion Moult f291345111 Fix #2924. IfcElements default to a null predefined type so they can inherit where possible. 2023-04-03 13:54:25 +10:00
Dion Moult c947ccb8be Fix #2926. Connections removed when rotating 90 deg to prevent unintuitive behaviour. Layer2 are also now recalculated. 2023-04-03 13:43:42 +10:00
Dion Moult 28c6b0d4bb Link to IfcArchitect tutorial series for quickstart video tutorials 2023-04-03 12:35:10 +10:00
Dion Moult 19317a9cc2 See #2881. Add support for evaluated commands in smart text literals 2023-04-02 21:25:06 +10:00
Dion Moult d67da6425e Fix #2927. Continuing to make mesh editing stricter. 2023-04-02 15:02:43 +10:00
Dion Moult 901f41358f Shortlist which IFC geometries may be treated as a meshlike object. 2023-04-02 13:45:05 +10:00
Dion Moult 061922aea2 Minor fix 2023-04-01 22:19:29 +11:00
Massimo Fabbro 5f7b6a5498 fix qto ui bug where objects with no assigned base qto doesn't allow to show the qto panel 2023-04-01 21:59:53 +11:00
Dion Moult 2ef9d5eed9 Fix #2922. You can now edit extrusion profiles of swept solids. 2023-04-01 21:27:20 +11:00
Dion Moult 9fba57d5db Disable edit mode on non mesh-like representations as well to prevent risk of invalid geometry. 2023-04-01 21:25:45 +11:00
Dion Moult e9074e3b3f Fix bug where generated openings invalidly used 3 dimensions instead of 2 2023-04-01 18:14:54 +11:00
Andrej730 f053ba714f Fixed bug in tool.Blender.get_bmesh_for_mesh
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.
2023-04-01 12:12:34 +05:00
Andrej730 b6598f09a3 Fixed error with switching from EDIT mode for annotation meshes
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'
2023-04-01 12:00:07 +05:00
Andrej730 b9d7b95304 Revert part of 3a3d96be0 #2897
Reverted part of the bgl to gpu transition (to not scare away people with annotations without antialiasing🙂) until I work out the complete solution.
2023-03-31 19:56:26 +05:00
Andrej730 3db540f786 Fixed another typo related to #2889... 2023-03-31 19:50:22 +05:00
Andrej730 071b99c6c6 Fixed crash in Blender 3.5 on creating fill area annotation
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)
```
2023-03-31 17:52:07 +05:00
Andrej730 3a3d96be0a bgl to gpu: profiles and openings decorations #2897
Still need to fix shaders.py and decoration.py
2023-03-31 16:38:24 +05:00
Andrej730 a03fbab4d5 Added description to some annotation operators 2023-03-31 11:06:21 +05:00
Andrej730 cc3b119288 Automatically adjusted STAIR_ARROWs now stop at the top thread
Previously they were ending at the end of the stair object and problem was that the end of the object could be at the slab underneath the stair.

Example - https://i.imgur.com/Y43v0GM.png
Before - https://i.imgur.com/Ze9DoK2.png
2023-03-31 10:59:39 +05:00
Andrej730 1a750d1b85 STAIR_ARROW annotations attached to IfcStairFlight object now readjusted after changes in IFC Stair modifier
Later probably will also need some other way to readjust annotations - so they can be readjusted for custom stairs, not created with modifier.
2023-03-31 10:59:39 +05:00
Andrej730 5b3ae9b9fd Clever STAIR_ARROW annotation
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
2023-03-30 18:41:55 +05:00
Andrej730 81471d80cd Fixed bug causing errors in IFC4X3 projects
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'
```
2023-03-30 17:12:00 +05:00
Andrej730 eb14db4deb Fixed typo in ifcopenshell.util.type 2023-03-30 16:42:25 +05:00
Andrej730 50d989363a Added arrow to 2d repr of sliding doors (#2919)
Example - https://i.imgur.com/eJnhDXU.png
2023-03-30 16:36:55 +05:00
Dion Moult e52a99bd71 Load all type products by default (in preparation for IfcAnnotationType support) 2023-03-30 21:26:16 +11:00
Andrej730 a7a7c86657 IFC Door Modifier - sliding doors
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
2023-03-30 12:41:34 +05:00
167 changed files with 111274 additions and 298566 deletions
@@ -0,0 +1,53 @@
name: Publish-ifcsverchok
on:
push:
paths:
- '.github/workflows/ci-ifcsverchok-build.yml'
- 'src/ifcsverchok/*'
branches:
- v0.7.0
env:
major: 0
minor: 0
name: ifcsverchok
jobs:
activate:
runs-on: ubuntu-latest
if: |
github.repository == 'IfcOpenShell/IfcOpenShell'
steps:
- name: Set env
run: echo ok go
build:
needs: activate
name: ifcsverchok
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
with:
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
python-version: '3.11'
- run: echo ${{ env.DATE }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%y%m%d')"
- name: Compile
run: |
cd src/ifcsverchok
make dist
- name: Upload Zip file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src/ifcsverchok/dist/ifcsverchok-${{steps.date.outputs.date}}.zip
asset_name: ifcsverchok-${{steps.date.outputs.date}}.zip
tag: "ifcsverchok-${{steps.date.outputs.date}}"
overwrite: true
body: "ifcsverchok build for ${{steps.date.outputs.date}}"
+1 -1
View File
@@ -12,7 +12,7 @@ RUN apt-get -y update && apt-get -y install unzip curl
# Install AWS Lambda runtime interface client
RUN pip install --target ${FUNCTION_DIR} awslambdaric
# Set the IfcOpenShell build version (check available builds at: https://blenderbim.org/docs-python/ifcopenshell-python/installation.html)
# Set the IfcOpenShell build version (check available builds at: https://docs.ifcopenshell.org/ifcopenshell-python/installation.html)
ARG IFC_OPENSHELL_BUILD="39-v0.7.0-476ab50"
# Download and extract IfcOpenShell
+1 -1
View File
@@ -15,7 +15,7 @@
<licenseUrl>https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/COPYING</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</projectSourceUrl>
<docsUrl>https://blenderbim.org/docs/</docsUrl>
<docsUrl>https://docs.blenderbim.org/</docsUrl>
<!--<mailingListUrl></mailingListUrl>-->
<bugTrackerUrl>https://github.com/IfcOpenShell/IfcOpenShell/issues</bugTrackerUrl>
<tags>blender bim blenderbim ifc python opensource foss</tags>
+1 -1
View File
@@ -746,7 +746,7 @@ if(NOT SCHEMA_VERSIONS)
# super arbitrarily try to keep size down at least a little bit
set(SCHEMA_VERSIONS "2x3" "4")
else()
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3_tc1" "4x3_add1" "4x3_add2")
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3" "4x3_tc1" "4x3_add1" "4x3_add2")
endif()
endif()
+17 -1
View File
@@ -51,6 +51,7 @@
###############################################################################
import logging
import os
import re
import sys
import subprocess as sp
import shutil
@@ -468,6 +469,8 @@ if "wasm" in flags:
# If the linker supports GC sections, set it up to reduce binary file size
# -fPIC is required for the shared libraries to work
compiler_flags = "CFLAGS", "CXXFLAGS", "LDFLAGS"
CXXFLAGS = os.environ.get("CXXFLAGS", "")
CFLAGS = os.environ.get("CFLAGS", "")
LDFLAGS = os.environ.get("LDFLAGS", "")
@@ -493,7 +496,11 @@ else:
CXXFLAGS=CXXFLAGS_MINIMAL
CFLAGS=CFLAGS_MINIMAL
LDFLAGS = f"{LDFLAGS} {ADDITIONAL_ARGS_STR}"
if "lto" in flags:
for f in compiler_flags:
locals()[f] += f" -flto={IFCOS_NUM_BUILD_PROCS}"
os.environ["CXXFLAGS"] = CXXFLAGS
os.environ["CFLAGS"] = CFLAGS
os.environ["LDFLAGS"] = LDFLAGS
@@ -503,6 +510,11 @@ os.environ["LDFLAGS"] = LDFLAGS
# build_dependency(name="cmake-%s" % (CMAKE_VERSION,), mode="autoconf", build_tool_args=[], download_url="https://cmake.org/files/v%s" % (CMAKE_VERSION_2,), download_name="cmake-%s.tar.gz" % (CMAKE_VERSION,))
if 'hdf5' in targets:
# not supported
orig = [os.environ[f] for f in compiler_flags]
for f in compiler_flags:
os.environ[f] = re.sub("-flto(=\w+)?", "", os.environ[f])
HDF5_MAJOR = ".".join(HDF5_VERSION.split(".")[:-1])
build_dependency(
name=f"hdf5-{HDF5_VERSION}",
@@ -513,6 +525,10 @@ if 'hdf5' in targets:
ctest_result=f"HDF5-{HDF5_VERSION}-{platform.system()}",
ctest_result_path=f"HDF_Group/HDF5/{HDF5_VERSION}"
)
for f, o in zip(compiler_flags, orig):
os.environ[f] = o
if "json" in targets:
json_url = f"https://github.com/nlohmann/json/releases/download/{JSON_VERSION}/json.hpp"
+1 -1
View File
@@ -148,7 +148,7 @@ class IfcStore:
bpy.context.scene.BIMProjectProperties.export_schema
)
elif IfcStore.schema is None:
IfcStore.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(IfcStore.file.schema)
IfcStore.schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(IfcStore.file.schema_identifier)
return IfcStore.schema
@staticmethod
+54 -49
View File
@@ -199,7 +199,7 @@ class MaterialCreator:
class IfcImporter:
def __init__(self, ifc_import_settings):
def __init__(self, ifc_import_settings: IfcImportSettings):
self.ifc_import_settings = ifc_import_settings
self.diff = None
self.file: ifcopenshell.file = None
@@ -391,20 +391,20 @@ class IfcImporter:
for context in self.contexts:
settings = ifcopenshell.geom.settings()
settings.set_deflection_tolerance(self.ifc_import_settings.deflection_tolerance)
settings.set_angular_tolerance(self.ifc_import_settings.angular_tolerance)
settings.set(settings.STRICT_TOLERANCE, True)
settings.set(settings.INCLUDE_CURVES, True)
settings.set_context_ids([context.id()])
settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance)
settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance)
# settings.set(settings.STRICT_TOLERANCE, True)
settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
settings.set('context-ids', [context.id()])
self.context_settings.append(settings)
settings = ifcopenshell.geom.settings()
settings.set_deflection_tolerance(self.ifc_import_settings.deflection_tolerance)
settings.set_angular_tolerance(self.ifc_import_settings.angular_tolerance)
settings.set(settings.STRICT_TOLERANCE, True)
settings.set(settings.INCLUDE_CURVES, True)
settings.set(settings.DISABLE_OPENING_SUBTRACTIONS, True)
settings.set_context_ids([context.id()])
settings.set('mesher-linear-deflection', self.ifc_import_settings.deflection_tolerance)
settings.set('mesher-angular-deflection', self.ifc_import_settings.angular_tolerance)
# settings.set(settings.STRICT_TOLERANCE, True)
settings.set('dimensionality', ifcopenshell.ifcopenshell_wrapper.CURVES_SURFACES_AND_SOLIDS)
settings.set('disable-opening-subtractions', True)
settings.set('context-ids', [context.id()])
self.gross_context_settings.append(settings)
def process_element_filter(self):
@@ -430,7 +430,7 @@ class IfcImporter:
self.annotations = set([a for a in self.file.by_type("IfcAnnotation")])
self.annotations -= drawing_annotations
self.elements = [e for e in self.elements if not e.is_a("IfcFeatureElement")]
self.elements = [e for e in self.elements if not e.is_a("IfcFeatureElement") or e.is_a("IfcSurfaceFeature")]
if self.ifc_import_settings.is_coordinating:
self.elements = [e for e in self.elements if e.Representation]
@@ -693,10 +693,7 @@ class IfcImporter:
shape = self.create_generic_shape(element)
if not shape:
continue
m = shape.transformation.matrix.data
mat = np.array(
([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])
)
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
point = np.array(
(
shape.geometry.verts[0] / self.unit_scale,
@@ -725,7 +722,7 @@ class IfcImporter:
if len(subelement.Coordinates) == 3 and self.is_point_far_away(subelement, is_meters=False):
return True
def apply_blender_offset_to_matrix_world(self, obj, matrix):
def apply_blender_offset_to_matrix_world(self, obj: bpy.types.Object, matrix: np.ndarray) -> mathutils.Matrix:
props = bpy.context.scene.BIMGeoreferenceProperties
if props.has_blender_offset:
if obj.data and obj.data.get("has_cartesian_point_offset", None):
@@ -857,7 +854,10 @@ class IfcImporter:
print("Done creating geometry")
def create_spatial_elements(self) -> None:
self.create_generic_elements(self.spatial_elements, unselectable=True)
if bpy.context.preferences.addons["blenderbim"].preferences.spatial_elements_unselectable:
self.create_generic_elements(self.spatial_elements, unselectable=True)
else:
self.create_generic_elements(self.spatial_elements, unselectable=False)
def create_elements(self) -> None:
self.create_generic_elements(self.elements)
@@ -949,7 +949,9 @@ class IfcImporter:
self.create_product(element, mesh=mesh)
def create_products(
self, products, settings: Optional[ifcopenshell.geom.main.settings] = None
self,
products: set[ifcopenshell.entity_instance],
settings: Optional[ifcopenshell.geom.main.settings] = None,
) -> set[ifcopenshell.entity_instance]:
results = set()
if not products:
@@ -1149,11 +1151,8 @@ class IfcImporter:
self.link_element(element, obj)
if shape:
m = shape.transformation.matrix.data
# We use numpy here because Blender mathutils.Matrix is not accurate enough
mat = np.array(
([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])
)
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
self.set_matrix_world(obj, self.apply_blender_offset_to_matrix_world(obj, mat))
self.material_creator.create(element, obj, mesh)
elif mesh:
@@ -1623,30 +1622,34 @@ class IfcImporter:
if self.ifc_import_settings.has_filter:
rel_aggregates = set()
for element in self.elements:
if element.IsDecomposedBy:
rel_aggregates.add(element.IsDecomposedBy[0])
elif element.Decomposes:
rel_aggregates.add(element.Decomposes[0])
elif getattr(element, "IsNestedBy", []): # IFC2X3 does not have IsNestedBy
if [e for e in element.IsNestedBy[0].RelatedObjects if not e.is_a("IfcPort")]:
rel_aggregates.add(element.IsNestedBy[0])
elif getattr(element, "Nests", []):
rel_aggregates.add(element.Nests[0])
if decomposed_by := element.IsDecomposedBy:
rel_aggregates.add(decomposed_by[0])
elif decomposes := element.Decomposes:
rel_aggregates.add(decomposes[0])
elif nested_by := getattr(element, "IsNestedBy", []): # IFC2X3 does not have IsNestedBy
if next((e for e in nested_by[0].RelatedObjects if not e.is_a("IfcPort")), None):
rel_aggregates.add(nested_by[0])
elif nests := getattr(element, "Nests", []):
rel_aggregates.add(nests[0])
elif element.is_a("IfcSurfaceFeature") and self.file.schema == "IFC4X3":
rel_aggregates.add(element.AdheresToElement[0])
else:
rel_aggregates = [
r
for r in self.file.by_type("IfcRelAggregates")
if r.RelatingObject.is_a("IfcElement") or r.RelatingObject.is_a("IfcElementType")
if (relating_obj := r.RelatingObject).is_a("IfcElement") or relating_obj.is_a("IfcElementType")
] + [
r
for r in self.file.by_type("IfcRelNests")
if (
r.RelatingObject.is_a("IfcElement")
or r.RelatingObject.is_a("IfcElementType")
or (r.RelatingObject.is_a("IfcPositioningElement") and not r.RelatingObject.is_a("IfcGrid"))
(relating_obj := r.RelatingObject).is_a("IfcElement")
or relating_obj.is_a("IfcElementType")
or (relating_obj.is_a("IfcPositioningElement") and not relating_obj.is_a("IfcGrid"))
)
and [e for e in r.RelatedObjects if not e.is_a("IfcPort")]
]
if self.file.schema == "IFC4X3":
rel_aggregates += [r for r in self.file.by_type("IfcRelAdheresToElement")]
if len(rel_aggregates) > 10000:
# More than 10,000 collections makes Blender unhappy
@@ -1656,7 +1659,9 @@ class IfcImporter:
aggregates: dict[str, dict] = {}
for rel_aggregate in rel_aggregates:
element: ifcopenshell.entity_instance = rel_aggregate.RelatingObject
element: ifcopenshell.entity_instance = getattr(rel_aggregate, "RelatingObject", None) or getattr(
rel_aggregate, "RelatingElement"
)
collection = bpy.data.collections.new(tool.Loader.get_name(element))
aggregates[element.GlobalId] = {"element": element, "collection": collection}
self.collections[element.GlobalId] = collection
@@ -1757,6 +1762,9 @@ class IfcImporter:
elif getattr(element, "Nests", None) and not element.is_a("IfcPort"):
nest = ifcopenshell.util.element.get_nest(element)
return self.collections[nest.GlobalId].objects.link(obj)
elif element.is_a("IfcSurfaceFeature") and self.file.schema == "IFC4X3":
adherend = element.AdheresToElement[0].RelatingElement
return self.collections[adherend.GlobalId].objects.link(obj)
return self.place_object_in_spatial_decomposition_collection(element, obj)
@@ -1806,7 +1814,7 @@ class IfcImporter:
if rel.is_a("IfcRelAssignsToGroup") and rel.RelatingGroup.ObjectType == "DRAWING":
return rel.RelatingGroup
def get_element_matrix(self, element: ifcopenshell.entity_instance) -> np.array:
def get_element_matrix(self, element: ifcopenshell.entity_instance) -> np.ndarray:
if isinstance(element, ifcopenshell.sqlite_entity):
result = self.geometry_cache["shapes"][element.id()]["matrix"]
else:
@@ -1889,10 +1897,7 @@ class IfcImporter:
and geometry.verts
and self.is_point_far_away((geometry.verts[0], geometry.verts[1], geometry.verts[2]))
):
m = shape.transformation.matrix.data
mat = np.array(
([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])
)
mat = np.array(shape.transformation.matrix).reshape((4, 4), order="F")
offset_point = np.linalg.inv(mat) @ np.array(
(
float(props.blender_eastings),
@@ -1946,7 +1951,7 @@ class IfcImporter:
edges = [[e[i], e[i + 1]] for i in range(0, len(e), 2)]
mesh.from_pydata(vertices, edges, [])
mesh["ios_materials"] = [int(m.name.split("-")[2]) for m in geometry.materials]
mesh["ios_materials"] = [m.instance_id() for m in geometry.materials]
mesh["ios_material_ids"] = geometry.material_ids
return mesh
except:
@@ -1955,14 +1960,14 @@ class IfcImporter:
print(traceback.format_exc())
def a2p(self, o, z, x):
def a2p(self, o: mathutils.Vector, z: mathutils.Vector, x: mathutils.Vector) -> mathutils.Matrix:
y = z.cross(x)
r = mathutils.Matrix((x, y, z, o))
r.resize_4x4()
r.transpose()
return r
def get_axis2placement(self, plc):
def get_axis2placement(self, plc: ifcopenshell.entity_instance) -> mathutils.Matrix:
if plc.is_a("IfcAxis2Placement3D"):
z = mathutils.Vector(plc.Axis.DirectionRatios if plc.Axis else (0, 0, 1))
x = mathutils.Vector(plc.RefDirection.DirectionRatios if plc.RefDirection else (1, 0, 0))
@@ -1982,7 +1987,7 @@ class IfcImporter:
o = plc.LocalOrigin.Coordinates
return self.a2p(o, z, x)
def get_local_placement(self, plc):
def get_local_placement(self, plc: Optional[ifcopenshell.entity_instance] = None) -> mathutils.Matrix:
if plc is None:
return mathutils.Matrix()
if plc.PlacementRelTo is None:
@@ -1997,11 +2002,11 @@ class IfcImporter:
bpy.context.scene.BIMRootProperties.contexts = str(subcontext.id())
break
def link_element(self, element, obj):
def link_element(self, element: ifcopenshell.entity_instance, obj: IFC_CONNECTED_TYPE) -> None:
self.added_data[element.id()] = obj
tool.Ifc.link(element, obj)
def set_matrix_world(self, obj, matrix_world):
def set_matrix_world(self, obj: bpy.types.Object, matrix_world: mathutils.Matrix) -> None:
obj.matrix_world = matrix_world
tool.Geometry.record_object_position(obj)
@@ -190,12 +190,17 @@ class BIM_OT_select_parts(bpy.types.Operator):
def execute(self, context):
self.file = IfcStore.get_file()
obj = bpy.data.objects.get(self.obj) or context.active_object
parts = ifcopenshell.util.element.get_parts(tool.Ifc.get_entity(obj))
parts_objs = set(tool.Ifc.get_object(part) for part in parts)
selectable_parts_objs = set(context.selectable_objects).intersection(parts_objs)
for selectable_part_obj in selectable_parts_objs:
selectable_part_obj.select_set(True)
# obj = bpy.data.objects.get(self.obj) or context.active_object
for obj in context.selected_objects:
parts = ifcopenshell.util.element.get_parts(tool.Ifc.get_entity(obj))
if parts:
parts_objs = set(tool.Ifc.get_object(part) for part in parts)
selectable_parts_objs = set(context.selectable_objects).intersection(parts_objs)
for selectable_part_obj in selectable_parts_objs:
selectable_part_obj.select_set(True)
else:
obj.select_set(False)
return {"FINISHED"}
@@ -217,18 +222,43 @@ class BIM_OT_select_aggregate(bpy.types.Operator):
def execute(self, context):
self.file = IfcStore.get_file()
obj = bpy.data.objects.get(self.obj) or context.active_object
aggregate = ifcopenshell.util.element.get_aggregate(tool.Ifc.get_entity(obj))
aggregate_obj = tool.Ifc.get_object(aggregate)
# obj = bpy.data.objects.get(self.obj) or context.active_object
# aggregate = ifcopenshell.util.element.get_aggregate(tool.Ifc.get_entity(obj))
# aggregate_obj = tool.Ifc.get_object(aggregate)
all_parts = []
for obj in context.selected_objects:
element = tool.Ifc.get_entity(obj)
if element:
aggregate = ifcopenshell.util.element.get_aggregate(element)
if aggregate:
all_parts.append(aggregate)
obj.select_set(False)
else:
pass
if not element:
obj.select_set(False)
if self.select_parts:
bpy.ops.bim.select_parts(obj=aggregate_obj.name)
if aggregate_obj in context.selectable_objects:
tool.Blender.set_objects_selection(
context,
aggregate_obj,
[aggregate_obj],
clear_previous_selection=not self.select_parts,
)
all_objs = []
for part in all_parts:
if part.IsDecomposedBy:
for subpart in part.IsDecomposedBy[0].RelatedObjects:
all_parts.append(subpart)
all_objs.append(part)
for element in all_objs:
obj = tool.Ifc.get_object(element)
if obj:
obj.select_set(True)
else:
for aggregate_element in all_parts:
aggregate_obj = tool.Ifc.get_object(aggregate_element)
aggregate_obj.select_set(True)
bpy.context.view_layer.objects.active = aggregate_obj
return {"FINISHED"}
@@ -292,28 +322,51 @@ class BIM_OT_select_linked_aggregates(bpy.types.Operator, Operator):
bl_idname = "bim.select_linked_aggregates"
bl_label = "Select linked aggregates"
bl_options = {"REGISTER", "UNDO"}
select_parts: bpy.props.BoolProperty(default=False)
@classmethod
def description(cls, context, properties):
if properties.select_parts:
return "Select all aggregates, subaggregates and all their parts"
else:
return "Select all aggregates"
def _execute(self, context):
element = tool.Ifc.get_entity(bpy.context.active_object)
aggregate = ifcopenshell.util.element.get_aggregate(element)
if not aggregate:
return []
if not element:
return []
linked_aggregate_group = [
r.RelatingGroup
for r in getattr(aggregate, "HasAssignments", []) or []
if r.is_a("IfcRelAssignsToGroup")
if "BBIM_Linked_Aggregate" in r.RelatingGroup.Name
]
for obj in context.selected_objects:
obj.select_set(False)
element = tool.Ifc.get_entity(obj)
aggregate = ifcopenshell.util.element.get_aggregate(element)
if not aggregate:
continue
if not element:
continue
for rel in linked_aggregate_group[0].IsGroupedBy or []:
for element in rel.RelatedObjects:
obj = tool.Ifc.get_object(element)
obj.select_set(True)
linked_aggregate_group = [
r.RelatingGroup
for r in getattr(aggregate, "HasAssignments", []) or []
if r.is_a("IfcRelAssignsToGroup")
if "BBIM_Linked_Aggregate" in r.RelatingGroup.Name
]
group_rel = linked_aggregate_group[0].IsGroupedBy or []
for group_link in group_rel:
parts = list(group_link.RelatedObjects)
if self.select_parts:
parts_objs = []
for part in parts:
if part.IsDecomposedBy:
for subpart in part.IsDecomposedBy[0].RelatedObjects:
parts.append(subpart)
parts_objs.append(part)
for element in parts_objs:
obj = tool.Ifc.get_object(element)
if obj:
obj.select_set(True)
else:
for element in parts:
obj = tool.Ifc.get_object(element)
obj.select_set(True)
return {"FINISHED"}
@@ -139,7 +139,10 @@ class BIM_PT_linked_aggregate(Panel):
if type(AggregateData.data['total_linked_aggregate']) is int:
if AggregateData.data['total_linked_aggregate'] > 0:
row.label(text=f"{AggregateData.data['total_linked_aggregate']} Linked Aggregates")
row.operator("bim.select_linked_aggregates", text="", icon="RESTRICT_SELECT_OFF")
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_DATA_POINTCLOUD")
op.select_parts = False
op = row.operator("bim.select_linked_aggregates", text="", icon="OUTLINER_OB_POINTCLOUD")
op.select_parts = True
row.operator("bim.refresh_linked_aggregate", text="", icon="FILE_REFRESH")
op = row.operator("bim.break_link_to_other_aggregates", text="", icon="X")
else:
@@ -47,10 +47,18 @@ class EnableEditingAttributes(bpy.types.Operator):
obj = bpy.data.objects.get(self.obj)
elif self.obj_type == "Material":
obj = bpy.data.materials.get(self.obj)
oprops = obj.BIMObjectProperties
props = obj.BIMAttributeProperties
props.attributes.clear()
element = tool.Ifc.get_entity(obj)
has_inherited_predefined_type = False
if not element.is_a("IfcTypeObject") and (element_type := ifcopenshell.util.element.get_type(element)):
# Allow for None due to https://github.com/buildingSMART/IFC4.3.x-development/issues/818
has_inherited_predefined_type = ifcopenshell.util.element.get_predefined_type(element_type) not in (
"NOTDEFINED",
None,
)
def callback(name, prop, data):
if name in ("RefLatitude", "RefLongitude"):
new = props.attributes.add()
@@ -62,10 +70,11 @@ class EnableEditingAttributes(bpy.types.Operator):
new.string_value = "" if new.is_null else json.dumps(data[name])
blenderbim.bim.helper.add_attribute_description(new)
new.description += " The degrees, minutes and seconds should follow this format : [12,34,56]"
if name in ("PredefinedType", "ObjectType") and has_inherited_predefined_type:
props.attributes.remove(len(props.attributes) - 1)
return True
blenderbim.bim.helper.import_attributes2(
tool.Ifc.get().by_id(oprops.ifc_definition_id), props.attributes, callback=callback
)
blenderbim.bim.helper.import_attributes2(element, props.attributes, callback=callback)
props.is_editing_attributes = True
return {"FINISHED"}
@@ -832,7 +832,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
settings = ifcopenshell.geom.settings()
settings.set(settings.STRICT_TOLERANCE, True)
shape = ifcopenshell.geom.create_shape(settings, opening)
m = shape.transformation.matrix.data
m = shape.transformation.matrix
mat = Matrix(
(
[m[0], m[3], m[6], m[9]],
@@ -1035,7 +1035,7 @@ class AddBoundary(bpy.types.Operator, tool.Ifc.Operator):
settings.set(settings.STRICT_TOLERANCE, True)
# geometry = ifcopenshell.geom.create_shape(settings, body)
shape = ifcopenshell.geom.create_shape(settings, element)
m = shape.transformation.matrix.data
m = shape.transformation.matrix
mat = Matrix(([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1]))
verts = [space_matrix_i @ mat @ Vector(v) for v in ifcopenshell.util.shape.get_vertices(shape.geometry)]
faces = ifcopenshell.util.shape.get_faces(shape.geometry)
@@ -20,6 +20,8 @@ import bpy
import json
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.classification
import ifcopenshell.util.element
import blenderbim.tool as tool
import blenderbim.bim.helper
from blenderbim.bim.ifc import IfcStore
@@ -87,7 +89,7 @@ class AddManualClassificationReference(bpy.types.Operator, tool.Ifc.Operator):
reference = ifcopenshell.api.run(
"classification.add_reference",
tool.Ifc.get(),
product=product,
products=[product],
classification=classification,
identification="X",
name="Unnamed",
@@ -292,6 +294,7 @@ class RemoveClassificationReference(bpy.types.Operator, tool.Ifc.Operator):
active_reference = tool.Ifc.get().by_id(self.reference)
identification = active_reference[1]
elements_by_references: dict[ifcopenshell.entity_instance, list[ifcopenshell.entity_instance]] = {}
for obj in objects:
ifc_definition_id = tool.Blender.get_obj_ifc_definition_id(obj, self.obj_type, context)
element = tool.Ifc.get().by_id(ifc_definition_id)
@@ -300,12 +303,16 @@ class RemoveClassificationReference(bpy.types.Operator, tool.Ifc.Operator):
if (identification and reference[1] == identification) or (
not identification and reference == active_reference
):
ifcopenshell.api.run(
"classification.remove_reference",
tool.Ifc.get(),
reference=reference,
product=element,
)
elements_by_references.setdefault(reference, []).append(element)
if elements_by_references:
for reference, products in elements_by_references.items():
ifcopenshell.api.run(
"classification.remove_reference",
tool.Ifc.get(),
reference=reference,
products=products,
)
class EditClassificationReference(bpy.types.Operator, tool.Ifc.Operator):
@@ -357,15 +364,18 @@ class AddClassificationReference(bpy.types.Operator, tool.Ifc.Operator):
classification = element
break
for obj in objects:
ifc_definition_id = tool.Blender.get_obj_ifc_definition_id(obj, self.obj_type, context)
if not ifc_definition_id:
continue
ifc_file = tool.Ifc.get()
products = [
ifc_file.by_id(ifc_definition_id)
for obj in objects
if (ifc_definition_id := tool.Blender.get_obj_ifc_definition_id(obj, self.obj_type, context))
]
if products:
ifcopenshell.api.run(
"classification.add_reference",
tool.Ifc.get(),
reference=IfcStore.classification_file.by_id(self.reference),
product=tool.Ifc.get().by_id(ifc_definition_id),
products=products,
classification=classification,
)
@@ -413,7 +423,7 @@ class AddClassificationReferenceFromBSDD(bpy.types.Operator, tool.Ifc.Operator):
reference = ifcopenshell.api.run(
"classification.add_reference",
tool.Ifc.get(),
product=element,
products=[element],
classification=classification,
identification=bsdd_classification.reference_code,
name=bsdd_classification.name,
@@ -114,7 +114,7 @@ class EditObjective(bpy.types.Operator):
ifcopenshell.api.run(
"constraint.edit_objective",
self.file,
**{"objective": self.file.by_id(props.active_constraint_id), "attributes": attributes}
**{"objective": self.file.by_id(props.active_constraint_id), "attributes": attributes},
)
bpy.ops.bim.load_objectives()
return {"FINISHED"}
@@ -179,19 +179,17 @@ class AssignConstraint(bpy.types.Operator):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
self.file = IfcStore.get_file()
self.file = tool.Ifc.get()
objs = [bpy.data.objects.get(self.obj)] if self.obj else context.selected_objects
for obj in objs:
obj_id = obj.BIMObjectProperties.ifc_definition_id
if not obj_id:
continue
products = [self.file.by_id(obj_id) for obj in objs if (obj_id := obj.BIMObjectProperties.ifc_definition_id)]
if products:
ifcopenshell.api.run(
"constraint.assign_constraint",
self.file,
**{
"product": self.file.by_id(obj_id),
"products": products,
"constraint": self.file.by_id(self.constraint),
}
},
)
return {"FINISHED"}
@@ -207,18 +205,16 @@ class UnassignConstraint(bpy.types.Operator):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
self.file = IfcStore.get_file()
self.file = tool.Ifc.get()
objs = [bpy.data.objects.get(self.obj)] if self.obj else context.selected_objects
for obj in objs:
obj_id = obj.BIMObjectProperties.ifc_definition_id
if not obj_id:
continue
products = [self.file.by_id(obj_id) for obj in objs if (obj_id := obj.BIMObjectProperties.ifc_definition_id)]
if products:
ifcopenshell.api.run(
"constraint.unassign_constraint",
self.file,
**{
"product": self.file.by_id(obj_id),
"products": products,
"constraint": self.file.by_id(self.constraint),
}
},
)
return {"FINISHED"}
@@ -2373,6 +2373,7 @@ class LoadSheets(bpy.types.Operator, Operator):
if not filepath.is_file():
sheet_name = f"{sheet_prop.identification} - {sheet_prop.name}"
sheets_not_found.append(f'"{sheet_name}" - {document_uri}')
core.regenerate_sheet(tool.Drawing, sheet)
if sheets_not_found:
self.report({"ERROR"}, "Some sheets svg files are missing:\n" + "\n".join(sheets_not_found))
@@ -2570,8 +2571,16 @@ class EnableEditingElementFilter(bpy.types.Operator, Operator):
def _execute(self, context):
obj = bpy.context.scene.camera
if obj:
obj.data.BIMCameraProperties.filter_mode = self.filter_mode
if not obj:
return
obj.data.BIMCameraProperties.filter_mode = self.filter_mode
element = tool.Ifc.get_entity(obj)
if query := ifcopenshell.util.element.get_pset(element, "EPset_Drawing", self.filter_mode.title()):
filter_groups = tool.Search.get_filter_groups(f"drawing_{self.filter_mode.lower()}")
try:
tool.Search.import_filter_query(query, filter_groups)
except:
pass
class EditElementFilter(bpy.types.Operator, Operator):
@@ -66,6 +66,11 @@ def get_location_hint(self, context):
def update_diagram_scale(self, context):
if not context.scene.camera or context.scene.camera.data != self.id_data:
return
element = tool.Ifc.get_entity(context.scene.camera)
if not element:
return
try:
element = (
tool.Ifc.get()
@@ -87,6 +92,11 @@ def update_diagram_scale(self, context):
def update_is_nts(self, context):
if not context.scene.camera or context.scene.camera.data != self.id_data:
return
element = tool.Ifc.get_entity(context.scene.camera)
if not element:
return
try:
element = (
tool.Ifc.get()
@@ -93,7 +93,7 @@ class SvgWriter:
def setup_drawing_resource_paths(self, element):
pset = ifcopenshell.util.element.get_pset(element, "EPset_Drawing")
for resource in ("Stylesheet", "Markers", "Symbols", "Patterns"):
for resource in ("Stylesheet", "Markers", "Symbols", "Patterns", "ShadingStyles"):
resource_path = pset.get(resource)
if not resource_path:
self.resource_paths[resource] = None
@@ -175,7 +175,7 @@ class BIM_PT_object_material(Panel):
if ObjectMaterialData.data["type_material"]:
row = self.layout.row(align=True)
row.label(text="Inherited Material: " + ObjectMaterialData.data["type_material"], icon="FILE_PARENT")
row.label(text="Inherited Material: " + ObjectMaterialData.data["type_material"], icon="CON_CHILDOF")
if ObjectMaterialData.data["material_class"]:
return self.draw_material_ui()
@@ -25,6 +25,8 @@ classes = (
operator.AppendLibraryElement,
operator.AppendLibraryElementByQuery,
operator.AssignLibraryDeclaration,
operator.BIM_OT_load_clipping_planes,
operator.BIM_OT_save_clipping_planes,
operator.ChangeLibraryElement,
operator.CreateClippingPlane,
operator.CreateProject,
@@ -39,6 +39,8 @@ from blenderbim.bim.ifc import IfcStore
from blenderbim.bim.ui import IFCFileSelector
from blenderbim.bim import import_ifc
from blenderbim.bim import export_ifc
from collections import defaultdict
import json
from math import radians
from pathlib import Path
from mathutils import Vector, Matrix
@@ -734,7 +736,7 @@ class LoadProjectElements(bpy.types.Operator):
def execute(self, context):
self.props = context.scene.BIMProjectProperties
self.file = IfcStore.get_file()
blenderbim.bim.schema.reload(self.file.schema)
blenderbim.bim.schema.reload(self.file.schema_identifier)
start = time.time()
logger = logging.getLogger("ImportIFC")
path_log = os.path.join(context.scene.BIMProperties.data_dir, "process.log")
@@ -1425,7 +1427,7 @@ class LoadLinkedProject(bpy.types.Operator):
return {"FINISHED"}
def is_local(self, shape):
m = shape.transformation.matrix.data
m = shape.transformation.matrix
if max([abs(co) for co in (m[9], m[10], m[11])]) > 1000:
return False
elif max([abs(co) for co in shape.geometry.verts[0:3]]) > 1000:
@@ -1434,13 +1436,13 @@ class LoadLinkedProject(bpy.types.Operator):
def process_occurrence(self, shape):
element = self.file.by_id(shape.id)
matrix = shape.transformation.matrix.data
matrix = shape.transformation.matrix
faces = shape.geometry.faces
verts = shape.geometry.verts
materials = shape.geometry.materials
material_ids = shape.geometry.material_ids
m = shape.transformation.matrix.data
m = shape.transformation.matrix
mat = np.array(([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1]))
mesh = self.meshes.get(shape.geometry.id, None)
@@ -1999,3 +2001,61 @@ class FlipClippingPlane(bpy.types.Operator):
obj.rotation_euler[0] += radians(180)
context.view_layer.update()
return {"FINISHED"}
CLIPPING_PLANES_FILE_NAME = "ClippingPlanes.json" # TODO un-hardcode :=
class BIM_OT_save_clipping_planes(bpy.types.Operator):
bl_idname = "bim.save_clipping_planes"
bl_label = "Save Clipping Planes"
bl_description = "Save Clipping Planes to Disk"
bl_options = {"REGISTER", "UNDO"}
@classmethod
def poll(cls, context):
if IfcStore.path:
return context.scene.BIMProjectProperties.clipping_planes
cls.poll_message_set("Please Save The IFC File")
def execute(self, context):
clipping_planes_to_serialize = defaultdict(dict)
clipping_planes = context.scene.BIMProjectProperties.clipping_planes
for clipping_plane in clipping_planes:
obj = clipping_plane.obj
name = obj.name
clipping_planes_to_serialize[name]["location"] = obj.location[0:3]
clipping_planes_to_serialize[name]["rotation"] = obj.rotation_euler[0:3]
with open(Path(IfcStore.path).with_name(CLIPPING_PLANES_FILE_NAME), "w") as file:
json.dump(clipping_planes_to_serialize, file, indent=4)
return {"FINISHED"}
class BIM_OT_load_clipping_planes(bpy.types.Operator):
bl_idname = "bim.load_clipping_planes"
bl_label = "Load Clipping Planes"
bl_description = "Load Clipping Planes from Disk"
bl_options = {"REGISTER", "UNDO"}
@classmethod
def poll(cls, context):
if filepath := IfcStore.path:
if Path(filepath).with_name(CLIPPING_PLANES_FILE_NAME).exists():
return True
else:
cls.poll_message_set(f"No Clipping Planes File in Folder {filepath}")
else:
cls.poll_message_set("Please Save The IFC File")
def execute(self, context):
bpy.data.batch_remove(context.scene.BIMProjectProperties.clipping_planes_objs)
context.scene.BIMProjectProperties.clipping_planes.clear()
with open(Path(IfcStore.path).with_name(CLIPPING_PLANES_FILE_NAME), "r") as file:
clipping_planes_dict = json.load(file)
for name, values in clipping_planes_dict.items():
bpy.ops.bim.create_clipping_plane()
obj = context.scene.BIMProjectProperties.clipping_planes_objs[-1]
obj.name = name
obj.location = values["location"]
obj.rotation_euler = values["rotation"]
return {"FINISHED"}
@@ -69,6 +69,7 @@ class ObjectPsetsData(Data):
@classmethod
def load(cls):
cls.data = {
"is_occurrence": cls.is_occurrence(),
"psets": cls.psetqtos(tool.Ifc.get_entity(bpy.context.active_object), psets_only=True),
"inherited_psets": cls.inherited_psets(),
"pset_name": cls.pset_name(),
@@ -76,6 +77,10 @@ class ObjectPsetsData(Data):
}
cls.is_loaded = True
@classmethod
def is_occurrence(cls):
return not tool.Ifc.get_entity(bpy.context.active_object).is_a("IfcTypeObject")
@classmethod
def inherited_psets(cls):
element = tool.Ifc.get_entity(bpy.context.active_object)
@@ -126,11 +131,16 @@ class ObjectQtosData(Data):
@classmethod
def load(cls):
cls.data = {
"is_occurrence": cls.is_occurrence(),
"qtos": cls.psetqtos(tool.Ifc.get_entity(bpy.context.active_object), qtos_only=True),
"inherited_qsets": cls.inherited_qsets(),
}
cls.is_loaded = True
@classmethod
def is_occurrence(cls):
return not tool.Ifc.get_entity(bpy.context.active_object).is_a("IfcTypeObject")
@classmethod
def inherited_qsets(cls):
element = tool.Ifc.get_entity(bpy.context.active_object)
@@ -208,12 +208,15 @@ class BIM_PT_object_psets(Panel):
draw_psetqto_ui(context, 0, {}, props, self.layout, "Object")
if ObjectPsetsData.data["psets"]:
self.layout.label(text="Instance:")
if ObjectPsetsData.data["is_occurrence"]:
self.layout.label(text="Occurrence Properties:")
else:
self.layout.label(text="Type Properties:")
for pset in ObjectPsetsData.data["psets"]:
draw_psetqto_ui(context, pset["id"], pset, props, self.layout, "Object")
if ObjectPsetsData.data["inherited_psets"]:
self.layout.label(text="Type:")
self.layout.label(text="Inherited Type Properties:", icon="CON_CHILDOF")
for pset in ObjectPsetsData.data["inherited_psets"]:
draw_psetqto_ui(context, pset["id"], pset, props, self.layout, "Object", allow_removing=False)
@@ -252,12 +255,15 @@ class BIM_PT_object_qtos(Panel):
draw_psetqto_ui(context, 0, {}, props, self.layout, "Object")
if ObjectQtosData.data["qtos"]:
self.layout.label(text="Instance:")
if ObjectQtosData.data["is_occurrence"]:
self.layout.label(text="Occurrence Quantities:")
else:
self.layout.label(text="Type Quantities:")
for qto in ObjectQtosData.data["qtos"]:
draw_psetqto_ui(context, qto["id"], qto, props, self.layout, "Object")
if ObjectQtosData.data["inherited_qsets"]:
self.layout.label(text="Type:")
self.layout.label(text="Inherited Type Quantities:", icon="CON_CHILDOF")
for qset in ObjectQtosData.data["inherited_qsets"]:
draw_psetqto_ui(context, qset["id"], qset, props, self.layout, "Object", allow_removing=False)
@@ -42,6 +42,7 @@ class IfcClassData:
cls.data["contexts"] = cls.contexts()
cls.data["has_entity"] = cls.has_entity()
cls.data["name"] = cls.name()
cls.data["has_inherited_predefined_type"] = cls.has_inherited_predefined_type()
cls.data["ifc_class"] = cls.ifc_class()
cls.data["ifc_predefined_types"] = cls.ifc_predefined_types()
cls.data["can_reassign_class"] = cls.can_reassign_class()
@@ -162,6 +163,16 @@ class IfcClassData:
name += f"[{predefined_type}]"
return name
@classmethod
def has_inherited_predefined_type(cls):
element = tool.Ifc.get_entity(bpy.context.view_layer.objects.active)
if not element:
return
if element_type := ifcopenshell.util.element.get_type(element):
# Allow for None due to https://github.com/buildingSMART/IFC4.3.x-development/issues/818
return ifcopenshell.util.element.get_predefined_type(element_type) not in ("NOTDEFINED", None)
return False
@classmethod
def ifc_class(cls):
element = tool.Ifc.get_entity(bpy.context.view_layer.objects.active)
@@ -61,7 +61,10 @@ class BIM_PT_class(Panel):
self.layout.prop(context.scene.BIMRootProperties, "relating_class_object", icon="COPYDOWN")
else:
row = self.layout.row(align=True)
row.label(text=IfcClassData.data["name"])
row.label(
text=IfcClassData.data["name"],
icon="CON_CHILDOF" if IfcClassData.data["has_inherited_predefined_type"] else "NONE",
)
row.operator("bim.select_ifc_class", text="", icon="RESTRICT_SELECT_OFF")
row.operator("bim.unlink_object", icon="UNLINKED", text="")
if IfcClassData.data["can_reassign_class"]:
@@ -235,7 +235,7 @@ class LoadSearch(Operator, tool.Ifc.Operator):
def _execute(self, context):
filter_groups = tool.Search.get_filter_groups(self.module)
group = tool.Ifc.get().by_id(int(context.scene.BIMSearchProperties.saved_searches))
query = tool.Search.import_filter_query(tool.Search.get_group_query(group), filter_groups)
tool.Search.import_filter_query(tool.Search.get_group_query(group), filter_groups)
def draw(self, context):
props = context.scene.BIMSearchProperties
+8 -1
View File
@@ -131,6 +131,8 @@ class BIM_PT_section_with_cappings(Panel):
box = layout.box()
header = box.row(align=True)
header.label(text="Clipping Planes")
header.operator("bim.save_clipping_planes", text="", icon="EXPORT")
header.operator("bim.load_clipping_planes", text="", icon="IMPORT")
header.operator("bim.create_clipping_plane", text="", icon="ADD")
box.template_list(
@@ -150,7 +152,7 @@ class BIM_PT_section_with_cappings(Panel):
class BIM_UL_clipping_plane(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
if item:
if item and item.obj:
obj = item.obj
row = layout.row(align=True)
row.prop(obj, "name", text="", emboss=False)
@@ -202,6 +204,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
name="Should Make A Cha-Ching Sound When Project Costs Updates", default=False
)
lock_grids_on_import: BoolProperty(name="Should Lock Grids By Default", default=True)
spatial_elements_unselectable: BoolProperty(name="Should Make Spatial Elements Unselectable By Default", default=True)
decorations_colour: bpy.props.FloatVectorProperty(
name="Decorations Colour", subtype="COLOR", default=(1, 1, 1, 1), min=0.0, max=1.0, size=4
)
@@ -283,6 +286,10 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
row.prop(self, "should_play_chaching_sound")
row = layout.row()
row.prop(self, "lock_grids_on_import")
row = layout.row()
row.prop(self, "spatial_elements_unselectable")
row = layout.row()
row.prop(context.scene.BIMProjectProperties, "should_disable_undo_on_save")
+1 -1
View File
@@ -74,7 +74,7 @@ def assign_brick_reference(ifc, brick, element=None, library=None, brick_uri=Non
if not reference:
reference = ifc.run("library.add_reference", library=library)
ifc.run("library.edit_reference", reference=reference, attributes=brick.export_brick_attributes(brick_uri))
ifc.run("library.assign_reference", product=element, reference=reference)
ifc.run("library.assign_reference", products=[element], reference=reference)
project = brick.get_brickifc_project()
if not project:
project = brick.add_brickifc_project(brick.get_namespace(brick_uri))
+2 -2
View File
@@ -109,8 +109,8 @@ def remove_document(ifc, document_tool, document=None):
def assign_document(ifc, product=None, document=None):
ifc.run("document.assign_document", product=product, document=document)
ifc.run("document.assign_document", products=[product], document=document)
def unassign_document(ifc, product=None, document=None):
ifc.run("document.unassign_document", product=product, document=document)
ifc.run("document.unassign_document", products=[product], document=document)
+11 -3
View File
@@ -16,6 +16,8 @@
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
from pathlib import Path
def enable_editing_text(drawing, obj=None):
drawing.enable_editing_text(obj)
@@ -89,6 +91,12 @@ def add_sheet(ifc, drawing, titleblock=None):
drawing.import_sheets()
def regenerate_sheet(drawing, sheet=None):
titleblock_uri = drawing.get_document_uri(sheet, "TITLEBLOCK")
drawing.create_svg_sheet(sheet, drawing.sanitise_filename(Path(titleblock_uri).stem))
drawing.add_drawings(sheet)
def open_sheet(drawing, sheet=None):
drawing.open_layout_svg(drawing.get_document_uri(sheet, "LAYOUT"))
@@ -241,7 +249,7 @@ def add_drawing(ifc, collector, drawing, target_view=None, location_hint=None):
attributes = {"Identification": "X", "Name": drawing_name, "Scope": "DRAWING"}
ifc.run("document.edit_information", information=information, attributes=attributes)
ifc.run("document.edit_reference", reference=reference, attributes={"Location": uri})
ifc.run("document.assign_document", product=element, document=reference)
ifc.run("document.assign_document", products=[element], document=reference)
drawing.import_drawings()
@@ -265,7 +273,7 @@ def duplicate_drawing(ifc, drawing_tool, drawing=None, should_duplicate_annotati
ifc.run("group.assign_group", group=new_group, products=[new_annotation])
old_reference = drawing_tool.get_drawing_document(new_drawing)
ifc.run("document.unassign_document", product=new_drawing, document=old_reference)
ifc.run("document.unassign_document", products=[new_drawing], document=old_reference)
information = ifc.run("document.add_information")
uri = drawing_tool.get_default_drawing_path(drawing_name)
@@ -276,7 +284,7 @@ def duplicate_drawing(ifc, drawing_tool, drawing=None, should_duplicate_annotati
attributes = {"Identification": "X", "Name": drawing_name, "Scope": "DRAWING"}
ifc.run("document.edit_information", information=information, attributes=attributes)
ifc.run("document.edit_reference", reference=reference, attributes={"Location": uri})
ifc.run("document.assign_document", product=new_drawing, document=reference)
ifc.run("document.assign_document", products=[new_drawing], document=reference)
drawing_tool.import_drawings()
return new_drawing
+2 -2
View File
@@ -83,8 +83,8 @@ def edit_library_reference(ifc, library):
def assign_library_reference(ifc, obj=None, reference=None):
ifc.run("library.assign_reference", product=ifc.get_entity(obj), reference=reference)
ifc.run("library.assign_reference", products=[ifc.get_entity(obj)], reference=reference)
def unassign_library_reference(ifc, obj=None, reference=None):
ifc.run("library.unassign_reference", product=ifc.get_entity(obj), reference=reference)
ifc.run("library.unassign_reference", products=[ifc.get_entity(obj)], reference=reference)
+2 -2
View File
@@ -195,7 +195,7 @@ def add_usage_constraint(ifc, resource_tool, resource=None, reference_path=None)
},
)
ifc.run("constraint.add_metric_reference", metric=metric, reference_path=reference_path)
ifc.run("constraint.assign_constraint", product=resource, constraint=objective)
ifc.run("constraint.assign_constraint", products=[resource], constraint=objective)
def remove_usage_constraint(ifc, resource_tool, resource, reference_path):
@@ -206,7 +206,7 @@ def remove_usage_constraint(ifc, resource_tool, resource, reference_path):
reference = resource_tool.get_metric_reference(metric, is_deep=True)
if reference == reference_path:
ifc.run("constraint.remove_metric", metric=metric)
ifc.run("constraint.unassign_constraint", product=resource, constraint=constraint)
ifc.run("constraint.unassign_constraint", products=[resource], constraint=constraint)
ifc.run("constraint.remove_constraint", constraint=constraint)
+2 -2
View File
@@ -32,7 +32,7 @@ def reference_structure(
element: Optional[ifcopenshell.entity_instance] = None,
) -> Union[ifcopenshell.entity_instance, None]:
if spatial.can_reference(structure, element):
return ifc.run("spatial.reference_structure", product=element, relating_structure=structure)
return ifc.run("spatial.reference_structure", products=[element], relating_structure=structure)
def dereference_structure(
@@ -42,7 +42,7 @@ def dereference_structure(
element: Optional[ifcopenshell.entity_instance] = None,
) -> None:
if spatial.can_reference(structure, element):
return ifc.run("spatial.dereference_structure", product=element, relating_structure=structure)
return ifc.run("spatial.dereference_structure", products=[element], relating_structure=structure)
def assign_container(
@@ -187,6 +187,9 @@ class Collector(blenderbim.core.tool.Collector):
if any(e for e in element.IsNestedBy[0].RelatedObjects if not e.is_a("IfcPort")):
return cls._create_own_collection(obj)
if getattr(element, "HasSurfaceFeatures", None):
return cls._create_own_collection(obj)
@classmethod
def _get_collection(cls, element: ifcopenshell.entity_instance, obj: bpy.types.Object) -> bpy.types.Collection:
"""get or create collection for the element based on it's type"""
@@ -247,6 +250,13 @@ class Collector(blenderbim.core.tool.Collector):
if collection:
return collection
if element.is_a("IfcSurfaceFeature") and element.file.schema == "IFC4X3":
adherend = element.AdheresToElement[0].RelatingElement
adherend_obj = tool.Ifc.get_object(adherend)
collection = adherend_obj.BIMObjectProperties.collection
if collection:
return collection
if element.is_a("IfcProject"):
return bpy.context.scene.collection
+23 -6
View File
@@ -247,6 +247,21 @@ class Drawing(blenderbim.core.tool.Drawing):
sheet_builder.create(uri, titleblock)
return uri
@classmethod
def add_drawings(cls, sheet):
sheet_builder = sheeter.SheetBuilder()
sheet_builder.data_dir = bpy.context.scene.BIMProperties.data_dir
sheet_reference = None
drawing_names = []
for reference in cls.get_document_references(sheet):
if reference.Description == "LAYOUT":
sheet_reference = reference
elif reference.Description == "DRAWING":
drawing_names.append(Path(reference.Location).stem)
for annotation in [e for e in tool.Ifc.get().by_type("IfcAnnotation") if e.ObjectType == "DRAWING"]:
if annotation.Name in drawing_names:
sheet_builder.add_drawing(sheet_reference, annotation, sheet)
@classmethod
def delete_collection(cls, collection):
bpy.data.collections.remove(collection, do_unlink=True)
@@ -677,7 +692,7 @@ class Drawing(blenderbim.core.tool.Drawing):
cls.import_camera_props(drawing, obj)
tool.Ifc.link(drawing, obj)
m = shape.transformation.matrix.data
m = shape.transformation.matrix
mat = mathutils.Matrix(
([m[0], m[3], m[6], m[9]], [m[1], m[4], m[7], m[10]], [m[2], m[5], m[8], m[11]], [0, 0, 0, 1])
)
@@ -733,7 +748,6 @@ class Drawing(blenderbim.core.tool.Drawing):
obj.BIMObjectProperties.ifc_definition_id = ifc_definition_id
@classmethod
def import_drawings(cls):
props = bpy.context.scene.DocProperties
@@ -1776,7 +1790,6 @@ class Drawing(blenderbim.core.tool.Drawing):
element_obj_names = set()
for element in filtered_elements:
obj = tool.Ifc.get_object(element)
element_obj_names.add(obj.name)
current_representation = tool.Geometry.get_active_representation(obj)
if current_representation:
subcontext = current_representation.ContextOfItems
@@ -1805,10 +1818,14 @@ class Drawing(blenderbim.core.tool.Drawing):
# Don't hide IfcAnnotations as some of them might exist without representations
if has_context or element.is_a("IfcAnnotation"):
# Note that render visibility is only set on drawing generation time for speed.
obj.hide_set(False)
element_obj_names.add(obj.name)
[obj.hide_set(False) for obj in bpy.context.view_layer.objects if obj.name not in element_obj_names]
# Note that render visibility is only set on drawing generation time for speed.
[
obj.hide_set(False) # Show the object
for obj in bpy.context.view_layer.objects
if obj.name in element_obj_names or not tool.Ifc.get_entity(obj)
]
cls.import_camera_props(drawing, camera)
+12 -1
View File
@@ -91,6 +91,17 @@ class Geometry(blenderbim.core.tool.Geometry):
if element.is_a("IfcRelSpaceBoundary"):
ifcopenshell.api.run("boundary.remove_boundary", tool.Ifc.get(), boundary=element)
return bpy.data.objects.remove(obj)
if element.is_a("IfcGridAxis"):
is_last_axis = False
# Deleting the last W axis is OK
if ((grid := element.PartOfU) and len(grid[0].UAxes) == 1) or (
(grid := element.PartOfV) and len(grid[0].VAxes) == 1
):
is_last_axis = True
if is_last_axis:
return
ifcopenshell.api.run("grid.remove_grid_axis", tool.Ifc.get(), axis=element)
return bpy.data.objects.remove(obj)
collection = obj.BIMObjectProperties.collection
if collection:
@@ -611,7 +622,7 @@ class Geometry(blenderbim.core.tool.Geometry):
obj.data.BIMMeshProperties.material_checksum = str([s.id() for s in cls.get_styles(obj) if s])
@classmethod
def record_object_position(cls, obj):
def record_object_position(cls, obj: bpy.types.Object) -> None:
# These are recorded separately because they have different numerical tolerances
obj.BIMObjectProperties.location_checksum = repr(np.array(obj.matrix_world.translation).tobytes())
obj.BIMObjectProperties.rotation_checksum = repr(np.array(obj.matrix_world.to_3x3()).tobytes())
+4 -2
View File
@@ -29,12 +29,14 @@ Some of these add-ons are not shipped with Blender:
- `Sverchok <https://github.com/nortikin/sverchok/>`__ - Sverchok is a visual
programming add-on for Blender that allows you to generate parametric
geometry, create scripts for non-programmers, model solids from FreeCAD, and
much more.
much more. There is also
`IfcSverchok <https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcsverchok/README.md/>`__
that adds IFC features to Sverchok.
- `BlenderGIS <https://github.com/domlysz/BlenderGIS>`__ - BlenderGIS lets you
import GIS data, grab elevation data from the web, and generate TINs from
survey points and contours.
- `Ladybug Tools for Blender
<https://blenderbim.org/builds/ladybug-blender-220127.zip>`__ - Ladybug Tools
<https://github.com/Andrej730/ladybug-blender/releases/download/ladybug-blender-240419/ladybug-blender-240419.zip>`__ - Ladybug Tools
is an extension of Sverchok for environmental analysis and building physics
simulation. It allows analysis of solar, daylight, energy, and CFD.
- `Topologic <https://topologic.app/>`__ - Perform spatial and topological
+4 -4
View File
@@ -124,21 +124,21 @@ class TestAssignBrickReference:
ifc.run("library.add_reference", library="library").should_be_called().will_return("reference")
brick.export_brick_attributes("brick_uri").should_be_called().will_return("attributes")
ifc.run("library.edit_reference", reference="reference", attributes="attributes").should_be_called()
ifc.run("library.assign_reference", product="element", reference="reference").should_be_called()
ifc.run("library.assign_reference", products=["element"], reference="reference").should_be_called()
brick.get_brickifc_project().should_be_called().will_return("project")
brick.add_brickifc_reference("brick_uri", "element", "project").should_be_called()
subject.assign_brick_reference(ifc, brick, element="element", library="library", brick_uri="brick_uri")
def test_assigning_to_an_existing_reference(self, ifc, brick):
brick.get_library_brick_reference("library", "brick_uri").should_be_called().will_return("reference")
ifc.run("library.assign_reference", product="element", reference="reference").should_be_called()
ifc.run("library.assign_reference", products=["element"], reference="reference").should_be_called()
brick.get_brickifc_project().should_be_called().will_return("project")
brick.add_brickifc_reference("brick_uri", "element", "project").should_be_called()
subject.assign_brick_reference(ifc, brick, element="element", library="library", brick_uri="brick_uri")
def test_adding_a_brickifc_project_if_it_doesnt_exist(self, ifc, brick):
brick.get_library_brick_reference("library", "brick_uri").should_be_called().will_return("reference")
ifc.run("library.assign_reference", product="element", reference="reference").should_be_called()
ifc.run("library.assign_reference", products=["element"], reference="reference").should_be_called()
brick.get_brickifc_project().should_be_called().will_return(None)
brick.get_namespace("brick_uri").should_be_called().will_return("namespace")
brick.add_brickifc_project("namespace").should_be_called().will_return("project")
@@ -277,4 +277,4 @@ class TestSetBrickListRoot:
class TestRemoveBrickRelation:
def test_run(self, brick):
brick.remove_relation("brick_uri", "predicate", "object").should_be_called()
subject.remove_brick_relation(brick, brick_uri="brick_uri", predicate="predicate", object="object")
subject.remove_brick_relation(brick, brick_uri="brick_uri", predicate="predicate", object="object")
+2 -2
View File
@@ -133,11 +133,11 @@ class TestRemoveDocument:
class TestAssignDocument:
def test_run(self, ifc):
ifc.run("document.assign_document", product="product", document="document").should_be_called()
ifc.run("document.assign_document", products=["product"], document="document").should_be_called()
subject.assign_document(ifc, product="product", document="document")
class TestUnassignDocument:
def test_run(self, ifc):
ifc.run("document.unassign_document", product="product", document="document").should_be_called()
ifc.run("document.unassign_document", products=["product"], document="document").should_be_called()
subject.unassign_document(ifc, product="product", document="document")
+3 -3
View File
@@ -365,7 +365,7 @@ class TestAddDrawing:
attributes={"Identification": "X", "Name": "name", "Scope": "DRAWING"},
).should_be_called()
ifc.run("document.edit_reference", reference="reference", attributes={"Location": "uri"}).should_be_called()
ifc.run("document.assign_document", product="element", document="reference").should_be_called()
ifc.run("document.assign_document", products=["element"], document="reference").should_be_called()
drawing.import_drawings().should_be_called()
subject.add_drawing(ifc, collector, drawing, target_view="target_view", location_hint="location_hint")
@@ -391,7 +391,7 @@ class TestDuplicateDrawing:
ifc.run("group.assign_group", group="new_group", products=["new_annotation"]).should_be_called()
drawing.get_drawing_document("new_drawing").should_be_called().will_return("old_reference")
ifc.run("document.unassign_document", product="new_drawing", document="old_reference").should_be_called()
ifc.run("document.unassign_document", products=["new_drawing"], document="old_reference").should_be_called()
ifc.run("document.add_information").should_be_called().will_return("information")
ifc.run("document.add_reference", information="information").should_be_called().will_return("reference")
@@ -405,7 +405,7 @@ class TestDuplicateDrawing:
ifc.run(
"document.edit_reference", reference="reference", attributes={"Location": "drawing_path"}
).should_be_called()
ifc.run("document.assign_document", product="new_drawing", document="reference").should_be_called()
ifc.run("document.assign_document", products=["new_drawing"], document="reference").should_be_called()
drawing.import_drawings().should_be_called()
subject.duplicate_drawing(ifc, drawing, drawing="drawing", should_duplicate_annotations=True)
+2 -2
View File
@@ -114,12 +114,12 @@ class TestEditLibraryReference:
class TestAssignLibraryReference:
def test_run(self, ifc):
ifc.get_entity("obj").should_be_called().will_return("product")
ifc.run("library.assign_reference", product="product", reference="reference").should_be_called()
ifc.run("library.assign_reference", products=["product"], reference="reference").should_be_called()
subject.assign_library_reference(ifc, obj="obj", reference="reference")
class TestUnassignLibraryReference:
def test_run(self, ifc):
ifc.get_entity("obj").should_be_called().will_return("product")
ifc.run("library.unassign_reference", product="product", reference="reference").should_be_called()
ifc.run("library.unassign_reference", products=["product"], reference="reference").should_be_called()
subject.unassign_library_reference(ifc, obj="obj", reference="reference")
+2 -2
View File
@@ -23,14 +23,14 @@ from test.core.bootstrap import ifc, collector, spatial
class TestReferenceStructure:
def test_run(self, ifc, spatial):
spatial.can_reference("structure", "element").should_be_called().will_return(True)
ifc.run("spatial.reference_structure", product="element", relating_structure="structure").should_be_called()
ifc.run("spatial.reference_structure", products=["element"], relating_structure="structure").should_be_called()
subject.reference_structure(ifc, spatial, structure="structure", element="element")
class TestDereferenceStructure:
def test_run(self, ifc, spatial):
spatial.can_reference("structure", "element").should_be_called().will_return(True)
ifc.run("spatial.dereference_structure", product="element", relating_structure="structure").should_be_called()
ifc.run("spatial.dereference_structure", products=["element"], relating_structure="structure").should_be_called()
subject.dereference_structure(ifc, spatial, structure="structure", element="element")
+2 -1
View File
@@ -18,6 +18,7 @@
import bpy
import ifcopenshell
import ifcopenshell.api
import blenderbim.core.tool
import blenderbim.tool as tool
from test.bim.bootstrap import NewFile
@@ -188,7 +189,7 @@ class TestImportReferences(NewFile):
assert len(props.documents) == 1
assert props.documents[0].ifc_definition_id == reference.id()
assert props.documents[0].name == "Unnamed"
assert props.documents[0].identification == "*"
assert props.documents[0].identification == "X"
assert props.documents[0].is_information is False
+8 -3
View File
@@ -50,6 +50,7 @@ Schema::IfcProject* setup_project(IfcHierarchyHelper<Schema>& file) {
auto project = file.addProject();
project->setName(std::string("FHWA Bridge Geometry Manual Example Alignment"));
project->setDescription(std::string("C++ Example"));
// set up project units for feet
// the call to file.addProject() sets up length units as millimeter.
@@ -151,7 +152,7 @@ std::pair<typename Schema::IfcCurveSegment*, typename Schema::IfcAlignmentSegmen
// creates geometry and business logic segments for vertical profile parabolic vertical curves
std::pair<typename Schema::IfcCurveSegment*, typename Schema::IfcAlignmentSegment*> create_vcurve(typename Schema::IfcCartesianPoint* p, double start_slope, double end_slope, double length) {
// geometry
double A = 0.0;
double A = p->Coordinates()[1];
double B = start_slope;
double C = (end_slope - start_slope) / (2 * length);
@@ -163,7 +164,7 @@ std::pair<typename Schema::IfcCurveSegment*, typename Schema::IfcAlignmentSegmen
auto curve_segment = new Schema::IfcCurveSegment(
Schema::IfcTransitionCode::IfcTransitionCode_CONTSAMEGRADIENT,
new Schema::IfcAxis2Placement2D(p, new Schema::IfcDirection(std::vector<double>{1.0, 0.0})),
new Schema::IfcAxis2Placement2D(p, new Schema::IfcDirection(std::vector<double>{sqrt(1 - start_slope * start_slope), start_slope})),
new Schema::IfcLengthMeasure(0.0),
new Schema::IfcLengthMeasure(length),
parent_curve);
@@ -394,6 +395,7 @@ int main() {
// Zero-length terminator
auto vertical_terminator_segment = create_gradient(vpoe, -0.5 / 100, 0.0);
vertical_terminator_segment.first->setTransition(Schema::IfcTransitionCode::IfcTransitionCode_DISCONTINUOUS);
vertical_curve_segments->push(vertical_terminator_segment.first);
vertical_segments->push(vertical_terminator_segment.second);
@@ -479,7 +481,10 @@ int main() {
auto site = file.addSite(project, nullptr);
site->setName(os.str());
auto rel_referenced_in_spatial_structure = new Schema::IfcRelReferencedInSpatialStructure(IfcParse::IfcGlobalId(), nullptr, boost::none, boost::none, list_alignments_referenced_in_site, site);
std::ostringstream description;
description << "Alignments referenced into the spatial structure of Bridge Site " << i;
auto rel_referenced_in_spatial_structure = new Schema::IfcRelReferencedInSpatialStructure(IfcParse::IfcGlobalId(), nullptr, boost::none, description.str(), list_alignments_referenced_in_site, site);
file.addEntity(rel_referenced_in_spatial_structure);
}
+11 -11
View File
@@ -119,7 +119,7 @@ void process_pset(element_properties& props, const T* inst) {
auto ps = pset->HasProperties();
for (auto it = ps->begin(); it != ps->end(); ++it) {
auto& p = *it;
if (auto singleval = p->as<typename Schema::IfcPropertySingleValue>()) {
if (auto singleval = p->template as<typename Schema::IfcPropertySingleValue>()) {
std::string propname, propvalue;
if constexpr (is_ifc4_or_higher<Schema>::value) {
if (!singleval->Name()) {
@@ -133,26 +133,26 @@ void process_pset(element_properties& props, const T* inst) {
if (!singleval->NominalValue()) {
propvalue = "-";
} else {
props[*pset->Name()][propname] = format_string(singleval->NominalValue()->as<IfcUtil::IfcBaseClass>()->data().getArgument(0));
props[*pset->Name()][propname] = format_string(singleval->NominalValue()->template as<IfcUtil::IfcBaseClass>()->data().getArgument(0));
}
}
}
}
if (auto qset = inst->as<typename Schema::IfcElementQuantity>()) {
if (auto qset = inst->template as<typename Schema::IfcElementQuantity>()) {
if (!qset->Name()) {
return;
}
auto qs = qset->Quantities();
for (auto it = qs->begin(); it != qs->end(); ++it) {
auto& q = *it;
if (q->as<typename Schema::IfcPhysicalSimpleQuantity>() && q->data().getArgument(3)->type() == IfcUtil::Argument_DOUBLE) {
if (q->template as<typename Schema::IfcPhysicalSimpleQuantity>() && q->data().getArgument(3)->type() == IfcUtil::Argument_DOUBLE) {
double v = *q->data().getArgument(3);
props[*qset->Name()][q->Name()] = std::to_string(v);
}
}
}
if constexpr (is_ifc4_or_higher<Schema>::value) {
if (auto extprops = inst->as<Schema::IfcExtendedProperties>()) {
if (auto extprops = inst->template as<typename Schema::IfcExtendedProperties>()) {
// @todo
}
}
@@ -161,7 +161,7 @@ void process_pset(element_properties& props, const T* inst) {
template <typename Schema>
void get_psets_s(element_properties& props, const typename Schema::IfcObjectDefinition* inst) {
// Extracts the property definitions for an IFC instance.
if (auto tyob = inst->as<typename Schema::IfcTypeObject>()) {
if (auto tyob = inst->template as<typename Schema::IfcTypeObject>()) {
if (tyob->HasPropertySets()) {
auto defs = *tyob->HasPropertySets();
for (auto it = defs->begin(); it != defs->end(); ++it) {
@@ -171,14 +171,14 @@ void get_psets_s(element_properties& props, const typename Schema::IfcObjectDefi
}
}
if constexpr (is_ifc4_or_higher<Schema>::value) {
if (auto mdef = inst->as<typename Schema::IfcMaterialDefinition>()) {
if (auto mdef = inst->template as<typename Schema::IfcMaterialDefinition>()) {
auto defs = mdef->HasProperties();
for (auto it = defs->begin(); it != defs->end(); ++it) {
auto& def = *it;
process_pset<Schema>(props, def);
}
}
if (auto pdef = inst->as<typename Schema::IfcProfileDef>()) {
if (auto pdef = inst->template as<typename Schema::IfcProfileDef>()) {
auto defs = pdef->HasProperties();
for (auto it = defs->begin(); it != defs->end(); ++it) {
auto& def = *it;
@@ -186,7 +186,7 @@ void get_psets_s(element_properties& props, const typename Schema::IfcObjectDefi
}
}
}
if (auto ob = inst->as<typename Schema::IfcObject>()) {
if (auto ob = inst->template as<typename Schema::IfcObject>()) {
if constexpr (is_ifc4_or_higher<Schema>::value) {
auto rels = ob->IsTypedBy();
for (auto it = rels->begin(); it != rels->end(); ++it) {
@@ -198,9 +198,9 @@ void get_psets_s(element_properties& props, const typename Schema::IfcObjectDefi
auto rels = ob->IsDefinedBy();
for (auto it = rels->begin(); it != rels->end(); ++it) {
auto& rel = *it;
if (auto bytype = rel->as<typename Schema::IfcRelDefinesByType>()) {
if (auto bytype = rel->template as<typename Schema::IfcRelDefinesByType>()) {
get_psets_s<Schema>(props, bytype->RelatingType());
} else if (auto byprops = rel->as<typename Schema::IfcRelDefinesByProperties>()) {
} else if (auto byprops = rel->template as<typename Schema::IfcRelDefinesByProperties>()) {
process_pset<Schema>(props, byprops->RelatingPropertyDefinition());
}
}
+5 -1
View File
@@ -46,6 +46,7 @@ Schema::IfcProject* setup_project(IfcHierarchyHelper<Schema>& file) {
auto project = file.addProject();
project->setName(std::string("FHWA Bridge Geometry Manual Example Alignment"));
project->setDescription(std::string("C++ Example - Simplified"));
// set up project units for feet
// the call to file.addProject() sets up length units as millimeter.
@@ -150,7 +151,10 @@ int main() {
auto site = file.addSite(project, nullptr);
site->setName(os.str());
auto rel_referenced_in_spatial_structure = new Schema::IfcRelReferencedInSpatialStructure(IfcParse::IfcGlobalId(), nullptr, boost::none, boost::none, list_alignments_referenced_in_site, site);
std::ostringstream description;
description << "Alignments referenced into the spatial structure of Bridge Site " << i;
auto rel_referenced_in_spatial_structure = new Schema::IfcRelReferencedInSpatialStructure(IfcParse::IfcGlobalId(), nullptr, boost::none, description.str(), list_alignments_referenced_in_site, site);
file.addEntity(rel_referenced_in_spatial_structure);
}
+1 -1
View File
@@ -11,7 +11,7 @@ authors:
- name: "IfcOpenShell contributors"authors:
repository-code: >-
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.7.0/src/ifcbimtester
url: 'https://blenderbim.org/docs-python/bimtester.html'
url: 'https://docs.ifcopenshell.org/bimtester.html'
abstract: Wrapper for Gherkin based unit testing for IFC models
keywords:
- Gherkin
+2 -2
View File
@@ -814,7 +814,7 @@ int main(int argc, char** argv) {
}
}
if (!geometry_settings.get<ifcopenshell::geometry::settings::WeldVertices>().has()) {
if (vmap[ifcopenshell::geometry::settings::WeldVertices::name].defaulted()) {
geometry_settings.get<ifcopenshell::geometry::settings::WeldVertices>().value = false;
}
@@ -1508,7 +1508,7 @@ namespace latebound_access {
IfcParse::IfcGlobalId guid;
latebound_access::set(inst, "GlobalId", (std::string) guid);
}
return f.addEntity(inst);
return &*f.addEntity(inst);
}
}
+142 -2
View File
@@ -2,6 +2,7 @@
#include "../ifcgeom/IfcGeomElement.h"
#include "../ifcgeom/ConversionSettings.h"
#include "../ifcgeom/abstract_mapping.h"
#ifdef IFOPSH_WITH_OPENCASCADE
#include "../ifcgeom/kernels/opencascade/OpenCascadeKernel.h"
@@ -38,8 +39,109 @@ const Settings& ifcopenshell::geometry::kernels::AbstractKernel::settings() cons
return settings_;
}
ifcopenshell::geometry::kernels::AbstractKernel* ifcopenshell::geometry::kernels::construct(const std::string& geometry_library, const Settings& conv_settings) {
const std::string geometry_library_lower = boost::to_lower_copy(geometry_library);
bool is_valid_for_kernel(const ifcopenshell::geometry::kernels::AbstractKernel* k, const IfcGeom::ConversionResult& shp) {
#ifdef IFOPSH_WITH_OPENCASCADE
if (k->geometry_library() == "opencascade") {
return dynamic_cast<ifcopenshell::geometry::OpenCascadeShape*>(shp.Shape().get()) != nullptr;
}
#endif
#ifdef IFOPSH_WITH_CGAL
if (k->geometry_library() == "cgal-simple") {
return dynamic_cast<ifcopenshell::geometry::SimpleCgalShape*>(shp.Shape().get()) != nullptr;
}
if (k->geometry_library() == "cgal") {
return dynamic_cast<ifcopenshell::geometry::CgalShape*>(shp.Shape().get()) != nullptr;
}
#endif
}
class HybridKernel : public ifcopenshell::geometry::kernels::AbstractKernel {
std::vector<AbstractKernel*> kernels_;
ifcopenshell::geometry::abstract_mapping* mapping_;
public:
HybridKernel(const std::string& name, IfcParse::IfcFile* file, Settings& settings, std::vector<AbstractKernel*> kernels)
: AbstractKernel(name, settings)
, kernels_(kernels)
, mapping_(ifcopenshell::geometry::impl::mapping_implementations().construct(file, settings))
{}
virtual bool convert(const taxonomy::ptr item, IfcGeom::ConversionResults& rs) {
auto ops = mapping_->find_openings(item->instance->as<IfcUtil::IfcBaseEntity>());
bool has_openings = ops && ops->size();
for (auto& k : kernels_) {
#ifdef IFOPSH_WITH_CGAL
if (has_openings && dynamic_cast<ifcopenshell::geometry::kernels::SimpleCgalKernel*>(k)) {
// @todo this would fail later on in the find_openings() call, because we have a
// SimpleCgalShape which cannot be used on a kernel that supports booleans.
// @todo 1 implement the translation between various conversion result shapes
// @todo 2 fold the boolean result openings into the taxonomy item. This should be possible
// now that we have shared_ptr<item> and caching in place. So the inability
// to instance wouldn't matter as much.
continue;
}
#endif
bool success = false;
try {
success = k->convert(item, rs);
} catch(...) {}
if (success) {
return true;
}
}
return false;
}
virtual bool apply_layerset(IfcGeom::ConversionResults& items, const ifcopenshell::geometry::layerset_information& layers) {
for (auto& k : kernels_) {
bool success = false;
try {
success = k->apply_layerset(items, layers);
} catch (...) {}
if (success) {
return true;
}
}
return false;
}
virtual bool apply_folded_layerset(IfcGeom::ConversionResults& items, const ifcopenshell::geometry::layerset_information& layers, const std::map<IfcUtil::IfcBaseEntity*, ifcopenshell::geometry::layerset_information>& folds) {
for (auto& k : kernels_) {
bool success = false;
try {
success = k->apply_folded_layerset(items, layers, folds);
} catch (...) {}
if (success) {
return true;
}
}
return false;
}
virtual bool convert_openings(const IfcUtil::IfcBaseEntity* entity, const std::vector<std::pair<taxonomy::ptr, ifcopenshell::geometry::taxonomy::matrix4>>& openings,
const IfcGeom::ConversionResults& entity_shapes, const ifcopenshell::geometry::taxonomy::matrix4& entity_trsf, IfcGeom::ConversionResults& cut_shapes)
{
for (auto& k : kernels_) {
bool is_valid = true;
for (auto& s : entity_shapes) {
if (!is_valid_for_kernel(k, s)) {
is_valid = false;
break;
}
}
if (!is_valid) {
continue;
}
bool success = false;
try {
success = k->convert_openings(entity, openings, entity_shapes, entity_trsf, cut_shapes);
} catch (...) {}
if (success) {
return true;
}
}
return false;
}
};
ifcopenshell::geometry::kernels::AbstractKernel* ifcopenshell::geometry::kernels::construct(IfcParse::IfcFile* file, const std::string& geometry_library, Settings& conv_settings) {
std::string geometry_library_lower = boost::to_lower_copy(geometry_library);
#ifdef IFOPSH_WITH_OPENCASCADE
if (geometry_library_lower == "opencascade") {
@@ -56,6 +158,44 @@ ifcopenshell::geometry::kernels::AbstractKernel* ifcopenshell::geometry::kernels
return new SimpleCgalKernel(conv_settings);
}
#endif
if (geometry_library_lower.rfind("hybrid-", 0) == 0) {
geometry_library_lower = geometry_library_lower.substr(strlen("hybrid"));
std::vector<AbstractKernel*> kernels;
while (!geometry_library_lower.empty()) {
if (geometry_library_lower.find("-", 0) == 0) {
geometry_library_lower = geometry_library_lower.substr(strlen("-"));
} else {
throw IfcParse::IfcException("Invalid hybrid kernel " + geometry_library);
}
auto n = kernels.size();
#ifdef IFOPSH_WITH_OPENCASCADE
if (geometry_library_lower.find("opencascade", 0) == 0) {
kernels.push_back(new IfcGeom::OpenCascadeKernel(conv_settings));
geometry_library_lower = geometry_library_lower.substr(strlen("opencascade"));
}
#endif
#ifdef IFOPSH_WITH_CGAL
if (geometry_library_lower.find("cgal-simple", 0) == 0) {
kernels.push_back(new SimpleCgalKernel(conv_settings));
geometry_library_lower = geometry_library_lower.substr(strlen("cgal-simple"));
}
if (geometry_library_lower.find("cgal", 0) == 0) {
kernels.push_back(new CgalKernel(conv_settings));
geometry_library_lower = geometry_library_lower.substr(strlen("cgal"));
}
#endif
if (kernels.size() != n + 1) {
throw IfcParse::IfcException("Invalid hybrid kernel " + geometry_library);
}
}
if (!kernels.empty()) {
return new HybridKernel(geometry_library, file, conv_settings, kernels);
}
}
throw IfcParse::IfcException("No geometry kernel registered for " + geometry_library);
}
+8 -4
View File
@@ -19,16 +19,19 @@ namespace ifcopenshell { namespace geometry { namespace kernels {
class IFC_GEOM_API AbstractKernel {
protected:
std::string geometry_library;
std::string geometry_library_;
Settings settings_;
public:
AbstractKernel(const std::string& geometry_library, const Settings& settings)
: geometry_library(geometry_library)
: geometry_library_(geometry_library)
, settings_(settings) {}
bool convert(const taxonomy::ptr, IfcGeom::ConversionResults&);
virtual bool convert(const taxonomy::ptr, IfcGeom::ConversionResults&);
const Settings& settings() const;
const std::string& geometry_library() const {
return geometry_library_;
}
virtual bool convert_impl(const taxonomy::matrix4::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::point3::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
@@ -50,6 +53,7 @@ namespace ifcopenshell { namespace geometry { namespace kernels {
virtual bool convert_impl(const taxonomy::revolve::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::bspline_surface::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::cylinder::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::sphere::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::solid::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::surface_curve_sweep::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
virtual bool convert_impl(const taxonomy::loft::ptr, IfcGeom::ConversionResults&) { throw std::runtime_error("Not implemented"); }
@@ -68,7 +72,7 @@ namespace ifcopenshell { namespace geometry { namespace kernels {
};
AbstractKernel* construct(const std::string& geometry_library, const Settings& conv_settings);
AbstractKernel* construct(IfcParse::IfcFile* file, const std::string& geometry_library, Settings& conv_settings);
}
}
+16 -2
View File
@@ -187,6 +187,13 @@ namespace ifcopenshell {
static constexpr bool defaultvalue = false;
};
struct UseMaterialNames : public SettingBase<UseMaterialNames, bool> {
static constexpr const char* const name = "use-material-names";
static constexpr const char* const description = "Use material names instead of unique IDs for naming materials upon serialization. "
"Applicable for OBJ and DAE output.";
static constexpr bool defaultvalue = false;
};
struct ConvertBackUnits : public SettingBase<ConvertBackUnits, bool> {
static constexpr const char* const name = "convert-back-units";
static constexpr const char* const description = "Specifies whether to convert back geometrical output back to the "
@@ -221,7 +228,7 @@ namespace ifcopenshell {
struct OutputDimensionality : public SettingBase<OutputDimensionality, OutputDimensionalityTypes> {
static constexpr const char* const name = "dimensionality";
static constexpr const char* const description = "Specifies whether to include curves and/or surfaces and solids in the output result. Defaults to only surfaces and solids.";
static constexpr OutputDimensionalityTypes defaultvalue = CURVES_SURFACES_AND_SOLIDS;
static constexpr OutputDimensionalityTypes defaultvalue = SURFACES_AND_SOLIDS;
};
enum IteratorOutputOptions {
@@ -373,6 +380,13 @@ namespace ifcopenshell {
template <std::size_t Index>
void set_option_(const std::string& name, const value_variant_t& val) {
if (std::tuple_element_t<Index, settings_t>::name == name) {
if constexpr (std::is_enum_v<typename std::tuple_element_t<Index, settings_t>::base_type>) {
if (val.which() == 1) {
auto val_as_enum = (typename std::tuple_element_t<Index, settings_t>::base_type) boost::get<int>(val);
std::get<Index>(settings).value = val_as_enum;
return;
}
}
std::get<Index>(settings).value = boost::get<typename std::tuple_element_t<Index, settings_t>::base_type>(val);
} else if constexpr (Index + 1 < std::tuple_size_v<settings_t>) {
set_option_<Index + 1>(name, val);
@@ -426,7 +440,7 @@ namespace ifcopenshell {
};
class IFC_GEOM_API Settings : public SettingsContainer<
std::tuple<MesherLinearDeflection, MesherAngularDeflection, ReorientShells, LengthUnit, PlaneUnit, Precision, OutputDimensionality, LayersetFirst, DisableBooleanResult, NoWireIntersectionCheck, NoWireIntersectionTolerance, PrecisionFactor, DebugBooleanOperations, BooleanAttempt2d, WeldVertices, UseWorldCoords, ConvertBackUnits, ContextIds, ContextTypes, ContextIdentifiers, IteratorOutput, DisableOpeningSubtractions, ApplyDefaultMaterials, DontEmitNormals, GenerateUvs, ApplyLayerSets, UseElementHierarchy, ValidateQuantities, EdgeArrows, BuildingLocalPlacement, SiteLocalPlacement, ForceSpaceTransparency, CircleSegments, KeepBoundingBoxes, PiecewiseStepType, PiecewiseStepParam>
std::tuple<MesherLinearDeflection, MesherAngularDeflection, ReorientShells, LengthUnit, PlaneUnit, Precision, OutputDimensionality, LayersetFirst, DisableBooleanResult, NoWireIntersectionCheck, NoWireIntersectionTolerance, PrecisionFactor, DebugBooleanOperations, BooleanAttempt2d, WeldVertices, UseWorldCoords, UseMaterialNames, ConvertBackUnits, ContextIds, ContextTypes, ContextIdentifiers, IteratorOutput, DisableOpeningSubtractions, ApplyDefaultMaterials, DontEmitNormals, GenerateUvs, ApplyLayerSets, UseElementHierarchy, ValidateQuantities, EdgeArrows, BuildingLocalPlacement, SiteLocalPlacement, ForceSpaceTransparency, CircleSegments, KeepBoundingBoxes, PiecewiseStepType, PiecewiseStepParam>
>
{};
}
+1 -1
View File
@@ -9,7 +9,7 @@ ifcopenshell::geometry::Converter::Converter(const std::string& geometry_library
, settings_(s)
{
mapping_ = impl::mapping_implementations().construct(file, settings_);
kernel_ = kernels::construct(geometry_library, mapping_->settings());
kernel_ = kernels::construct(file, geometry_library, mapping_->settings());
}
namespace {
-7
View File
@@ -49,13 +49,6 @@ inline namespace settings {
static constexpr bool defaultvalue = false;
};
struct UseMaterialNames : public SettingBase<UseMaterialNames, bool> {
static constexpr const char* const name = "use-material-names";
static constexpr const char* const description = "Use material names instead of unique IDs for naming materials upon serialization. "
"Applicable for OBJ and DAE output.";
static constexpr bool defaultvalue = false;
};
struct UseElementTypes : public SettingBase<UseElementTypes, bool> {
static constexpr const char* const name = "use-element-types";
static constexpr const char* const description = "Use element types instead of unique IDs for naming elements upon serialization. "
+1
View File
@@ -44,6 +44,7 @@ namespace geometry {
virtual IfcUtil::IfcBaseEntity* representation_of(const IfcUtil::IfcBaseEntity* product) = 0;
const Settings& settings() const { return settings_; }
Settings& settings() { return settings_; }
};
namespace impl {
+24 -7
View File
@@ -24,6 +24,7 @@
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepAlgoAPI_Common.hxx>
#include <ShapeFix_Solid.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
using namespace ifcopenshell::geometry;
using namespace ifcopenshell::geometry::kernels;
@@ -64,18 +65,34 @@ bool OpenCascadeKernel::convert(const taxonomy::solid::ptr solid, TopoDS_Shape&
result = halfspace;
return true;
} else if (solid->children.size() == 1
&& solid->children[0]->children.size() == 1
&& solid->children[0]->children[0]->basis
&& solid->children[0]->children[0]->basis->kind() == taxonomy::SPHERE)
{
auto sphere = taxonomy::cast<taxonomy::sphere>(solid->children[0]->children[0]->basis);
gp_GTrsf gtrsf;
convert(sphere->matrix, gtrsf);
BRepPrimAPI_MakeSphere builder(sphere->radius);
auto s = builder.Solid();
s.Move(gtrsf.Trsf());
result = s;
return true;
}
for (auto& s : solid->children) {
TopoDS_Shape shl;
convert(s, shl);
if (shl.ShapeType() == TopAbs_SHELL) {
ShapeFix_Solid solid;
S = solid.SolidFromShell(TopoDS::Shell(shl));
} else if (solid->children.size() == 1) {
S = shl;
if (convert(s, shl)) {
if (shl.ShapeType() == TopAbs_SHELL) {
ShapeFix_Solid solid;
S = solid.SolidFromShell(TopoDS::Shell(shl));
} else if (solid->children.size() == 1) {
S = shl;
} else {
throw std::runtime_error("Unexpected configuration of subshapes");
}
} else {
throw std::runtime_error("Unexpected configuration of subshapes");
Logger::Warning("Ignored shell", s->instance);
}
}
if (!S.IsNull()) {
+9 -8
View File
@@ -23,7 +23,7 @@ using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) {
auto loop = taxonomy::make<taxonomy::loop>();
auto pwf = taxonomy::make<taxonomy::piecewise_function>(&settings_);
std::vector<taxonomy::piecewise_function::ptr> pwfs;
#ifdef SCHEMA_HAS_IfcSegment
// 4x3
@@ -31,7 +31,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) {
#else
IfcSchema::IfcCompositeCurveSegment::list::ptr segments = inst->Segments();
#endif
for (auto& segment : *segments) {
if (segment->as<IfcSchema::IfcCompositeCurveSegment>() && segment->as<IfcSchema::IfcCompositeCurveSegment>()->ParentCurve()->as<IfcSchema::IfcLine>()) {
Logger::Notice("Infinite IfcLine used as ParentCurve of segment, treating as a segment", segment);
@@ -71,20 +71,21 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) {
else if (segment->as<IfcSchema::IfcCurveSegment>()) {
// @todo check that we don't get a mixture of implicit and explicit definitions
auto crv = map(segment->as<IfcSchema::IfcCurveSegment>());
if (crv->kind() == taxonomy::LOOP) {
if (crv && crv->kind() == taxonomy::LOOP) {
for (auto& s : taxonomy::cast<taxonomy::loop>(crv)->children) {
loop->children.push_back(s);
}
}
else if (crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
auto seg = taxonomy::cast<taxonomy::piecewise_function>(crv);
pwf->spans.insert(pwf->spans.end(), seg->spans.begin(), seg->spans.end());
else if (crv && crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
pwfs.push_back(taxonomy::cast<taxonomy::piecewise_function>(crv));
} else if (!crv) {
return nullptr;
}
}
#endif
}
if (pwf->spans.empty()) {
if (pwfs.empty()) {
aggregate_of_instance::ptr profile = inst->data().getInverse(&IfcSchema::IfcProfileDef::Class(), -1);
const bool force_close = profile && profile->size() > 0;
loop->closed = force_close;
@@ -92,7 +93,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* inst) {
return loop;
}
else {
pwf->instance = inst;
auto pwf = taxonomy::make<taxonomy::piecewise_function>(pwfs,&settings_,inst);
return pwf;
}
}
File diff suppressed because it is too large Load Diff
@@ -67,11 +67,13 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcFixedReferenceSweptAreaSolid
for (size_t i = 0; i <= num_steps; ++i) {
auto m4 = pwf->evaluate(start + curve_length / num_steps * i);
/*
std::stringstream ss;
ss << m4;
auto s = ss.str();
std::wcout << s.c_str() << std::endl;
std::wcout << "determinant: " << m4.determinant() << std::endl;
*/
Eigen::Matrix4d m4b = Eigen::Matrix4d::Identity();
bool is_directrix_derived = false;
+11 -23
View File
@@ -28,17 +28,17 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcGradientCurve* inst) {
Logger::Warning("Expected IfcGradientCurve.BaseCurve to be IfcCompositeCurve", inst); // CT 4.1.7.1.1.2
auto horizontal = taxonomy::cast<taxonomy::piecewise_function>(map(inst->BaseCurve()));
auto vertical = taxonomy::make<taxonomy::piecewise_function>(&settings_);
auto segments = inst->Segments();
std::vector<taxonomy::piecewise_function::ptr> pwfs;
for (auto& segment : *segments) {
if (segment->as<IfcSchema::IfcCurveSegment>()) {
// @todo check that we don't get a mixture of implicit and explicit definitions
auto crv = map(segment->as<IfcSchema::IfcCurveSegment>());
if (crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
auto seg = taxonomy::cast<taxonomy::piecewise_function>(crv);
vertical->spans.insert(vertical->spans.end(), seg->spans.begin(), seg->spans.end());
if (crv && crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
pwfs.push_back(taxonomy::cast<taxonomy::piecewise_function>(crv));
} else {
Logger::Error("Unsupported");
return nullptr;
@@ -48,6 +48,8 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcGradientCurve* inst) {
return nullptr;
}
}
auto vertical = taxonomy::make<taxonomy::piecewise_function>(pwfs,&settings_);
auto composition = [horizontal, vertical](double u)->Eigen::Matrix4d {
auto xy = horizontal->evaluate(u);
@@ -62,26 +64,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcGradientCurve* inst) {
return m;
};
std::array<taxonomy::piecewise_function::ptr, 2> both = { horizontal , vertical };
// @todo: rb - this constrains the range of u to the minimum of horizontal and vertical
// we discussed using the maximum for the range of us and then using std::numeric_limits<double>::NAN
// for values of u that horizontal or vertical cannot be computed.
// Review and decide what to do.
double min_length = std::numeric_limits<double>::infinity();
for (auto i = 0; i < 2; ++i) {
double l = 0;
for (auto& s : both[i]->spans) {
l += s.first;
}
if (l < min_length) {
min_length = l;
}
}
double min_length = std::min(horizontal->length(), vertical->length());
auto pwf = taxonomy::make<taxonomy::piecewise_function>(&settings_);
pwf->spans.emplace_back( min_length, composition );
pwf->instance = inst;
return pwf;
taxonomy::piecewise_function::spans spans;
spans.emplace_back(min_length, composition);
auto pwf = taxonomy::make<taxonomy::piecewise_function>(spans, &settings_, inst);
return pwf;
}
#endif
@@ -42,7 +42,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcOffsetCurveByDistances* inst
auto pw_curve = taxonomy::dcast<taxonomy::piecewise_function>(map(basis_curve));
double basis_curve_length = pw_curve->length();
auto offsets = taxonomy::make<taxonomy::piecewise_function>(&settings_);
taxonomy::piecewise_function::spans offset_spans;
#if defined SCHEMA_HAS_IfcDistanceExpression
double first_distance = first_offset_value->DistanceAlong();
@@ -63,12 +63,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcOffsetCurveByDistances* inst
py *= length_unit_;
pz *= length_unit_;
auto fn = [py, pz](double u) -> Eigen::Matrix4d {
auto fn = [py, pz](double /*u*/) -> Eigen::Matrix4d {
Eigen::Matrix4d m = Eigen::Matrix4d::Identity();
m.col(3)(1) = py;
m.col(3)(2) = pz;
return m; };
offsets->spans.push_back({first_distance, fn});
offset_spans.emplace_back(first_distance, fn);
}
auto iter = offset_values->begin();
@@ -112,7 +112,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcOffsetCurveByDistances* inst
m.col(3)(2) = (l == 0.0 ? zp : (zp + (zn - zp) * u / l));
return m;
};
offsets->spans.push_back({l, fn});
offset_spans.emplace_back(l, fn);
}
// at this point, next == end and prev == end-1
@@ -134,15 +134,17 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcOffsetCurveByDistances* inst
py *= length_unit_;
pz *= length_unit_;
double l = basis_curve_length - last_distance;
auto fn = [py, pz](double u) -> Eigen::Matrix4d {
auto fn = [py, pz](double /*u*/) -> Eigen::Matrix4d {
Eigen::Matrix4d m = Eigen::Matrix4d::Identity();
m.col(3)(1) = py;
m.col(3)(2) = pz;
return m; };
offsets->spans.push_back({l, fn});
offset_spans.emplace_back(l, fn);
}
auto offsets = taxonomy::make<taxonomy::piecewise_function>(offset_spans,&settings_);
auto composition = [pw_curve, offsets](double u) -> Eigen::Matrix4d {
auto p = pw_curve->evaluate(u);
auto offset = offsets->evaluate(u);
@@ -152,9 +154,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcOffsetCurveByDistances* inst
// current implementation assumes that composition is equal to the full length of basis curve
// this may change depending on decisions in the bSI-IF
auto pwf = taxonomy::make<taxonomy::piecewise_function>(&settings_);
pwf->spans.emplace_back( basis_curve_length, composition );
pwf->instance = inst;
taxonomy::piecewise_function::spans spans;
spans.emplace_back(basis_curve_length, composition);
auto pwf = taxonomy::make<taxonomy::piecewise_function>(spans,&settings_,inst);
return pwf;
}
+10 -5
View File
@@ -22,8 +22,7 @@
using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRepresentation* inst) {
// @todo
const bool use_body = !this->settings_.get<settings::IncludeCurves>().get();
auto items_to_include = this->settings_.get<settings::OutputDimensionality>().get();
auto items = map_to_collection(this, inst->Items());
if (!items) {
@@ -42,9 +41,15 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRepresentation* inst) {
// @todo
// if (s.ShapeType() == TopAbs_COMPOUND && TopoDS_Iterator(s).More() && TopoDS_Iterator(s).Value().ShapeType() == TopAbs_SOLID) {
auto filtered = filter_in_place(items, [&use_body](taxonomy::ptr i) {
// @todo just filter loops for now.
return (i->kind() != taxonomy::LOOP && i->kind() != taxonomy::PIECEWISE_FUNCTION) == use_body;
auto filtered = filter_in_place(items, [&items_to_include](taxonomy::ptr i) {
auto is_curve = (i->kind() == taxonomy::EDGE || i->kind() == taxonomy::LOOP || i->kind() == taxonomy::PIECEWISE_FUNCTION);
if (is_curve && items_to_include == settings::SURFACES_AND_SOLIDS) {
return false;
} else if (!is_curve && items_to_include == settings::CURVES) {
return false;
} else {
return true;
}
});
if (filtered->children.empty()) {
@@ -28,17 +28,16 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSegmentedReferenceCurve* ins
Logger::Warning("Expected IfcSegmentedReferenceCurve.BaseCurve to be IfcGradient", inst); // CT 4.1.7.1.1.3
auto gradient = taxonomy::cast<taxonomy::piecewise_function>(map(inst->BaseCurve()));
auto cant = taxonomy::make<taxonomy::piecewise_function>(&settings_);
auto segments = inst->Segments();
for (auto& segment : *segments) {
std::vector<taxonomy::piecewise_function::ptr> pwfs;
for (auto& segment : *segments) {
if (segment->as<IfcSchema::IfcCurveSegment>()) {
// @todo check that we don't get a mixture of implicit and explicit definitions
auto crv = map(segment->as<IfcSchema::IfcCurveSegment>());
if (crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
auto seg = taxonomy::cast<taxonomy::piecewise_function>(crv);
cant->spans.insert(cant->spans.end(), seg->spans.begin(), seg->spans.end());
if (crv && crv->kind() == taxonomy::PIECEWISE_FUNCTION) {
pwfs.push_back(taxonomy::cast<taxonomy::piecewise_function>(crv));
} else {
Logger::Error("Unsupported");
return nullptr;
@@ -48,6 +47,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSegmentedReferenceCurve* ins
return nullptr;
}
}
auto cant = taxonomy::make<taxonomy::piecewise_function>(pwfs,&settings_);
auto composition = [gradient, cant](double u)->Eigen::Matrix4d {
auto g = gradient->evaluate(u);
@@ -62,26 +62,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSegmentedReferenceCurve* ins
return m;
};
std::array<taxonomy::piecewise_function::ptr, 2> both = { gradient , cant };
// @todo: rb - this constrains the range of u to the minimum of gradient and cant
// we discussed using the maximum for the range of us and then using std::numeric_limits<double>::NAN
// for values of u that gradient or cant cannot be computed.
// Review and decide what to do.
double min_length = std::numeric_limits<double>::infinity();
for (auto i = 0; i < 2; ++i) {
double l = 0;
for (auto& s : both[i]->spans) {
l += s.first;
}
if (l < min_length) {
min_length = l;
}
}
double min_length = std::min(gradient->length(), cant->length());
auto pwf = taxonomy::make<taxonomy::piecewise_function>(&settings_);
pwf->spans.emplace_back( min_length, composition );
pwf->instance = inst;
return pwf;
taxonomy::piecewise_function::spans spans;
spans.emplace_back(min_length, composition);
auto pwf = taxonomy::make<taxonomy::piecewise_function>(spans, &settings_, inst);
return pwf;
}
#endif
+10 -14
View File
@@ -22,18 +22,14 @@
using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSphere* inst) {
// @todo
return nullptr;
/*
const double r = inst->Radius() * length_unit_;
BRepPrimAPI_MakeSphere builder(r);
gp_Trsf trsf;
IfcGeom::Kernel::convert(inst->Position(),trsf);
// IfcCsgPrimitive3D.Position has unit scale factor
shape = builder.Solid().Moved(trsf);
return true;
*/
auto sol = taxonomy::make<taxonomy::solid>();
auto shl = taxonomy::make<taxonomy::shell>();
auto fac = taxonomy::make<taxonomy::face>();
auto spr = taxonomy::make<taxonomy::sphere>();
spr->matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
spr->radius = inst->Radius() * length_unit_;
fac->basis = spr;
shl->children.push_back(fac);
sol->children.push_back(shl);
return sol;
}
+1 -1
View File
@@ -11,7 +11,7 @@
try { \
if (inst->as<IfcSchema::IfcRepresentationItem>() && !inst->as<IfcSchema::IfcStyledItem>() && \
/* @todo */ \
(item->kind() == taxonomy::SHELL || item->kind() == taxonomy::COLLECTION || item->kind() == taxonomy::EXTRUSION) \
(item->kind() == taxonomy::SOLID || item->kind() == taxonomy::SHELL || item->kind() == taxonomy::COLLECTION || item->kind() == taxonomy::EXTRUSION) \
) { \
auto style = find_style(inst->as<IfcSchema::IfcRepresentationItem>()); \
if (style) { \
+28 -5
View File
@@ -153,9 +153,20 @@ bool mapping::reuse_ok_(const IfcSchema::IfcProduct::list::ptr& products) {
}
aggregate_of_instance::ptr mapping::find_openings(const IfcUtil::IfcBaseEntity* inst) {
aggregate_of_instance::ptr openings(new aggregate_of_instance);
if (auto rep = inst->as<IfcSchema::IfcRepresentation>()) {
// @todo this is essentially only for hybrid kernel trying to guess
// when not to use a simple kernel.
auto prods = products_represented_by(rep, true);
for (auto& p : *prods) {
openings->push(find_openings(p));
}
return openings;
}
auto product = inst->as<IfcSchema::IfcProduct>();
aggregate_of_instance::ptr openings(new aggregate_of_instance);
if (product->as<IfcSchema::IfcElement>() && !product->as<IfcSchema::IfcFeatureElementSubtraction>()) {
const IfcSchema::IfcElement* element = product->as<IfcSchema::IfcElement>();
auto rels = element->HasOpenings();
@@ -426,6 +437,14 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMaterial* material) {
}
taxonomy::style::ptr material_style = taxonomy::make<taxonomy::style>();
material_style->instance = material;
if (settings_.get<settings::UseMaterialNames>().get()) {
material_style->name = material->Name();
} else {
std::ostringstream oss;
oss << material->declaration().name() << "-" << material->data().id();
material_style->name = oss.str();
}
return material_style;
// @todo
@@ -448,8 +467,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcStyledItem* inst) {
taxonomy::style::ptr surface_style = taxonomy::make<taxonomy::style>();
surface_style->instance = style;
if (style->Name()) {
if (settings_.get<settings::UseMaterialNames>().get() && style->Name()) {
surface_style->name = *style->Name();
} else {
std::ostringstream oss;
oss << shading->declaration().name() << "-" << shading->data().id();
surface_style->name = oss.str();
}
double rgb[3];
@@ -952,7 +975,7 @@ void mapping::addRepresentationsFromDefaultContexts(IfcSchema::IfcRepresentation
allowed_context_types.insert("notdefined");
std::set<std::string> context_types;
if (settings_.get<settings::IncludeSurfaces>().get()) {
if (this->settings_.get<settings::OutputDimensionality>().get() != settings::CURVES) {
// Really this should only be 'Model', as per
// the standard 'Design' is deprecated. So,
// just for backwards compatibility:
@@ -962,7 +985,7 @@ void mapping::addRepresentationsFromDefaultContexts(IfcSchema::IfcRepresentation
context_types.insert("model view");
context_types.insert("detail view");
}
if (settings_.get<settings::IncludeCurves>().get()) {
if (this->settings_.get<settings::OutputDimensionality>().get() != settings::SURFACES_AND_SOLIDS) {
context_types.insert("plan");
}
@@ -1051,7 +1074,7 @@ IfcUtil::IfcBaseEntity* mapping::representation_of(const IfcUtil::IfcBaseEntity*
}
}
if (intersection->size() == 0 && settings_.get<settings::ContextIds>().has() && settings_.get<settings::IncludeCurves>().get() && !settings_.get<settings::IncludeSurfaces>().get()) {
if (intersection->size() == 0 && settings_.get<settings::ContextIds>().has() && this->settings_.get<settings::OutputDimensionality>().get() == settings::CURVES) {
for (auto& r : *of_product) {
if (r->RepresentationIdentifier() && *r->RepresentationIdentifier() == "Axis") {
intersection->push(r);
+1 -1
View File
@@ -99,7 +99,7 @@ taxonomy::loop::ptr ifcopenshell::geometry::profile_helper(const taxonomy::matri
}
*/
const bool has_position = !m4->is_identity();
const bool has_position = m4 && !m4->is_identity();
// @todo precision
+46 -12
View File
@@ -149,6 +149,10 @@ namespace {
throw std::runtime_error("not implemented");
}
bool compare(const sphere&, const sphere&) {
throw std::runtime_error("not implemented");
}
bool compare(const surface_curve_sweep&, const surface_curve_sweep&) {
throw std::runtime_error("not implemented");
}
@@ -467,37 +471,67 @@ ifcopenshell::geometry::taxonomy::item::ptr ifcopenshell::geometry::taxonomy::pi
} else {
// parameter is minimum number of steps
num_steps = (unsigned)std::ceil(param);
}
}
return evaluate(0.0, curve_length, num_steps);
}
item::ptr ifcopenshell::geometry::taxonomy::piecewise_function::evaluate(double ustart, double uend,unsigned nsteps) const {
return evaluate2(ustart, uend, nsteps).first;
}
std::pair<item::ptr, std::vector<double>> ifcopenshell::geometry::taxonomy::piecewise_function::evaluate2(double ustart, double uend, unsigned nsteps) const {
double curve_length = length();
ustart = std::max(0.0, ustart);
uend = std::min(uend, curve_length);
auto resolution = (uend - ustart)/ nsteps;
auto resolution = (uend - ustart) / nsteps;
std::vector<taxonomy::point3::ptr> polygon;
std::vector<double> u_values;
polygon.reserve(nsteps);
u_values.reserve(nsteps);
for (int i = 0; i <= nsteps; ++i) {
for (unsigned i = 0; i <= nsteps; ++i) {
auto u = resolution * i + ustart;
u_values.push_back(u);
Eigen::Matrix4d m = evaluate(u);
polygon.push_back(taxonomy::make<taxonomy::point3>(m.col(3)(0), m.col(3)(1), m.col(3)(2)));
}
return polygon_from_points(polygon);
return {polygon_from_points(polygon), u_values};
}
Eigen::Matrix4d ifcopenshell::geometry::taxonomy::piecewise_function::evaluate(double u) const {
// @todo: rb optimize, assume monotonic evaluation and store last evaluated segment?
for (auto& [length, fn] : spans) {
if (u < length + 0.001) { // @todo: rb - need to use consistent tolerance
return fn(u);
}
u -= length;
}
// assume monotonic evaluation and store last evaluated segment
if (current_span_fn_ == nullptr || (u < current_span_start_ || current_span_end_ < u)) {
// there isn't a current span or u is outside the range of the current span
// get a new "current span"
std::tie(current_span_start_,current_span_end_, current_span_fn_) = get_span(u);
}
u -= current_span_start_; // make u relative to start of span
return (*current_span_fn_)(u);
}
std::tuple<double, double, const std::function<Eigen::Matrix4d(double u)>*> ifcopenshell::geometry::taxonomy::piecewise_function::get_span(double u) const {
// force u to be within bounds of the curve
double curve_length = length();
u = std::max(0.0, u);
u = std::min(u, curve_length);
double start = 0;
for (auto& [length, fn] : spans_) {
auto tolerance = settings_ ? settings_->get<ifcopenshell::geometry::settings::Precision>().get() : 0.001;
if (u < length + tolerance) {
return {start, start+length, &fn} ;
}
start += length;
u -= length;
}
Logger::Error("taxonomy::piecewise_function::get_span span not found.");
return {0, 0, nullptr};
}
ifcopenshell::geometry::taxonomy::collection::ptr ifcopenshell::geometry::flatten(const taxonomy::collection::ptr& deep) {
@@ -512,7 +546,7 @@ const std::string& ifcopenshell::geometry::taxonomy::kind_to_string(kinds k) {
using namespace std::string_literals;
static std::string values[] = {
"matrix4"s, "point3"s, "direction3"s, "line"s, "circle"s, "ellipse"s, "bspline_curve"s, "offset_curve"s, "plane"s, "cylinder"s, "bspline_surface"s, "edge"s, "loop"s, "face"s, "shell"s, "solid"s, "loft"s, "extrusion"s, "revolve"s, "surface_curve_sweep"s, "node"s, "collection"s, "boolean_result"s, "piecewise_function"s, "colour"s, "style"s,
"matrix4"s, "point3"s, "direction3"s, "line"s, "circle"s, "ellipse"s, "bspline_curve"s, "offset_curve"s, "plane"s, "cylinder"s, "sphere"s, "bspline_surface"s, "edge"s, "loop"s, "face"s, "shell"s, "solid"s, "loft"s, "extrusion"s, "revolve"s, "surface_curve_sweep"s, "node"s, "collection"s, "boolean_result"s, "piecewise_function"s, "colour"s, "style"s,
};
return values[k];
+69 -15
View File
@@ -90,7 +90,7 @@ typedef item const* ptr;
topology_error(const char* const s) : std::runtime_error(s) {}
};
enum kinds { MATRIX4, POINT3, DIRECTION3, LINE, CIRCLE, ELLIPSE, BSPLINE_CURVE, OFFSET_CURVE, PLANE, CYLINDER, BSPLINE_SURFACE, EDGE, LOOP, FACE, SHELL, SOLID, LOFT, EXTRUSION, REVOLVE, SURFACE_CURVE_SWEEP, NODE, COLLECTION, BOOLEAN_RESULT, PIECEWISE_FUNCTION, COLOUR, STYLE };
enum kinds { MATRIX4, POINT3, DIRECTION3, LINE, CIRCLE, ELLIPSE, BSPLINE_CURVE, OFFSET_CURVE, PLANE, CYLINDER, SPHERE, BSPLINE_SURFACE, EDGE, LOOP, FACE, SHELL, SOLID, LOFT, EXTRUSION, REVOLVE, SURFACE_CURVE_SWEEP, NODE, COLLECTION, BOOLEAN_RESULT, PIECEWISE_FUNCTION, COLOUR, STYLE };
const std::string& kind_to_string(kinds k);
@@ -137,21 +137,32 @@ typedef item const* ptr;
};
struct piecewise_function : public implicit_item {
DECLARE_PTR(piecewise_function)
DECLARE_PTR(piecewise_function)
piecewise_function(const IfcUtil::IfcBaseInterface* instance = nullptr) : implicit_item(instance){};
piecewise_function(ifcopenshell::geometry::Settings* settings) : settings_(settings){};
using spans = std::vector<std::pair<double, std::function<Eigen::Matrix4d(double u)>>>;
piecewise_function(const spans& s, ifcopenshell::geometry::Settings* settings = nullptr, const IfcUtil::IfcBaseInterface* instance = nullptr) :
implicit_item(instance), settings_(settings), spans_(s){};
piecewise_function(const std::vector<piecewise_function::ptr>& pwfs, ifcopenshell::geometry::Settings* settings = nullptr, const IfcUtil::IfcBaseInterface* instance = nullptr) :
implicit_item(instance), settings_(settings)
{
for (auto& pwf : pwfs) {
spans_.insert(spans_.end(), pwf->spans_.begin(), pwf->spans_.end());
}
};
piecewise_function(piecewise_function&&) = default;
piecewise_function(const piecewise_function&) = default;
ifcopenshell::geometry::Settings* settings_ = nullptr;
const ifcopenshell::geometry::Settings* settings_ = nullptr;
// length of span, function to evaluate span
std::vector<std::pair<double, std::function<Eigen::Matrix4d(double u)>>> spans;
bool is_empty() const { return spans_.empty(); }
double length() const {
return std::accumulate(spans.begin(), spans.end(), 0.0, [](const auto& v,const auto& s) { return v + s.first; });
}
if (!length_.has_value()) {
length_ = std::accumulate(spans_.begin(), spans_.end(), 0.0, [](const auto& v, const auto& s) { return v + s.first; });
}
return *length_;
}
void print(std::ostream& o, int = 0) const {
o << "piecewise_function" << std::endl;
@@ -165,10 +176,34 @@ typedef item const* ptr;
return boost::hash<decltype(v)>{}(v);
}
virtual item::ptr evaluate() const;
item::ptr evaluate(double ustart, double uend,unsigned nsteps) const;
item::ptr evaluate() const override;
/// @brief evaluates the piecewise function between ustart and uend
/// @param ustart starting location - taken as 0.0 if before start
/// @param uend ending location - taken as length if beyond end
/// @param nsteps number of steps to evaluate
/// @return taxonomy::loop::ptr
item::ptr evaluate(double ustart, double uend, unsigned nsteps) const;
/// @brief evaluates the piecewise function between ustart and uend
/// @param ustart starting location - taken as 0.0 if before start
/// @param uend ending location - taken as length if beyond end
/// @param nsteps number of steps to evaluate
/// @return taxonomy::loop::ptr and vector of u values
std::pair<item::ptr, std::vector<double>> evaluate2(double ustart, double uend, unsigned nsteps) const;
/// @brief evaluates the piecewise function at u
/// @param u u is constrained to be between 0 and length
/// @return 4x4 placement matrix
Eigen::Matrix4d evaluate(double u) const;
private:
std::tuple<double, double, const std::function<Eigen::Matrix4d(double u)>*> get_span(double u) const;
spans spans_;
mutable double current_span_start_ = 0;
mutable double current_span_end_ = 0;
mutable const std::function<Eigen::Matrix4d(double u)>* current_span_fn_ = nullptr;
mutable boost::optional<double> length_;
};
#ifdef TAXONOMY_USE_SHARED_PTR
@@ -875,6 +910,23 @@ typedef item const* ptr;
}
};
struct sphere : public surface {
DECLARE_PTR(sphere)
double radius;
virtual sphere* clone_() const { return new sphere(*this); }
virtual kinds kind() const { return SPHERE; }
void print(std::ostream& o, int) const {
o << "not implemented";
}
virtual size_t calc_hash() const {
auto v = std::make_tuple(static_cast<size_t>(SPHERE), matrix->hash_components());
return boost::hash<decltype(v)>{}(v);
}
};
struct bspline_surface : public surface {
DECLARE_PTR(bspline_surface)
@@ -1037,9 +1089,9 @@ typedef item const* ptr;
};
namespace impl {
typedef std::tuple<matrix4, point3, direction3, line, circle, ellipse, bspline_curve, offset_curve, plane, cylinder, bspline_surface, edge, loop, face, shell, solid, loft, extrusion, revolve, surface_curve_sweep, node, collection, boolean_result, piecewise_function> KindsTuple;
typedef std::tuple<matrix4, point3, direction3, line, circle, ellipse, bspline_curve, offset_curve, plane, cylinder, sphere, bspline_surface, edge, loop, face, shell, solid, loft, extrusion, revolve, surface_curve_sweep, node, collection, boolean_result, piecewise_function> KindsTuple;
typedef std::tuple<line, circle, ellipse, bspline_curve, offset_curve, loop, edge> CurvesTuple;
typedef std::tuple<plane, cylinder, bspline_surface> SurfacesTuple;
typedef std::tuple<plane, cylinder, sphere, bspline_surface> SurfacesTuple;
}
struct type_by_kind {
@@ -1139,7 +1191,8 @@ typedef item const* ptr;
if (loop->pwf.is_initialized()) {
pwf_ = loop->pwf;
} else {
pwf_ = taxonomy::make<taxonomy::piecewise_function>();
taxonomy::piecewise_function::spans spans;
spans.reserve(loop->children.size());
for (auto& edge : loop->children) {
// the edge could be an arc or trimmed circle in the case of IfcIndexPolyCurve - support for this isn't implemented yet
if (edge->basis) {
@@ -1157,8 +1210,9 @@ typedef item const* ptr;
axis = refDirection.cross(Y).normalized();
return taxonomy::make<taxonomy::matrix4>(o, axis, refDirection)->components();
};
(*pwf_)->spans.emplace_back(l, fn);
spans.emplace_back(l, fn);
}
pwf_ = taxonomy::make<taxonomy::piecewise_function>(spans);
loop->pwf = pwf_;
}
}
+1 -1
View File
@@ -153,7 +153,7 @@ interface to access the IfcOpenShell utilities.
1. Install the BlenderBIM Add-on by following the `BlenderBIM Add-on
installation documentation
<https://blenderbim.org/docs/users/installation.html>`_.
<https://docs.blenderbim.org/users/installation.html>`_.
2. Launch Blender. Change to the **Scene Properties** tab in the **Properties
Panel**. Scroll down to the **IFC Collaboration > IFC CSV Import / Export**
+1 -1
View File
@@ -88,7 +88,7 @@ interface to access the IfcOpenShell utilities.
1. Install the BlenderBIM Add-on by following the `BlenderBIM Add-on
installation documentation
<https://blenderbim.org/docs/users/installation.html>`_.
<https://docs.blenderbim.org/users/installation.html>`_.
2. Launch Blender. Change to the **Scene Properties** tab in the **Properties
Panel**. Scroll down to the **IFC Quality Control > IFC Diff** panel.
@@ -227,7 +227,7 @@ The BlenderBIM Add-on is available either as a stable build or a daily build.
1. Install the BlenderBIM Add-on by following the `BlenderBIM Add-on
installation documentation
<https://blenderbim.org/docs/users/installation.html>`_.
<https://docs.blenderbim.org/users/installation.html>`_.
2. Launch Blender. On the top left of the Viewport panel, click the **Editor
Type** icon to change the viewport into a **Python Console**.
@@ -261,7 +261,7 @@ and run your script using the **Text > Run Script** menu or by clicking on the
Blender. This can help when learning how to write scripts as you can double
check the results of your scripts with what you see in the graphical
interface. `Read more
<https://blenderbim.org/docs/users/exploring_an_ifc_model.html>`_.
<https://docs.blenderbim.org/users/exploring_an_ifc_model.html>`_.
From source with precompiled binaries
-------------------------------------
@@ -12,7 +12,7 @@ Packaged installation
IfcSverchok is packaged like a regular Blender add-on, so installation is the
same as any other Blender add-on. `Download IfcSverchok here
<https://blenderbim.org/builds/ifcsverchok-230823.zip>`__.
<https://github.com/IfcOpenShell/IfcOpenShell/releases/download/ifcsverchok-240417/ifcsverchok-240417.zip>`__.
Like all Blender add-ons, they can be installed using ``Edit > Preferences >
Addons > Install > Choose Downloaded ZIP > Enable Add-on Checkbox``. You can
@@ -39,6 +39,7 @@ import sys
import tempfile
import zipfile
from pathlib import Path
from typing import Optional
import ifcopenshell.util.file
@@ -70,7 +71,7 @@ except Exception as e:
from . import guid
from .file import file
from .entity_instance import entity_instance, register_schema_attributes
from .entity_instance import entity_instance
from .sql import sqlite, sqlite_entity
try:
from .stream import stream, stream_entity
@@ -170,7 +171,7 @@ def create_entity(type, schema="IFC4", *args, **kwargs):
model = ifcopenshell.file()
model.add(person) # #1=IfcPerson($,$,$,$,$,$,$,$)
"""
e = entity_instance((schema, type))
e = ifcopenshell_wrapper.make_instance(schema, type)
attrs = list(enumerate(args)) + [(e.wrapped_data.get_argument_index(name), arg) for name, arg in kwargs.items()]
for idx, arg in attrs:
e[idx] = arg
@@ -194,15 +195,16 @@ def register_schema(schema):
schema.schema.this.disown()
schema.disown()
ifcopenshell_wrapper.register_schema(schema.schema)
register_schema_attributes(schema.schema)
def schema_by_name(schema=None, schema_version=None):
def schema_by_name(
schema: Optional[str] = None, schema_version: Optional[tuple[int, ...]] = None
) -> ifcopenshell_wrapper.schema_definition:
"""Returns an object allowing you to query the IFC schema itself
:param schema: Which IFC schema to use, chosen from "IFC2X3", "IFC4",
or "IFC4X3". These refer to the ISO approved versions of IFC.
:type schema: string
:type schema: string, optional
:param schema_version: If you want to specify an exact version of IFC
that may not be an ISO approved version, use this argument instead
of ``schema``. IFC versions on technical.buildingsmart.org are
@@ -211,13 +213,15 @@ def schema_by_name(schema=None, schema_version=None):
ADD2 TC1, which is the official version approved by ISO when people
refer to "IFC4". Generally you should not use this argument unless
you are testing non-ISO IFC releases.
:type schema_version: tuple[int]
:type schema_version: tuple[int, ...], optional
:return: Schema definition object.
:rtype: ifocpenshell_wrapper.schema_definition
"""
if schema_version:
prefixes = ("IFC", "X", "_ADD", "_TC")
schema = "".join("".join(map(str, t)) if t[1] else "" for t in zip(prefixes, schema_version))
else:
schema = {"IFC4X3": "IFC4X3_ADD1"}.get(schema, schema)
schema = {"IFC4X3": "IFC4X3_ADD2"}.get(schema, schema)
return ifcopenshell_wrapper.schema_by_name(schema)
@@ -87,6 +87,36 @@ ARGUMENTS_DEPRECATION = {
"material.unassign_material": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"classification.add_reference": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"classification.remove_reference": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"library.assign_reference": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"library.unassign_reference": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"document.assign_document": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"document.unassign_document": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"spatial.reference_structure": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"spatial.dereference_structure": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"constraint.assign_constraint": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
"constraint.unassign_constraint": partial(
batching_argument_deprecation, prev_argument="product", new_argument="products"
),
}
@@ -64,7 +64,8 @@ class Usecase:
self.settings["product"].PredefinedType = "USERDEFINED"
elif hasattr(self.settings["product"], "ObjectType"):
relating_type = ifcopenshell.util.element.get_type(self.settings["product"])
if relating_type and relating_type.PredefinedType != "NOTDEFINED":
# Allow for None due to https://github.com/buildingSMART/IFC4.3.x-development/issues/818
if relating_type and relating_type.PredefinedType not in ("NOTDEFINED", None):
self.settings["product"].ObjectType = None
self.settings["product"].PredefinedType = None
elif (
@@ -19,10 +19,11 @@
import ifcopenshell
import ifcopenshell.util.schema
import ifcopenshell.util.date
from typing import Union
class Usecase:
def __init__(self, file, classification=None):
def __init__(self, file: ifcopenshell.file, classification: Union[str, ifcopenshell.entity_instance]):
"""Adds a new classification system to the project
External classification systems such as Uniclass or Omniclass are
@@ -81,7 +82,7 @@ class Usecase:
"classification": classification,
}
def execute(self):
def execute(self) -> ifcopenshell.entity_instance:
if isinstance(self.settings["classification"], str):
classification = self.file.createIfcClassification(Name=self.settings["classification"])
self.relate_to_project(classification)
@@ -17,12 +17,24 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
import ifcopenshell.util.schema
from typing import Optional, Union
class Usecase:
def __init__(self, file, product=None, reference=None, identification=None, name=None, classification=None, is_lightweight=True):
"""Adds a new classification reference and assigns it to a product
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
reference: Optional[ifcopenshell.entity_instance] = None,
identification: Optional[str] = None,
name: Optional[str] = None,
classification: Optional[ifcopenshell.entity_instance] = None,
is_lightweight=True,
):
"""Adds a new classification reference and assigns it to the list of products
A classification reference is a single entry such as "Pr_12_23_34" that
is part of an external classification system (such as Uniclass or
@@ -33,7 +45,7 @@ class Usecase:
resources such as profiles, documents, libraries, and so on.
Classification references can be added in two ways. Option 1) specify a
custom arbitrary reference, where you have the manually specify the
custom arbitrary reference, where you have to manually specify the
identification (e.g. "Pr_12_23_45") and name (e.g. "Door Products").
Option 2) add a reference from an IFC classification library. The latter
is preferred if you are using a common classification system such as
@@ -52,13 +64,13 @@ class Usecase:
assigned to both the type and an occurrence, then the assignment at the
occurrence will override the type classification.
:param product: The IFC object, property, or resource you want to
:param product: The list of IFC objects, properties, or resources you want to
associate the classification reference to.
:type product: ifcopenshell.entity_instance.entity_instance
:type product: list[ifcopenshell.entity_instance.entity_instance]
:param reference: The classification reference entity taken from an
IFC classification library. If you supply this parameter, you will
use option 2.
:type product: ifcopenshell.entity_instance.entity_instance, optional
:type reference: ifcopenshell.entity_instance.entity_instance, optional
:param identification: If you choose option 1 and do not specify a
reference, you may manually specify an identification code. The code
is typically a short identifier and may have punctuation to separate
@@ -70,7 +82,7 @@ class Usecase:
:param classification: The IfcClassification entity in your IFC model
(not the library, if you are doing option 2) that the reference is
part of.
:type product: ifcopenshell.entity_instance.entity_instance
:type classification: ifcopenshell.entity_instance.entity_instance
:param is_lightweight: If you are doing option 2, choose whether or not
to only add that particular reference (lighweight) or also add all
of its parent references in the classification hierarchy (not
@@ -81,8 +93,12 @@ class Usecase:
is generally unnecessary. Using lightweight classifications are
recommended and is the default.
:type is_lightweight: bool, optional
:raises TypeError: If file is IFC2X3 and `products` has non-IfcRoot elements.
:return: The newly added IfcClassificationReference
:rtype: ifcopenshell.entity_instance.entity_instance
or `None` if `products` was empty list.
:rtype: Union[ifcopenshell.entity_instance.entity_instance, None]
Example:
@@ -93,7 +109,7 @@ class Usecase:
classification = ifcopenshell.api.run("classification.add_classification",
model, classification="MyCustomClassification")
ifcopenshell.api.run("classification.add_reference", model,
product=wall_type, classification=classification,
products=[wall_type], classification=classification,
identification="W_01", name="Interior Walls")
# Option 2: adding a popular classification from a library
@@ -104,12 +120,12 @@ class Usecase:
reference = [r for r in library.by_type("IfcClassificationReference")
if r.Identification == "XYZ"][0]
ifcopenshell.api.run("classification.add_reference", model,
product=wall_type, classification=classification,
products=[wall_type], classification=classification,
reference=reference)
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"reference": reference,
"identification": identification,
"name": name,
@@ -117,8 +133,27 @@ class Usecase:
"is_lightweight": is_lightweight,
}
def execute(self):
self.is_rooted = self.settings["product"].is_a("IfcRoot")
def execute(self) -> Union[ifcopenshell.entity_instance, None]:
if not self.settings["products"]:
return
if self.settings["reference"]:
referenced = ifcopenshell.util.element.get_referenced_elements(self.settings["reference"])
if set(self.settings["products"]).issubset(referenced):
# nothing to do, all elements already have this reference assigned
return self.settings["reference"]
self.rooted_products: set[ifcopenshell.entity_instance] = set()
self.non_rooted_products: set[ifcopenshell.entity_instance] = set()
for product in self.settings["products"]:
if product.is_a("IfcRoot"):
self.rooted_products.add(product)
else:
self.non_rooted_products.add(product)
if self.non_rooted_products and self.file.schema == "IFC2X3":
raise TypeError(f"Cannot add reference to non-IfcRoot element in IFC2X3: {self.non_rooted_products}.")
if self.settings["reference"]:
return self.add_from_library()
return self.add_from_identification()
@@ -134,14 +169,10 @@ class Usecase:
else:
reference.Identification = self.settings["identification"]
relationship = self.get_existing_relationship(reference)
if relationship:
self.add_to_existing_relationship(relationship)
else:
self.add_new_relationship(reference)
self.update_relationships(reference)
return reference
def add_from_library(self):
def add_from_library(self) -> ifcopenshell.entity_instance:
if hasattr(self.settings["reference"], "ItemReference"):
identification = self.settings["reference"].ItemReference # IFC2X3
else:
@@ -155,8 +186,9 @@ class Usecase:
old_referenced_source = self.settings["reference"].ReferencedSource
self.settings["reference"].ReferencedSource = None
else:
classification_name = self.settings["classification"].Name
existing_classification = [
c for c in self.file.by_type("IfcClassification") if c.Name == self.settings["classification"].Name
c for c in self.file.by_type("IfcClassification") if c.Name == classification_name
]
reference = migrator.migrate(self.settings["reference"], self.file)
@@ -174,15 +206,10 @@ class Usecase:
for element in to_delete:
self.file.remove(element)
relationship = self.get_existing_relationship(reference)
if relationship:
self.add_to_existing_relationship(relationship)
else:
self.add_new_relationship(reference)
self.update_relationships(reference)
return reference
def get_existing_reference(self, identification):
def get_existing_reference(self, identification: Optional[str] = None) -> Union[ifcopenshell.entity_instance, None]:
for reference in self.file.by_type("IfcClassificationReference"):
if self.file.schema == "IFC2X3":
if reference.ItemReference == identification:
@@ -191,39 +218,39 @@ class Usecase:
if reference.Identification == identification:
return reference
def add_new_relationship(self, reference):
if self.is_rooted:
self.file.create_entity(
"IfcRelAssociatesClassification",
GlobalId=ifcopenshell.guid.new(),
RelatedObjects=[self.settings["product"]],
RelatingClassification=reference,
)
else:
self.file.create_entity(
"IfcExternalReferenceRelationship",
RelatingReference=reference,
RelatedResourceObjects=[self.settings["product"]],
)
def add_to_existing_relationship(self, rel):
if self.is_rooted:
related_objects = set(rel.RelatedObjects)
related_objects.add(self.settings["product"])
rel.RelatedObjects = list(related_objects)
else:
related_objects = set(rel.RelatedResourceObjects)
related_objects.add(self.settings["product"])
rel.RelatedResourceObjects = list(related_objects)
def get_existing_relationship(self, reference):
if self.is_rooted:
def update_relationships(self, reference: ifcopenshell.entity_instance) -> None:
root_rel, non_root_rel = None, None
if self.rooted_products:
if self.file.schema == "IFC2X3":
for rel in self.file.by_type("IfcRelAssociatesClassification"):
if rel.RelatingClassification == reference:
return rel
elif reference.ClassificationRefForObjects:
return reference.ClassificationRefForObjects[0]
elif self.file.schema != "IFC2X3":
if reference.ExternalReferenceForResources:
return reference.ExternalReferenceForResources[0]
root_rel = rel
break
else:
root_rel = next(iter(reference.ClassificationRefForObjects), None)
if root_rel:
related_objects = set(root_rel.RelatedObjects) | self.rooted_products
root_rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": root_rel})
else:
self.file.create_entity(
"IfcRelAssociatesClassification",
OwnerHistory=ifcopenshell.api.run("owner.create_owner_history", self.file),
GlobalId=ifcopenshell.guid.new(),
RelatedObjects=list(self.rooted_products),
RelatingClassification=reference,
)
if self.non_rooted_products:
# NOTE: Only Ifc4+. Ifc2x3 is already handled by raising TypeError
non_root_rel = next(iter(reference.ExternalReferenceForResources), None)
if non_root_rel:
related_objects = set(non_root_rel.RelatedResourceObjects) | self.non_rooted_products
non_root_rel.RelatedResourceObjects = list(related_objects)
else:
self.file.create_entity(
"IfcExternalReferenceRelationship",
RelatingReference=reference,
RelatedResourceObjects=list(self.non_rooted_products),
)
@@ -17,12 +17,18 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
class Usecase:
def __init__(self, file, reference=None, product=None):
"""Removes a classification reference from a product
def __init__(
self,
file: ifcopenshell.file,
reference: ifcopenshell.entity_instance,
products: list[ifcopenshell.entity_instance],
):
"""Removes a classification reference from the list of products
If the classification reference is no longer associated to any products,
the classification reference itself is also removed.
@@ -30,9 +36,12 @@ class Usecase:
:param reference: The IfcClassificationReference entity of the
relationship you want to remove.
:type reference: ifcopenshell.entity_instance.entity_instance
:param product: The object entity of the relationship you want to
:param product: The list fo object entities of the relationship you want to
remove.
:type reference: ifcopenshell.entity_instance.entity_instance
:type product: list[ifcopenshell.entity_instance.entity_instance]
:raises TypeError: If file is IFC2X3 and `products` has non-IfcRoot elements.
:return: None
:rtype: None
@@ -44,42 +53,75 @@ class Usecase:
classification = ifcopenshell.api.run("classification.add_classification",
model, classification="MyCustomClassification")
reference = ifcopenshell.api.run("classification.add_reference", model,
product=wall_type, classification=classification,
products=[wall_type], classification=classification,
identification="W_01", name="Interior Walls")
ifcopenshell.api.run("classification.remove_reference", model,
reference=reference, product=wall_type)
reference=reference, products=[wall_type])
"""
self.file = file
self.settings = {"reference": reference, "product": product}
self.settings = {"reference": reference, "products": products}
def execute(self):
if self.settings["product"].is_a("IfcRoot"):
for rel in self.file.by_type("IfcRelAssociatesClassification"):
if rel.RelatingClassification == self.settings["reference"] and rel.RelatedObjects:
if self.settings["product"] in rel.RelatedObjects:
related_objects = list(rel.RelatedObjects)
related_objects.remove(self.settings["product"])
if len(related_objects):
rel.RelatedObjects = related_objects
else:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
else:
for rel in self.file.by_type("IfcExternalReferenceRelationship"):
if rel.RelatingReference == self.settings["reference"] and rel.RelatedResourceObjects:
if self.settings["product"] in rel.RelatedResourceObjects:
related_objects = list(rel.RelatedResourceObjects)
related_objects.remove(self.settings["product"])
if len(related_objects):
rel.RelatedResourceObjects = related_objects
else:
self.file.remove(rel)
def execute(self) -> None:
is_ifc2x3 = self.file.schema == "IFC2X3"
products = set(self.settings["products"])
referenced = ifcopenshell.util.element.get_referenced_elements(self.settings["reference"])
products -= products.difference(referenced)
# all products are already unassigned from a reference
if not products:
return
rooted_products: set[ifcopenshell.entity_instance] = set()
non_rooted_products: set[ifcopenshell.entity_instance] = set()
for product in self.settings["products"]:
if product.is_a("IfcRoot"):
rooted_products.add(product)
else:
non_rooted_products.add(product)
if non_rooted_products and is_ifc2x3:
raise TypeError(f"Cannot add reference to non-IfcRoot element in IFC2X3: {non_rooted_products}.")
if rooted_products:
reference_rels: set[ifcopenshell.entity_instance] = set()
for product in rooted_products:
reference_rels.update(product.HasAssociations)
reference_rels = {
rel
for rel in reference_rels
if rel.is_a("IfcRelAssociatesClassification")
and rel.RelatingClassification == self.settings["reference"]
}
for rel in reference_rels:
related_objects = set(rel.RelatedObjects) - rooted_products
if related_objects:
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
else:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
if non_rooted_products:
reference_rels: set[ifcopenshell.entity_instance] = set()
for product in non_rooted_products:
rels = getattr(product, "HasExternalReferences", None)
if rels is None:
rels = getattr(product, "HasExternalReference", [])
reference_rels.update(rels)
reference_rels = {rel for rel in reference_rels if rel.RelatingReference == self.settings["reference"]}
for rel in reference_rels:
related_objects = set(rel.RelatedResourceObjects) - non_rooted_products
if related_objects:
rel.RelatedResourceObjects = list(related_objects)
else:
self.file.remove(rel)
# TODO: we only handle lightweight classifications here
if (
not self.settings["reference"].ClassificationRefForObjects
and not self.settings["reference"].ExternalReferenceForResources
):
referenced_elements = ifcopenshell.util.element.get_referenced_elements(self.settings["reference"])
if not referenced_elements:
self.file.remove(self.settings["reference"])
@@ -17,11 +17,18 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
from typing import Union
class Usecase:
def __init__(self, file, product=None, constraint=None):
"""Assigns a constraint to a product
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
constraint: ifcopenshell.entity_instance,
):
"""Assigns a constraint to a list of products
This assigns a relationship between a product and a constraint, so that
when a product's properties and quantities do not match the requirements
@@ -31,36 +38,58 @@ class Usecase:
constraints are inherited from the type. This way, it is not necessary
to create lots of constraint assignments.
:param product: The product the constraint applies to. This is anything
:param products: The list of products the constraint applies to. This is anything
which can have properties or quantities.
:type product: ifcopenshell.entity_instance.entity_instance
:type products: list[ifcopenshell.entity_instance.entity_instance]
:param constraint: The IfcObjective constraint
:type constraint: ifcopenshell.entity_instance.entity_instance
:return: The new or updated IfcRelAssociatesConstraint relationship
or `None` if `products` was an empty list.
:rtype: ifcopenshell.entity_instance.entity_instance
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"constraint": constraint,
}
def execute(self):
rel = self.get_constraint_rel()
related_objects = set(rel.RelatedObjects) if rel.RelatedObjects else set()
related_objects.add(self.settings["product"])
rel.RelatedObjects = list(related_objects)
return rel
def execute(self) -> Union[ifcopenshell.entity_instance, None]:
products = set(self.settings["products"])
if not products:
return
self.constraint = self.settings["constraint"]
rels = self.get_constraint_rels()
related_objects = set()
for rel in rels:
related_objects.update(rel.RelatedObjects)
products_to_assign = products - related_objects
if not products_to_assign:
return rels[0]
rel = next(iter(rels), None)
if rel:
related_objects = set(rel.RelatedObjects) | products_to_assign
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
return rel
def get_constraint_rel(self):
for rel in self.file.by_type("IfcRelAssociatesConstraint"):
if rel.RelatingConstraint == self.settings["constraint"]:
return rel
return self.file.create_entity(
"IfcRelAssociatesConstraint",
**{
"GlobalId": ifcopenshell.guid.new(),
# TODO: owner history
"RelatingConstraint": self.settings["constraint"],
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"RelatingConstraint": self.constraint,
"RelatedObjects": list(products_to_assign),
}
)
def get_constraint_rels(self) -> list[ifcopenshell.entity_instance]:
rels = []
for rel in self.file.get_inverse(self.constraint):
if rel.is_a("IfcRelAssociatesConstraint"):
rels.append(rel)
return rels
@@ -17,18 +17,24 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
class Usecase:
def __init__(self, file, product=None, constraint=None):
"""Unassigns a constraint to a product
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
constraint: ifcopenshell.entity_instance,
):
"""Unassigns a constraint from a list of products
The constraint will not be deleted and is available to be assigned to
other products.
:param product: The product the constraint applies to.
:type product: ifcopenshell.entity_instance.entity_instance
:param products: The list of products the constraint applies to.
:type products: list[ifcopenshell.entity_instance.entity_instance]
:param constraint: The IfcObjective constraint
:type constraint: ifcopenshell.entity_instance.entity_instance
:return: None
@@ -36,14 +42,42 @@ class Usecase:
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"constraint": constraint,
}
def execute(self):
for rel in self.settings["product"].HasAssociations:
if rel.is_a("IfcRelAssociatesConstraint") and rel.RelatingConstraint == self.settings["constraint"]:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
products = set(self.settings["products"])
if not products:
return
self.constraint = self.settings["constraint"]
rels = self.get_constraint_rels()
related_objects = set()
for rel in rels:
related_objects.update(rel.RelatedObjects)
if not related_objects.intersection(products):
return
for rel in rels:
related_objects = set(rel.RelatedObjects)
if not related_objects.intersection(products):
continue
related_objects -= products
if related_objects:
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
continue
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
def get_constraint_rels(self) -> list[ifcopenshell.entity_instance]:
rels = []
for rel in self.file.get_inverse(self.constraint):
if rel.is_a("IfcRelAssociatesConstraint"):
rels.append(rel)
return rels
@@ -69,10 +69,12 @@ class Usecase:
def execute(self) -> ifcopenshell.entity_instance:
if self.file.schema == "IFC2X3":
reference = self.file.create_entity("IfcDocumentReference")
reference = self.file.create_entity("IfcDocumentReference", ItemReference="X")
if self.settings["information"]:
references = list(self.settings["information"].DocumentReferences or [])
references.append(reference)
self.settings["information"].DocumentReferences = references
return reference
return self.file.create_entity("IfcDocumentReference", ReferencedDocument=self.settings["information"])
return self.file.create_entity(
"IfcDocumentReference", ReferencedDocument=self.settings["information"], Identification="X"
)
@@ -17,11 +17,19 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
from typing import Union
class Usecase:
def __init__(self, file, product=None, document=None):
"""Assigns a document to a product
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
document: ifcopenshell.entity_instance,
):
"""Assigns a document to a list of products
An object may be assigned to zero, one, or multiple documents. Almost
any object or property may be assigned to a document, though typically
@@ -32,14 +40,16 @@ class Usecase:
consistent with other external relationships (such as classification
systems or libraries).
:param product: The object to associate the document to. This could be
:param product: The list of objects to associate the document to. This could be
almost any sensible object in IFC.
:type product: ifcopenshell.entity_instance.entity_instance
:type product: list[ifcopenshell.entity_instance.entity_instance]
:param document: The IfcDocumentReference to associate to, or
alternatively an IfcDocumentInformation, though this is not
recommended.
:type document: ifcopenshell.entity_instance.entity_instance
:return: The IfcRelAssociatesDocument relationship
or `None` if `products` was an empty list or all products were
already assigned to the `document`.
:rtype: ifcopenshell.entity_instance.entity_instance
Example:
@@ -54,42 +64,51 @@ class Usecase:
reference = ifcopenshell.api.run("document.add_reference", model, information=document)
# Let's imagine storey represents an IfcBuildingStorey for the ground floor
ifcopenshell.api.run("document.assign_document", model, product=storey, document=reference)
ifcopenshell.api.run("document.assign_document", model, products=[storey], document=reference)
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"document": document,
}
def execute(self):
rel = self.get_document_rel()
related_objects = set(rel.RelatedObjects) if rel.RelatedObjects else set()
related_objects.add(self.settings["product"])
rel.RelatedObjects = list(related_objects)
def execute(self) -> Union[ifcopenshell.entity_instance, None]:
# TODO: do we need to support non-ifcroot elements like we do in classification.add_reference?
# NOTE: reuses code from `library.assign_reference`
referenced_elements = ifcopenshell.util.element.get_referenced_elements(self.settings["document"])
products: set[ifcopenshell.entity_instance] = set(self.settings["products"])
products = products - referenced_elements
if not products:
return
def get_document_rel(self):
if self.file.schema == "IFC2X3":
for rel in self.file.by_type("IfcRelAssociatesDocument"):
if rel.RelatingDocument == self.settings["document"]:
return rel
rel = next(
(
r
for r in self.file.by_type("IfcRelAssociatesDocument")
if r.RelatingDocument == self.settings["document"]
),
None,
)
else:
if (
hasattr(self.settings["document"], "DocumentRefForObjects")
and self.settings["document"].DocumentRefForObjects
):
return self.settings["document"].DocumentRefForObjects[0]
elif (
hasattr(self.settings["document"], "DocumentInfoForObjects")
and self.settings["document"].DocumentInfoForObjects
):
return self.settings["document"].DocumentInfoForObjects[0]
ifc_class = self.settings["document"].is_a()
if ifc_class == "IfcDocumentReference":
rel = next(iter(self.settings["document"].DocumentRefForObjects), None)
elif ifc_class == "IfcDocumentInformation":
rel = next(iter(self.settings["document"].DocumentInfoForObjects), None)
return self.file.create_entity(
"IfcRelAssociatesDocument",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"RelatingDocument": self.settings["document"],
}
)
if not rel:
return self.file.create_entity(
"IfcRelAssociatesDocument",
GlobalId=ifcopenshell.guid.new(),
OwnerHistory=ifcopenshell.api.run("owner.create_owner_history", self.file),
RelatedObjects=list(products),
RelatingDocument=self.settings["document"],
)
related_objects = set(rel.RelatedObjects) | products
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, element=rel)
return rel
@@ -17,16 +17,22 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
class Usecase:
def __init__(self, file, product=None, document=None):
"""Unassigns a document and a product association
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
document: ifcopenshell.entity_instance,
):
"""Unassigns a document and an association to the list of products
:param product: The object that the document reference or information is
:param product: The list of objects that the document reference or information is
related to.
:type product: ifcopenshell.entity_instance.entity_instance
:type product: list[ifcopenshell.entity_instance.entity_instance]
:param document: The IfcDocumentReference (typically) or in rare cases
the IfcDocumentInformation that is associated with the product
:type document: ifcopenshell.entity_instance.entity_instance
@@ -45,24 +51,39 @@ class Usecase:
reference = ifcopenshell.api.run("document.add_reference", model, information=document)
# Let's imagine storey represents an IfcBuildingStorey for the ground floor
ifcopenshell.api.run("document.assign_document", model, product=storey, document=reference)
ifcopenshell.api.run("document.assign_document", model, products=[storey], document=reference)
# Now let's change our mind and remove the association
ifcopenshell.api.run("document.unassign_document", model, product=storey, document=reference)
ifcopenshell.api.run("document.unassign_document", model, products=[storey], document=reference)
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"document": document,
}
def execute(self):
for rel in self.settings["product"].HasAssociations:
if rel.is_a("IfcRelAssociatesDocument") and rel.RelatingDocument == self.settings["document"]:
if len(rel.RelatedObjects) == 1:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
else:
rel.RelatedObjects = [o for o in rel.RelatedObjects if o != self.settings["product"]]
# TODO: do we need to support non-ifcroot elements like we do in classification.add_reference?
# NOTE: reuses code from `library.un assign_reference`
reference_rels: set[ifcopenshell.entity_instance] = set()
products = set(self.settings["products"])
for product in products:
reference_rels.update(product.HasAssociations)
reference_rels = {
rel
for rel in reference_rels
if rel.is_a("IfcRelAssociatesDocument") and rel.RelatingDocument == self.settings["document"]
}
for rel in reference_rels:
related_objects = set(rel.RelatedObjects) - products
if related_objects:
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
else:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
@@ -26,7 +26,7 @@ class Usecase:
surveyor, and a third-party digital engineer with expertise in IFC to
moderate. For more information, read the BlenderBIM Add-on documentation
for Georeferencing:
https://blenderbim.org/docs/users/georeferencing.html
https://docs.blenderbim.org/users/georeferencing.html
For more information about the attributes and data types of an
IfcMapConversion, consult the IFC documentation.
@@ -17,23 +17,30 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
from typing import Union
class Usecase:
def __init__(self, file, product=None, reference=None):
"""Associates a product with a library reference
def __init__(
self, file: ifcopenshell.file, products: ifcopenshell.entity_instance, reference: ifcopenshell.entity_instance
):
"""Associates a list products with a library reference
A product may be associated with zero, one, or many references across
multiple libraries. See ifcopenshell.api.library.add_reference for more
detail about how references work.
:param product: The IfcProduct you want to associate with the reference
:type product: ifcopenshell.entity_instance.entity_instance
:param products: The list of IfcProducts you want to associate with the reference
:type products: list[ifcopenshell.entity_instance.entity_instance]
:param reference: The IfcLibraryReference you want the product to be
associated with.
:type reference: ifcopenshell.entity_instance.entity_instance
:return: The IfcRelAssociatesLibrary relationship entity
:rtype: ifcopenshell.entity_instance.entity_instance
or `None` if `products` was an empty list or all products were
already assigned to the `reference`.
:rtype: Union[ifcopenshell.entity_instance.entity_instance, None]
Example:
@@ -51,40 +58,46 @@ class Usecase:
ifc_class="IfcUnitaryEquipment", predefined_type="AIRHANDLER")
# And now assign the IFC model's AHU with its Brickschema counterpart
ifcopenshell.api.run("library.assign_reference", model, reference=reference, product=ahu)
ifcopenshell.api.run("library.assign_reference", model, reference=reference, products=[ahu])
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"reference": reference,
}
def execute(self):
def execute(self) -> Union[ifcopenshell.entity_instance, None]:
# TODO: do we need to support non-ifcroot elements like we do in classification.add_reference?
referenced_elements = ifcopenshell.util.element.get_referenced_elements(self.settings["reference"])
products: set[ifcopenshell.entity_instance] = set(self.settings["products"])
products = products - referenced_elements
if not products:
return
if self.file.schema == "IFC2X3":
rels = self.get_ifc2x3_rels()
rel = next(
(
r
for r in self.file.by_type("IfcRelAssociatesLibrary")
if r.RelatingLibrary == self.settings["reference"]
),
None,
)
else:
rels = self.settings["reference"].LibraryRefForObjects
if not rels:
rel = next(iter(self.settings["reference"].LibraryRefForObjects), None)
if not rel:
return self.file.create_entity(
"IfcRelAssociatesLibrary",
GlobalId=ifcopenshell.guid.new(),
OwnerHistory=ifcopenshell.api.run("owner.create_owner_history", self.file),
RelatedObjects=[self.settings["product"]],
RelatedObjects=list(products),
RelatingLibrary=self.settings["reference"],
)
for rel in rels:
if self.settings["product"] in rel.RelatedObjects:
return rel
rel = rels[0]
related_objects = list(rel.RelatedObjects)
related_objects.append(self.settings["product"])
rel.RelatedObjects = related_objects
related_objects = set(rel.RelatedObjects) | products
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, element=rel)
return rel
def get_ifc2x3_rels(self):
return [
r for r in self.file.by_type("IfcRelAssociatesLibrary") if r.RelatingLibrary == self.settings["reference"]
]
@@ -18,18 +18,24 @@
import ifcopenshell
import ifcopenshell.util.element
import ifcopenshell.api
class Usecase:
def __init__(self, file, reference=None, product=None):
"""Unassigns a product from a reference
def __init__(
self,
file: ifcopenshell.file,
reference: ifcopenshell.entity_instance,
products: list[ifcopenshell.entity_instance],
):
"""Unassigns a product of products from a reference
If the product isn't assigned to the reference, nothing will happen.
:param reference: The IfcLibraryReference to unassign from
:type reference: ifcopenshell.entity_instance.entity_instance
:param product: A IfcProduct element to unassign from the reference
:type product: ifcopenshell.entity_instance.entity_instance
:param products: A list of IfcProduct elements to unassign from the reference
:type products: list[ifcopenshell.entity_instance.entity_instance]
:return: None
:rtype: None
@@ -49,27 +55,36 @@ class Usecase:
ifc_class="IfcUnitaryEquipment", predefined_type="AIRHANDLER")
# And now assign the IFC model's AHU with its Brickschema counterpart
ifcopenshell.api.run("library.assign_reference", model, reference=reference, product=ahu)
ifcopenshell.api.run("library.assign_reference", model, reference=reference, products=[ahu])
# Let's change our mind and unassign it.
ifcopenshell.api.run("library.unassign_reference", model, reference=reference, product=ahu)
ifcopenshell.api.run("library.unassign_reference", model, reference=reference, products=[ahu])
"""
self.file = file
self.settings = {"reference": reference, "product": product}
self.settings = {"reference": reference, "products": products}
def execute(self):
rels = self.settings["reference"].LibraryRefForObjects
if not rels:
return
for rel in rels:
if self.settings["product"] in rel.RelatedObjects:
if len(rel.RelatedObjects) == 1:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
continue
related_objects = list(rel.RelatedObjects)
related_objects.remove(self.settings["product"])
rel.RelatedObjects = related_objects
# TODO: do we need to support non-ifcroot elements like we do in classification.add_reference?
reference_rels: set[ifcopenshell.entity_instance] = set()
products = set(self.settings["products"])
for product in products:
reference_rels.update(product.HasAssociations)
reference_rels = {
rel
for rel in reference_rels
if rel.is_a("IfcRelAssociatesLibrary") and rel.RelatingLibrary == self.settings["reference"]
}
for rel in reference_rels:
related_objects = set(rel.RelatedObjects) - products
if related_objects:
rel.RelatedObjects = list(related_objects)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
else:
history = rel.OwnerHistory
self.file.remove(rel)
if history:
ifcopenshell.util.element.remove_deep2(self.file, history)
@@ -38,7 +38,7 @@ def get_application(ifc: ifcopenshell.file) -> Union[ifcopenshell.entity_instanc
if not app and ifc.schema == "IFC2X3":
raise Exception(
"Please create an application to continue. See the owner.create_owner_history docs for more info."
"https://blenderbim.org/docs-python/autoapi/ifcopenshell/api/owner/create_owner_history/index.html"
"https://docs.ifcopenshell.org/autoapi/ifcopenshell/api/owner/create_owner_history/index.html"
)
return (app or [None])[0]
@@ -58,7 +58,7 @@ def get_user(ifc: ifcopenshell.file) -> Union[ifcopenshell.entity_instance, None
if not pao and ifc.schema == "IFC2X3":
raise Exception(
"Please create a user to continue. See the owner.create_owner_history docs for more info."
"https://blenderbim.org/docs-python/autoapi/ifcopenshell/api/owner/create_owner_history/index.html"
"https://docs.ifcopenshell.org/autoapi/ifcopenshell/api/owner/create_owner_history/index.html"
)
return (pao or [None])[0]
@@ -17,12 +17,19 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import datetime
import ifcopenshell.util.constraint
import ifcopenshell.util.date
import ifcopenshell.util.sequence
from typing import Any, Optional
class Usecase:
def __init__(self, file, task_time=None, attributes=None):
def __init__(
self,
file: ifcopenshell.file,
task_time: ifcopenshell.entity_instance,
attributes: Optional[dict[str, Any]] = None,
):
"""Edits the attributes of an IfcTaskTime
For more information about the attributes and data types of an
@@ -55,7 +62,7 @@ class Usecase:
self.file = file
self.settings = {"task_time": task_time, "attributes": attributes or {}}
def execute(self):
def execute(self) -> None:
self.task = self.get_task()
self.calendar = ifcopenshell.util.sequence.derive_calendar(self.task)
@@ -169,12 +176,12 @@ class Usecase:
duration, "IfcDuration"
)
def get_task(self):
return [
def get_task(self) -> ifcopenshell.entity_instance:
return next(
e
for e in self.file.get_inverse(self.settings["task_time"])
if e.is_a("IfcTask")
][0]
)
def handle_resource_calculation(self):
resources = ifcopenshell.util.sequence.get_task_resources(self.task, is_deep=False)
@@ -17,10 +17,16 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell.util.date
from typing import Any, Optional
class Usecase:
def __init__(self, file, work_time=None, attributes=None):
def __init__(
self,
file: ifcopenshell.file,
work_time: ifcopenshell.entity_instance,
attributes: Optional[dict[str, Any]] = None,
):
"""Edits the attributes of an IfcWorkTime
For more information about the attributes and data types of an
@@ -53,13 +59,15 @@ class Usecase:
self.file = file
self.settings = {"work_time": work_time, "attributes": attributes or {}}
def execute(self):
def execute(self) -> None:
for name, value in self.settings["attributes"].items():
if name in ("Start", "StartDate"):
value = ifcopenshell.util.date.datetime2ifc(value, "IfcDate")
# 4 IfcWorktime Start
self.settings["work_time"][4] = value
elif name in ("Finish", "FinishDate"):
value = ifcopenshell.util.date.datetime2ifc(value, "IfcDate")
# 5 IfcWorktime Finish
self.settings["work_time"][5] = value
else:
setattr(self.settings["work_time"], name, value)
@@ -22,11 +22,16 @@ import ifcopenshell.util.element
class Usecase:
def __init__(self, file, product=None, relating_structure=None):
"""Dereferences the a product and space
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
relating_structure: ifcopenshell.entity_instance,
):
"""Dereferences a list of products and space
:param product: The physical IfcElement that exists in the space.
:type product: ifcopenshell.entity_instance.entity_instance
:param products: The list of physical IfcElements that exists in the space.
:type products: list[ifcopenshell.entity_instance.entity_instance]
:param relating_structure: The IfcSpatialStructureElement element, such
as IfcBuilding, IfcBuildingStorey, or IfcSpace that the element
exists in.
@@ -59,23 +64,24 @@ class Usecase:
ifcopenshell.api.run("spatial.assign_container", model, products=[column], relating_structure=storey1)
# And referenced in the others
ifcopenshell.api.run("spatial.reference_structure", model, product=column, relating_structure=storey2)
ifcopenshell.api.run("spatial.reference_structure", model, product=column, relating_structure=storey3)
ifcopenshell.api.run("spatial.reference_structure", model, products=[column], relating_structure=storey2)
ifcopenshell.api.run("spatial.reference_structure", model, products=[column], relating_structure=storey3)
# Actually, it only goes up to storey 2.
ifcopenshell.api.run("spatial.dereference_structure", model, product=column, relating_structure=storey3)
ifcopenshell.api.run("spatial.dereference_structure", model, products=[column], relating_structure=storey3)
"""
self.file = file
self.settings = {"product": product, "relating_structure": relating_structure}
self.settings = {"products": products, "relating_structure": relating_structure}
def execute(self):
for rel in self.settings["product"].ReferencedInStructures:
if rel.RelatingStructure != self.settings["relating_structure"]:
def execute(self) -> None:
products = set(self.settings["products"])
for rel in self.settings["relating_structure"].ReferencesElements:
related_elements = set(rel.RelatedElements)
if not related_elements.intersection(products):
continue
related_elements = list(rel.RelatedElements)
related_elements.remove(self.settings["product"])
related_elements = related_elements - products
if related_elements:
rel.RelatedElements = related_elements
rel.RelatedElements = list(related_elements)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
else:
history = rel.OwnerHistory
@@ -18,11 +18,18 @@
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
from typing import Union
class Usecase:
def __init__(self, file, product=None, relating_structure=None):
"""Denote that a product is related to a spatial structure
def __init__(
self,
file: ifcopenshell.file,
products: list[ifcopenshell.entity_instance],
relating_structure: ifcopenshell.entity_instance,
):
"""Denote that a list products is related to a list of spatial structures
This is similar to ifcopenshell.api.spatial.assign_container, except
that containment can only occur between a product and a single spatial
@@ -39,13 +46,15 @@ class Usecase:
Referencing is non-hierarchical, so a door may be referenced in multiple
spaces simultaneously.
:param product: The physical IfcElement that exists in the space.
:type product: ifcopenshell.entity_instance.entity_instance
:param products: The list of physical IfcElements that exists in the space.
:type products: list[ifcopenshell.entity_instance.entity_instance]
:param relating_structure: The IfcSpatialStructureElement element, such
as IfcBuilding, IfcBuildingStorey, or IfcSpace that the element
exists in.
:type relating_structure: ifcopenshell.entity_instance.entity_instance
:return: The IfcRelReferencedInSpatialStructure relationship instance
:rtype: ifcopenshell.entity_instance.entity_instance
or `None` if `products` was an empty list.
:rtype: Union[ifcopenshell.entity_instance, None]
Example:
@@ -73,37 +82,43 @@ class Usecase:
ifcopenshell.api.run("spatial.assign_container", model, products=[column], relating_structure=storey1)
# And referenced in the others
ifcopenshell.api.run("spatial.reference_structure", model, product=column, relating_structure=storey2)
ifcopenshell.api.run("spatial.reference_structure", model, product=column, relating_structure=storey3)
ifcopenshell.api.run(
"spatial.reference_structure", model, products=[column], relating_structure=[storey2, storey3]
)
"""
self.file = file
self.settings = {
"product": product,
"products": products,
"relating_structure": relating_structure,
}
def execute(self):
referenced_in_structures = self.settings["product"].ReferencedInStructures
references_elements = self.settings["relating_structure"].ReferencesElements
def execute(self) -> Union[ifcopenshell.entity_instance, None]:
structure = self.settings["relating_structure"]
products = set(self.settings["products"])
for rel in referenced_in_structures:
if rel.RelatingStructure == self.settings["relating_structure"]:
return
if not products:
return
if references_elements:
related_elements = list(references_elements[0].RelatedElements)
related_elements.append(self.settings["product"])
references_elements[0].RelatedElements = related_elements
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": references_elements[0]})
else:
references_elements = self.file.create_entity(
referenced = ifcopenshell.util.element.get_structure_referenced_elements(structure)
products_to_assign = products - referenced
rel = next(iter(structure.ReferencesElements), None)
if not products_to_assign:
return rel
if rel is None:
rel = self.file.create_entity(
"IfcRelReferencedInSpatialStructure",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"RelatedElements": [self.settings["product"]],
"RelatingStructure": self.settings["relating_structure"],
"RelatedElements": list(products_to_assign),
"RelatingStructure": structure,
}
)
else:
related_elements = set(rel.RelatedElements) | products_to_assign
rel.RelatedElements = list(related_elements)
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
return references_elements
return rel
@@ -30,7 +30,7 @@ import functools
import subprocess
import sys
import time
from typing import Union, Any, Callable, TypeVar
from typing import Union, Any, Callable, TypeVar, overload
from . import ifcopenshell_wrapper
from . import settings
@@ -42,66 +42,8 @@ except ImportError as e:
T = TypeVar("T")
def set_derived_attribute(*args):
raise TypeError("Unable to set derived attribute")
def set_unsupported_attribute(*args):
raise TypeError("This is an unsupported attribute type")
# For every schema and its entities populate a list
# of functions for every entity attribute (including
# inherited attributes) to set that particular
# attribute by index.
# For example. IFC2X3.IfcWall with have a list of
# 9 methods. The first will point at
# ifcopenshell.ifcopenshell_wrapper.entity_instance.setArgumentAsString
# because the first attribute GlobalId ultimately
# is of type string.
# Previously, resolving the appropriate function was
# done for each invocation of __setitem__. Now this
# mapping is built once during initialization of the
# module.
_method_dict = {}
def register_schema_attributes(schema):
for decl in schema.declarations():
if hasattr(decl, "argument_types"):
fq_name = ".".join((schema.name(), decl.name()))
# get type strings as reported by IfcOpenShell C++
type_strs = decl.argument_types()
# convert case for setter function
type_strs = [x.title().replace(" ", "") for x in type_strs]
# binary and enumeration are passed from python as string as well
type_strs = [x.replace("Binary", "String") for x in type_strs]
type_strs = [x.replace("Enumeration", "String") for x in type_strs]
# prefix to get method names
fn_names = ["setArgumentAs" + x for x in type_strs]
# resolve to actual functions in wrapper
functions = [
set_derived_attribute
if mname == "setArgumentAsDerived"
else set_unsupported_attribute
if mname == "setArgumentAsUnknown"
else getattr(ifcopenshell_wrapper.entity_instance, mname)
for mname in fn_names
]
_method_dict[fq_name] = functions
for nm in ifcopenshell_wrapper.schema_names():
schema = ifcopenshell_wrapper.schema_by_name(nm)
register_schema_attributes(schema)
# poor man's enum
ATTR_INVALID, ATTR_FORWARD, ATTR_INVERSE, ATTR_FORWARD_DERIVED = range(4)
class entity_instance(object):
"""Base class for all IFC objects.
@@ -120,44 +62,22 @@ class entity_instance(object):
>>> #423=IfcProductDefinitionShape($,$,(#409,#421))
"""
wrapped_data: ifcopenshell_wrapper.entity_instance
def __init__(self, e, file=None):
if isinstance(e, tuple):
e = ifcopenshell_wrapper.new_IfcBaseClass(*e)
super(entity_instance, self).__setattr__("wrapped_data", e)
super(entity_instance, self).__setattr__("method_list", None)
# Make sure the file is not gc'ed while we have live instances
self.wrapped_data.file = file
def __del__(self):
"""
#2471 while the precise chain of action is unclear, creating
instance references prevents file gc, even with all instance
refs deleted. This is a work-around for that.
"""
self.wrapped_data.file = None
@property
def file(self):
# ugh circular imports, name collisions
from . import file
return file.from_pointer(self.wrapped_data.file_pointer())
return file.from_pointer(self.file_pointer())
def __getattr__(self, name):
INVALID, FORWARD, INVERSE = range(3)
attr_cat = self.wrapped_data.get_attribute_category(name)
if attr_cat == FORWARD:
idx = self.wrapped_data.get_argument_index(name)
if _method_dict[self.is_a(True)][idx] != set_derived_attribute:
# A bit ugly, but we fall through to derived attribute handling below
return entity_instance.wrap_value(self.wrapped_data.get_argument(idx), self.wrapped_data.file)
elif attr_cat == INVERSE:
vs = entity_instance.wrap_value(self.wrapped_data.get_inverse(name), self.wrapped_data.file)
attr_cat = self.get_attribute_category(name)
if attr_cat == ATTR_FORWARD:
idx = self.get_argument_index(name)
return self.get_argument(idx)
elif attr_cat == ATTR_INVERSE:
vs = self.get_inverse(name)
if settings.unpack_non_aggregate_inverses:
schema_name = self.wrapped_data.is_a(True).split(".")[0]
schema_name = self.is_a(True).split(".")[0]
ent = ifcopenshell_wrapper.schema_by_name(schema_name).declaration_by_name(self.is_a())
inv = [i for i in ent.all_inverse_attributes() if i.name() == name][0]
if (inv.bound1(), inv.bound2()) == (-1, -1):
@@ -166,9 +86,9 @@ class entity_instance(object):
else:
vs = None
return vs
# derived attribute perhaps?
schema_name = self.wrapped_data.is_a(True).split(".")[0]
schema_name = self.is_a(True).split(".")[0]
try:
rules = importlib.import_module(f"ifcopenshell.express.rules.{schema_name}")
except:
@@ -180,21 +100,21 @@ class entity_instance(object):
subprocess.run([sys.executable, "-m", "ifcopenshell.express.rule_compiler", schema_path, fn], check=True)
time.sleep(1.)
rules = importlib.import_module(schema_name)
def yield_supertypes():
decl = ifcopenshell_wrapper.schema_by_name(schema_name).declaration_by_name(self.is_a())
while decl:
yield decl.name()
decl = decl.supertype()
for sty in yield_supertypes():
fn = getattr(rules, f"calc_{sty}_{name}", None)
if fn:
return fn(self)
if attr_cat != FORWARD:
raise AttributeError(
"entity instance of type '%s' has no attribute '%s'" % (self.wrapped_data.is_a(True), name)
"entity instance of type '%s' has no attribute '%s'" % (self.is_a(True), name)
)
@staticmethod
@@ -235,26 +155,6 @@ class entity_instance(object):
else:
return value
@staticmethod
def wrap_value(v, file):
def wrap(e):
return entity_instance(e, file)
def is_instance(e):
return isinstance(e, ifcopenshell_wrapper.entity_instance)
return entity_instance.walk(is_instance, wrap, v)
@staticmethod
def unwrap_value(v):
def unwrap(e):
return e.wrapped_data
def is_instance(e):
return isinstance(e, entity_instance)
return entity_instance.walk(is_instance, unwrap, v)
def attribute_type(self, attr: int) -> str:
"""Return the data type of a positional attribute of the element
@@ -262,8 +162,8 @@ class entity_instance(object):
:type attr: int
:rtype: string
"""
attr_idx = attr if isinstance(attr, numbers.Integral) else self.wrapped_data.get_argument_index(attr)
return self.wrapped_data.get_argument_type(attr_idx)
attr_idx = attr if isinstance(attr, numbers.Integral) else self.get_argument_index(attr)
return self.get_argument_type(attr_idx)
def attribute_name(self, attr_idx: int) -> str:
"""Return the name of a positional attribute of the element
@@ -272,37 +172,28 @@ class entity_instance(object):
:type attr_idx: int
:rtype: string
"""
return self.wrapped_data.get_argument_name(attr_idx)
return self.get_argument_name(attr_idx)
def __setattr__(self, key: str, value: Any) -> None:
index = self.wrapped_data.get_argument_index(key)
index = self.get_argument_index(key)
self[index] = value
def __getitem__(self, key: int) -> Any:
if key < 0 or key >= len(self):
raise IndexError("Attribute index {} out of range for instance of type {}".format(key, self.is_a()))
return entity_instance.wrap_value(self.wrapped_data.get_argument(key), self.wrapped_data.file)
return self.get_argument(key)
def __setitem__(self, idx: int, value: T) -> T:
if self.wrapped_data.file and self.wrapped_data.file.transaction:
self.wrapped_data.file.transaction.store_edit(self, idx, value)
if self.method_list is None:
super(entity_instance, self).__setattr__("method_list", _method_dict[self.is_a(True)])
method = self.method_list[idx]
if value is None:
if method is not set_derived_attribute:
self.wrapped_data.setArgumentAsNull(idx)
else:
self.method_list[idx](self.wrapped_data, idx, entity_instance.unwrap_value(value))
if self.file and self.file.transaction:
self.file.transaction.store_edit(self, idx, value)
self.setAttribute(idx, value)
return value
def __len__(self):
return len(self.wrapped_data)
def __repr__(self):
return repr(self.wrapped_data)
@@ -315,17 +206,27 @@ class entity_instance(object):
the specific control directives.
"""
return self.wrapped_data.to_string(valid_spf)
return self.to_string(valid_spf)
def is_a(self, *args) -> Union[str, bool]:
@overload
def is_a(self) -> str: ...
@overload
def is_a(self, ifc_class: str) -> bool: ...
@overload
def is_a(self, with_schema: bool) -> str: ...
def is_a(self, *args: Union[str, bool]) -> Union[str, bool]:
"""Return the IFC class name of an instance, or checks if an instance belongs to a class.
The check will also return true if a parent class name is provided.
:param args: If specified, is a case insensitive IFC class name to check
:type args: string
or if specified as a boolean then will define whether
returned IFC class name should include schema name
(e.g. "IFC4.IfcWall" if `True` and "IfcWall" if `False`).
If omitted will act as `False`.
:type args: Union[str, bool]
:returns: Either the name of the class, or a boolean if it passes the check
:rtype: string|bool
:rtype: Union[str, bool]
Example:
@@ -338,19 +239,19 @@ class entity_instance(object):
f.is_a('IfcPerson')
>>> True
"""
return self.wrapped_data.is_a(*args)
return self.is_a(*args)
def id(self) -> int:
"""Return the STEP numerical identifier
:rtype: int
"""
return self.wrapped_data.id()
return self.id()
def __eq__(self, other):
if not isinstance(self, type(other)):
return False
elif None in (self.wrapped_data.file, other.wrapped_data.file):
elif None in (self.file, other.file):
# when not added to a file, we can only compare attribute values
# and we need this for where rule evaluation
return self.get_info(recursive=True, include_identifier=False) == other.get_info(
@@ -363,10 +264,10 @@ class entity_instance(object):
if self.id():
return self.wrapped_data == other.wrapped_data
else:
return (self.is_a(), self[0], self.wrapped_data.file_pointer()) == (
return (self.is_a(), self[0], self.file_pointer()) == (
other.is_a(),
other[0],
other.wrapped_data.file_pointer(),
other.file_pointer(),
)
def is_entity(self) -> bool:
@@ -375,7 +276,7 @@ class entity_instance(object):
Returns:
bool: True if the instance is an entity
"""
schema_name = self.wrapped_data.is_a(True).split(".")[0]
schema_name = self.is_a(True).split(".")[0]
decl = ifcopenshell_wrapper.schema_by_name(schema_name).declaration_by_name(self.is_a())
return isinstance(decl, ifcopenshell_wrapper.entity)
@@ -449,17 +350,17 @@ class entity_instance(object):
# step id. Selected type instances (such as IfcPropertySingleValue.NominalValue
# always have id=0, so we hash <type, value, file pointer>
if self.id():
return hash((self.id(), self.wrapped_data.file_pointer()))
return hash((self.id(), self.file_pointer()))
else:
return hash((self.is_a(), self[0], self.wrapped_data.file_pointer()))
return hash((self.is_a(), self[0], self.file_pointer()))
def __dir__(self):
return sorted(
set(
itertools.chain(
dir(type(self)),
map(str, self.wrapped_data.get_attribute_names()),
map(str, self.wrapped_data.get_inverse_attribute_names()),
map(str, self.get_attribute_names()),
map(str, self.get_inverse_attribute_names()),
)
)
)
@@ -503,7 +404,7 @@ class entity_instance(object):
logging.exception("unhandled exception while getting id / type info on {}".format(self))
for i in range(len(self)):
try:
if self.wrapped_data.get_attribute_names()[i] in ignore:
if self.get_attribute_names()[i] in ignore:
continue
attr_value = self[i]
@@ -538,7 +439,8 @@ class entity_instance(object):
return return_type(_())
__dict__ = property(get_info)
# @todo this is no longer possible with the direct integration into the swig type
# __dict__ = property(get_info)
def get_info_2(self, include_identifier=True, recursive=False, return_type=dict, ignore=()):
"""More perfomant version of `.get_info()` but with limited arguments values.\n
@@ -41,6 +41,17 @@ class Implementation(codegen.Base):
write = lambda str, **kwargs: enumeration_functions.append(str % kwargs)
collections_by_type = (
("entity", mapping.schema.entities),
("type_declaration", mapping.schema.simpletypes),
("select_type", mapping.schema.selects),
("enumeration_type", mapping.schema.enumerations),
)
self.names = []
for _, collection in collections_by_type:
self.names.extend(collection.keys())
self.names.sort(key=str.lower)
for name, enum in mapping.schema.enumerations.items():
short_name = name[:-4] if name.endswith("Enum") else name
context = locals()
@@ -50,6 +61,7 @@ class Implementation(codegen.Base):
name=name,
schema_name=schema_name,
schema_name_upper=schema_name_upper,
index_in_schema=self.names.index(str(name)),
values=catc(map(stringify, enum.values)),
from_string_statements=catnl(
templates.enum_from_string_stmt % dict(context, **locals()) for value in enum.values
@@ -61,7 +73,8 @@ class Implementation(codegen.Base):
templates.select_function,
name=name,
schema_name=schema_name,
schema_name_upper=schema_name_upper
schema_name_upper=schema_name_upper,
index_in_schema=self.names.index(str(name)),
)
write = lambda str, **kwargs: entity_implementations.append(str % kwargs)
@@ -140,6 +153,8 @@ class Implementation(codegen.Base):
return templates.set_attr_stmt_enum
elif arg["is_templated_list"] and not (select or simple or express):
return templates.set_attr_stmt_array
elif arg["full_type"].endswith('*'):
return templates.set_attr_instance
else:
return templates.set_attr_stmt
@@ -159,6 +174,7 @@ class Implementation(codegen.Base):
"non_optional_type": arg["non_optional_type"].replace("::Value", ""),
"star_if_optional": "*" if "boost::optional" in arg["full_type"] else "",
"check_optional_set_begin": "if (v) {" if "boost::optional" in arg["full_type"] else "",
"check_optional_set_else": "} else {" if "boost::optional" in arg["full_type"] else "if constexpr (false)",
"check_optional_set_end": "}" if "boost::optional" in arg["full_type"] else "",
},
)
@@ -175,6 +191,8 @@ class Implementation(codegen.Base):
if arg["is_templated_list"]
else templates.constructor_stmt_enum
if arg["is_enum"]
else templates.constructor_stmt_instance
if arg["full_type"].endswith('*')
else templates.constructor_stmt
)
impl = tmpl % {
@@ -208,6 +226,7 @@ class Implementation(codegen.Base):
"body": templates.get_inverse
% {
"type": i.entity,
"type_index": self.names.index(i.entity),
"index": get_attribute_index(i.entity, i.attribute),
"schema_name": schema_name,
"schema_name_upper": schema_name_upper,
@@ -233,6 +252,7 @@ class Implementation(codegen.Base):
superclass=superclass,
schema_name=schema_name,
schema_name_upper=schema_name_upper,
index_in_schema=self.names.index(str(name)),
)
selectable_simple_types = sorted(
@@ -306,6 +326,7 @@ class Implementation(codegen.Base):
def compose(params, schema_name=schema_name, schema_name_upper=schema_name_upper):
class_name, attr_type, superclass, superclass_init, name, tmpl, return_type, args, body = params
index_in_schema = self.names.index(str(class_name))
underlying_type = mapping.list_instance_type(type)
arguments = ",".join(args)
body = body % locals()
@@ -347,6 +368,7 @@ class Implementation(codegen.Base):
)
simple_type_impl.append("")
"""
external_definitions = (
[("extern entity* %s_%%s_type;" % schema_name_upper) % n for n in mapping.schema.entities.keys()]
+ [
@@ -362,6 +384,8 @@ class Implementation(codegen.Base):
for n in mapping.schema.selects.keys()
]
)
"""
external_definitions = ["extern declaration* %s_types[%d];" % (schema_name_upper, len(self.names))]
self.str = templates.implementation % {
"schema_name_upper": schema_name_upper,
@@ -18,6 +18,7 @@
import operator
import re
import nodes
import codegen
@@ -116,8 +117,26 @@ class LateBoundSchemaInstantiator:
elem.this.disown()
class string_pool:
def __init__(self, fn):
self.di = {}
self.fn = fn
def append(self, v):
def _():
if i := self.di.get(v):
return i
else:
i = len(self.di)
self.di[v] = i
return i
return self.fn(_())
def __iter__(self):
return iter(self.di.keys())
class EarlyBoundCodeWriter:
def __init__(self, schema_name):
self.strings = string_pool(lambda i: "strings[%d]" % i)
self.schema_name = schema_name
self.schema_name_title = schema_name.capitalize()
@@ -125,7 +144,9 @@ class EarlyBoundCodeWriter:
"",
'#include "../ifcparse/IfcSchema.h"',
'#include "../ifcparse/%(schema_name_title)s.h"' % self.__dict__,
'#include <string>',
"",
'using namespace std::string_literals;',
"using namespace IfcParse;",
"",
]
@@ -146,145 +167,138 @@ class EarlyBoundCodeWriter:
def declare(self, definition_type, name):
schema_name = self.schema_name
self.statements.append("%(definition_type)s* %(schema_name)s_%(name)s_type = 0;" % locals())
# self.statements.append("%(definition_type)s* %(schema_name)s_%(name)s_type = 0;" % locals())
self.names.append(name)
def begin_schema(self):
self.names.sort(key=str.lower)
schema_name = self.schema_name
num_names = len(self.names)
self.statements.append("declaration* %(schema_name)s_types[%(num_names)d] = {nullptr};" % locals())
self.statements.append("{string_pool_placeholder}")
self.statements.append("{factory_placeholder}")
self.statements.append(
"""
#if defined(__clang__)
__attribute__((optnone))
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC push_options
#pragma GCC optimize ("O0")
#elif defined(_MSC_VER)
#pragma optimize("", off)
#endif
"""
)
# self.statements.append(
# """
# #if defined(__clang__)
# __attribute__((optnone))
# #elif defined(__GNUC__) || defined(__GNUG__)
# #pragma GCC push_options
# #pragma GCC optimize ("O0")
# #elif defined(_MSC_VER)
# #pragma optimize("", off)
# #endif
# """
# )
self.statements.append("IfcParse::schema_definition* %s_populate_schema() {" % self.schema_name)
def typedef(self, name, declared_type):
schema_name = self.schema_name
index_in_schema = self.names.index(name)
ref = self.strings.append(name)
self.statements.append(
' %(schema_name)s_%(name)s_type = new type_declaration("%(name)s", %(index_in_schema)d, %(declared_type)s);'
' %(schema_name)s_types[%(index_in_schema)d] = new type_declaration(%(ref)s, %(index_in_schema)d, %(declared_type)s);'
% locals()
)
def enumeration(self, name, enum):
schema_name = self.schema_name
index_in_schema = self.names.index(name)
self.statements.append(" {")
self.statements.append(" std::vector<std::string> items; items.reserve(%d);" % len(enum.values))
self.statements.extend(map(lambda v: ' items.push_back("%s");' % v, sorted(enum.values)))
ref = self.strings.append(name)
items = ",".join(self.strings.append(v) for v in sorted(enum.values))
self.statements.append(
' %(schema_name)s_%(name)s_type = new enumeration_type("%(name)s", %(index_in_schema)d, items);'
' %(schema_name)s_types[%(index_in_schema)d] = new enumeration_type(%(ref)s, %(index_in_schema)d, {%(items)s});'
% locals()
)
self.statements.append(" }")
def entity(self, name, type):
schema_name = self.schema_name
index_in_schema = self.names.index(name)
supertype = "0" if len(type.supertypes) == 0 else "%s_%s_type" % (self.schema_name, type.supertypes[0])
ref = self.strings.append(name)
supertype = "0" if len(type.supertypes) == 0 else "%s_types[%d]" % (self.schema_name, self.names.index(type.supertypes[0]))
is_abstract = "true" if type.abstract else "false"
self.statements.append(
' %(schema_name)s_%(name)s_type = new entity("%(name)s", %(is_abstract)s, %(index_in_schema)d, %(supertype)s);'
' %(schema_name)s_types[%(index_in_schema)d] = new entity(%(ref)s, %(is_abstract)s, %(index_in_schema)d, (entity*) %(supertype)s);'
% locals()
)
def select(self, name, type):
schema_name = self.schema_name
index_in_schema = self.names.index(name)
self.statements.append(" {")
self.statements.append(" std::vector<const declaration*> items; items.reserve(%d);" % len(type.values))
self.statements.extend(
map(lambda v: " items.push_back(%s_%s_type);" % (self.schema_name, v), sorted(map(str, type.values)))
ref = self.strings.append(name)
items = ",".join(
map(lambda v: "%s_types[%d]" % (self.schema_name, self.names.index(v)), sorted(map(str, type.values)))
)
self.statements.append(
' %(schema_name)s_%(name)s_type = new select_type("%(name)s", %(index_in_schema)d, items);'
' %(schema_name)s_types[%(index_in_schema)d] = new select_type(%(ref)s, %(index_in_schema)d, {%(items)s});'
% locals()
)
self.statements.append(" }")
def entity_attributes(self, name, attribute_definitions, is_derived):
schema_name = self.schema_name
self.statements.append(" {")
self.statements.append(
" std::vector<const attribute*> attributes; attributes.reserve(%d);" % len(attribute_definitions)
)
for attr_name, decl_type, optional in attribute_definitions:
optional_cpp = str(optional).lower()
self.statements.append(
' attributes.push_back(new attribute("%(attr_name)s", %(decl_type)s, %(optional_cpp)s));'
% locals()
)
self.statements.append(" std::vector<bool> derived; derived.reserve(%d);" % len(is_derived))
self.statements.append(
" " + " ".join(map(lambda b: "derived.push_back(%s);" % str(b).lower(), is_derived))
)
self.statements.append(" %(schema_name)s_%(name)s_type->set_attributes(attributes, derived);" % locals())
self.statements.append(" }")
index_in_schema = self.names.index(name)
def _():
index_in_schema = self.names.index(name)
schema_name = self.schema_name
for attr_name, decl_type, optional in attribute_definitions:
attr_name_ref = self.strings.append(attr_name)
optional_cpp = str(optional).lower()
yield 'new attribute(%(attr_name_ref)s, %(decl_type)s, %(optional_cpp)s)' % locals()
attributes = ",".join(_())
derived = ",".join(map(lambda b: str(b).lower(), is_derived))
self.statements.append(" ((entity*)%(schema_name)s_types[%(index_in_schema)d])->set_attributes({%(attributes)s}, {%(derived)s});" % locals())
def inverse_attributes(self, name, inv_attrs):
schema_name = self.schema_name
self.statements.append(" {")
self.statements.append(
" std::vector<const inverse_attribute*> attributes; attributes.reserve(%d);" % len(inv_attrs)
)
for attr_name, aggr_type, bound1, bound2, entity_ref, attribute_entity, attribute_entity_index in inv_attrs:
self.statements.append(
' attributes.push_back(new inverse_attribute("%(attr_name)s", inverse_attribute::%(aggr_type)s_type, %(bound1)d, %(bound2)d, %(schema_name)s_%(entity_ref)s_type, %(schema_name)s_%(attribute_entity)s_type->attributes()[%(attribute_entity_index)d]));'
% locals()
)
self.statements.append(" %(schema_name)s_%(name)s_type->set_inverse_attributes(attributes);" % locals())
self.statements.append(" }")
index_in_schema = self.names.index(name)
def _():
schema_name = self.schema_name
index_in_schema = self.names.index(name)
for attr_name, aggr_type, bound1, bound2, entity_ref, attribute_entity, attribute_entity_index in inv_attrs:
attr_name_ref = self.strings.append(attr_name)
opposite_index_in_schema = self.names.index(entity_ref)
opposite1 = '%(schema_name)s_types[%(opposite_index_in_schema)d]' % locals()
opposite_index_in_schema = self.names.index(attribute_entity)
opposite2 = '%(schema_name)s_types[%(opposite_index_in_schema)d]' % locals()
yield 'new inverse_attribute(%(attr_name_ref)s, inverse_attribute::%(aggr_type)s_type, %(bound1)d, %(bound2)d, ((entity*) %(opposite1)s), ((entity*) %(opposite2)s)->attributes()[%(attribute_entity_index)d])' % locals()
attributes = ",".join(_())
self.statements.append(" ((entity*) %(schema_name)s_types[%(index_in_schema)d])->set_inverse_attributes({%(attributes)s});" % locals())
def entity_subtypes(self, name, tys):
schema_name = self.schema_name
self.statements.append(" {")
self.statements.append(" std::vector<const entity*> defs; defs.reserve(%d);" % len(tys))
self.statements.append(
(" " + "".join(map(lambda t: ("defs.push_back(%%(schema_name)s_%s_type);" % t), tys))) % locals()
)
self.statements.append(" %(schema_name)s_%(name)s_type->set_subtypes(defs);" % locals())
self.statements.append(" }")
index_in_schema = self.names.index(name)
subtypes = ",".join(map(lambda t: ("((entity*) %%(schema_name)s_types[%d])" % self.names.index(t)), tys)) % locals()
self.statements.append(" ((entity*) %(schema_name)s_types[%(index_in_schema)d])->set_subtypes({%(subtypes)s});" % locals())
def finalize(self, can_be_instantiated_set):
schema_name = self.schema_name
schema_name_title = self.schema_name.capitalize()
num_declarations = len(self.names)
self.statements.append("")
def _():
schema_name = self.schema_name
schema_name_title = self.schema_name.capitalize()
for type_name in self.names:
index_in_schema = self.names.index(type_name)
yield "%(schema_name)s_types[%(index_in_schema)d]" % locals()
declarations = ",".join(_())
schema_name_ref = self.strings.append(schema_name)
self.statements.append(
" std::vector<const declaration*> declarations; declarations.reserve(%(num_declarations)d);" % locals()
)
for type_name in self.names:
self.statements.append(" declarations.push_back(%(schema_name)s_%(type_name)s_type);" % locals())
self.statements.append(
' return new schema_definition("%(schema_name)s", declarations, new %(schema_name)s_instance_factory());'
' return new schema_definition(%(schema_name_ref)s, {%(declarations)s}, new %(schema_name)s_instance_factory());'
% locals()
)
self.statements.append("}");
self.statements.extend(("}", ""))
self.statements.append(
"""
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC pop_options
#elif defined(_MSC_VER)
#pragma optimize("", on)
#endif
"""
)
# self.statements.append(
# """
# #if defined(__clang__)
# #elif defined(__GNUC__) || defined(__GNUG__)
# #pragma GCC pop_options
# #elif defined(_MSC_VER)
# #pragma optimize("", on)
# #endif
# """
# )
self.statements.extend(
(
@@ -336,6 +350,14 @@ class %(schema_name)s_instance_factory : public IfcParse::instance_factory {
% locals()
)
""
self.statements[self.statements.index("{string_pool_placeholder}")] = (
"""
const std::string strings[] = {%s};
"""
% ",".join(map(lambda s: '"%s"s' % s, self.strings))
)
def __str__(self):
return "\n".join(self.statements)
@@ -352,6 +374,23 @@ class SchemaClass(codegen.Base):
x = code(schema_name)
def transform_to_indexed(fn):
def wrapper(*args, **kwargs):
declared_type = fn(*args, **kwargs)
if 'simple_type' in declared_type:
pass
else:
match = re.search(r'\((\w+?_[\w+]+?_\w+?)\)', declared_type)
if match:
old_decl = match.group(1)
tn = old_decl.rsplit('_', 2)[1]
idx = x.names.index(tn)
snu = schema_name.upper()
declared_type = declared_type.replace(old_decl, '%(snu)s_types[%(idx)d]' % locals())
return declared_type
return wrapper if code == EarlyBoundCodeWriter else fn
@transform_to_indexed
def get_declared_type(type, emitted_names=None):
if isinstance(type, nodes.SimpleType):
type = type.type
@@ -469,9 +508,8 @@ class SchemaClass(codegen.Base):
if write(name):
emitted.add(name.lower())
declarations_by_index.append(name)
declared_types.append("%(schema_name)s_%(name)s_type" % locals())
num_declarations = len(declared_types)
num_declarations = len(emitted)
for name, type in mapping.schema.entities.items():
derived = set(mapping.derived_in_supertype(type))
@@ -124,19 +124,18 @@ simpletype_impl_argument_type = 'if (i == 0) { return %(attr_type)s; } else { th
simpletype_impl_argument = "return data_->getArgument(i);"
simpletype_impl_is_with_supertype = "return v == %(class_name)s_type || %(superclass)s::is(v);"
simpletype_impl_is_without_supertype = "return v == %(class_name)s_type;"
simpletype_impl_type = "return *%(schema_name_upper)s_%(class_name)s_type;"
simpletype_impl_class = "return *%(schema_name_upper)s_%(class_name)s_type;"
simpletype_impl_type = "return *((IfcParse::type_declaration*)%(schema_name_upper)s_types[%(index_in_schema)d]);"
simpletype_impl_class = "return *((IfcParse::type_declaration*)%(schema_name_upper)s_types[%(index_in_schema)d]);"
simpletype_impl_explicit_constructor = "data_ = e;"
simpletype_impl_constructor = (
"data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(class_name)s_type); {IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(v"
+ "); data_->setArgument(0, attr);}"
"data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]); set_value(0, v);"
)
simpletype_impl_constructor_templated = "data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(class_name)s_type); {IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(v->generalize()); data_->setArgument(0, attr);}"
simpletype_impl_constructor_templated = "data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]); set_value(0, v->generalize());"
simpletype_impl_cast = "return *data_->getArgument(0);"
simpletype_impl_cast_templated = (
"aggregate_of_instance::ptr es = *data_->getArgument(0); return es->as< %(underlying_type)s >();"
)
simpletype_impl_declaration = "return *%(schema_name_upper)s_%(class_name)s_type;"
simpletype_impl_declaration = "return *((IfcParse::type_declaration*)%(schema_name_upper)s_types[%(index_in_schema)d]);"
select = """%(documentation)s
class IFC_PARSE_API %(name)s : public virtual IfcUtil::IfcBaseInterface {
@@ -174,40 +173,33 @@ public:
"""
select_function = """
const IfcParse::select_type& %(schema_name)s::%(name)s::Class() { return *%(schema_name_upper)s_%(name)s_type; }
const IfcParse::select_type& %(schema_name)s::%(name)s::Class() { return *((IfcParse::select_type*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
"""
enumeration_function = """
const IfcParse::enumeration_type& %(schema_name)s::%(name)s::declaration() const { return *%(schema_name_upper)s_%(name)s_type; }
const IfcParse::enumeration_type& %(schema_name)s::%(name)s::Class() { return *%(schema_name_upper)s_%(name)s_type; }
const IfcParse::enumeration_type& %(schema_name)s::%(name)s::declaration() const { return *((IfcParse::enumeration_type*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
const IfcParse::enumeration_type& %(schema_name)s::%(name)s::Class() { return *((IfcParse::enumeration_type*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData* e) {
data_ = e;
}
%(schema_name)s::%(name)s::%(name)s(Value v) {
data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(name)s_type);
IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();
attr->set(IfcWrite::IfcWriteArgument::EnumerationReference(v,ToString(v)));
data_->setArgument(0,attr);
data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]);
set_value(0, IfcWrite::IfcWriteArgument::EnumerationReference(v,ToString(v)));
}
%(schema_name)s::%(name)s::%(name)s(const std::string& v) {
data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(name)s_type);
IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();
attr->set(IfcWrite::IfcWriteArgument::EnumerationReference(FromString(v),ToString(FromString(v))));
data_->setArgument(0,attr);
data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]);
set_value(0, IfcWrite::IfcWriteArgument::EnumerationReference(FromString(v),ToString(FromString(v))));
}
const char* %(schema_name)s::%(name)s::ToString(Value v) {
if ( v < 0 || v >= %(max_id)d ) throw IfcException("Unable to find keyword in schema");
const char* names[] = { %(values)s };
return names[v];
return %(schema_name)s::%(name)s::%(name)s::Class().lookup_enum_value((size_t)v);
}
%(schema_name)s::%(name)s::Value %(schema_name)s::%(name)s::FromString(const std::string& s) {
%(from_string_statements)s
throw IfcException("Unable to find keyword in schema: " + s);
return (%(schema_name)s::%(name)s::Value) %(schema_name)s::%(name)s::%(name)s::Class().lookup_enum_offset(s);
}
%(schema_name)s::%(name)s::operator %(schema_name)s::%(name)s::Value() const {
@@ -218,10 +210,10 @@ const char* %(schema_name)s::%(name)s::ToString(Value v) {
entity_implementation = """// Function implementations for %(name)s
%(attributes)s
%(inverse)s
const IfcParse::entity& %(schema_name)s::%(name)s::declaration() const { return *%(schema_name_upper)s_%(name)s_type; }
const IfcParse::entity& %(schema_name)s::%(name)s::Class() { return *%(schema_name_upper)s_%(name)s_type; }
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData* e) : %(superclass)s { if (!e) return; if (e->type() != %(schema_name_upper)s_%(name)s_type) throw IfcException("Unable to find keyword in schema"); data_ = e; }
%(schema_name)s::%(name)s::%(name)s(%(constructor_arguments)s) : %(superclass)s {data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(name)s_type); %(constructor_implementation)s }
const IfcParse::entity& %(schema_name)s::%(name)s::declaration() const { return *((IfcParse::entity*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
const IfcParse::entity& %(schema_name)s::%(name)s::Class() { return *((IfcParse::entity*)%(schema_name_upper)s_types[%(index_in_schema)d]); }
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData* e) : %(superclass)s { data_ = e; }
%(schema_name)s::%(name)s::%(name)s(%(constructor_arguments)s) : %(superclass)s {data_ = new IfcEntityInstanceData(%(schema_name_upper)s_types[%(index_in_schema)d]); %(constructor_implementation)s }
"""
optional_attribute_description = "/// Whether the optional attribute %s is defined for this %s"
@@ -257,36 +249,36 @@ get_attr_stmt_entity = "%(null_check)s return ((IfcUtil::IfcBaseClass*)(*data_->
get_attr_stmt_array = "%(null_check)s aggregate_of_instance::ptr es = *data_->getArgument(%(index)d); return es->as< %(list_instance_type)s >();"
get_attr_stmt_nested_array = "%(null_check)s aggregate_of_aggregate_of_instance::ptr es = *data_->getArgument(%(index)d); return es->as< %(list_instance_type)s >();"
get_inverse = "return data_->getInverse(%(schema_name_upper)s_%(type)s_type, %(index)d)->as<%(type)s>();"
get_inverse = "return data_->getInverse(%(schema_name_upper)s_types[%(type_index)d], %(index)d)->as<%(type)s>();"
set_attr_stmt = (
"{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();%(check_optional_set_begin)sattr->set(%(star_if_optional)sv"
+ ");%(check_optional_set_end)sdata_->setArgument(%(index)d,attr);}"
"%(check_optional_set_begin)sset_value(%(index)d, %(star_if_optional)sv);%(check_optional_set_else)sunset_value(%(index)d);%(check_optional_set_end)s"
)
set_attr_stmt_enum = "{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();%(check_optional_set_begin)sattr->set(IfcWrite::IfcWriteArgument::EnumerationReference(%(star_if_optional)sv,%(non_optional_type)s::ToString(%(star_if_optional)sv)));%(check_optional_set_end)sdata_->setArgument(%(index)d,attr);}"
set_attr_instance = (
"%(check_optional_set_begin)sset_value(%(index)d, v->as<IfcUtil::IfcBaseClass>());%(check_optional_set_else)sunset_value(%(index)d);%(check_optional_set_end)s"
)
set_attr_stmt_enum = "%(check_optional_set_begin)sset_value(%(index)d, IfcWrite::IfcWriteArgument::EnumerationReference(%(star_if_optional)sv,%(non_optional_type)s::ToString(%(star_if_optional)sv)));%(check_optional_set_else)sunset_value(%(index)d);%(check_optional_set_end)s"
set_attr_stmt_array = (
"{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();%(check_optional_set_begin)sattr->set((%(star_if_optional)sv)->generalize()"
+ ");%(check_optional_set_end)sdata_->setArgument(%(index)d,attr);}"
"%(check_optional_set_begin)sset_value(%(index)d, (%(star_if_optional)sv)->generalize());%(check_optional_set_else)sunset_value(%(index)d);%(check_optional_set_end)s"
)
constructor_stmt = (
"{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((%(name)s)"
+ ");data_->setArgument(%(index)d,attr);}"
"set_value(%(index)d, (%(name)s));"
)
constructor_stmt_enum = (
"{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((IfcWrite::IfcWriteArgument::EnumerationReference(%(name)s,%(type)s::ToString(%(name)s)))"
+ ");data_->setArgument(%(index)d,attr);}"
"set_value(%(index)d, (IfcWrite::IfcWriteArgument::EnumerationReference(%(name)s,%(type)s::ToString(%(name)s))));"
)
constructor_stmt_array = (
"{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((%(name)s)->generalize()"
+ ");data_->setArgument(%(index)d,attr);}"
"set_value(%(index)d, (%(name)s)->generalize());"
)
constructor_stmt_derived = (
"{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set(IfcWrite::IfcWriteArgument::Derived()"
+ ");data_->setArgument(%(index)d,attr);}"
""
)
constructor_stmt_instance = (
"set_value(%(index)d, %(name)s ? %(name)s->as<IfcUtil::IfcBaseClass>() : (IfcUtil::IfcBaseClass*) nullptr);"
)
constructor_stmt_optional = " if (%(name)s) {%(stmt)s } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(%(index)d, attr); }"
constructor_stmt_optional = " if (%(name)s) {%(stmt)s }"
inverse_implementation = ' inverse_map[Type::%(type)s].insert(std::make_pair("%(name)s", std::make_pair(Type::%(related_type)s, %(index)d)));'
+19 -20
View File
@@ -28,7 +28,7 @@ import numbers
import zipfile
import functools
from pathlib import Path
from typing import List, Optional
from typing import Optional, Any
import ifcopenshell.util.element
import ifcopenshell.util.file
@@ -52,7 +52,7 @@ class Transaction:
self.batch_delete_ids = set()
self.batch_inverses = []
def serialise_entity_instance(self, element):
def serialise_entity_instance(self, element: ifcopenshell.entity_instance) -> dict[str, Any]:
info = element.get_info()
for key, value in info.items():
info[key] = self.serialise_value(element, value)
@@ -103,7 +103,7 @@ class Transaction:
}
)
def store_delete(self, element):
def store_delete(self, element: ifcopenshell.entity_instance) -> None:
inverses = {}
if self.is_batched:
if element.id() not in self.batch_delete_ids:
@@ -328,7 +328,7 @@ class file(object):
"""
eid = kwargs.pop("id", -1)
e = entity_instance((self.schema_identifier, type), self)
e = ifcopenshell_wrapper.make_instance(self.schema_identifier, type)
# Create pairs of {attribute index, attribute value}.
# Keyword arguments are mapped to their corresponding
@@ -337,7 +337,7 @@ class file(object):
# @todo we should probably check that values for
# attributes are not passed as duplicates using
# both regular arguments and keyword arguments.
attrs = list(enumerate(args)) + [(e.wrapped_data.get_argument_index(name), arg) for name, arg in kwargs.items()]
attrs = list(enumerate(args)) + [(e.get_argument_index(name), arg) for name, arg in kwargs.items()]
# Don't store these attributes as transactions
# as the creation it self is already stored with
@@ -353,14 +353,13 @@ class file(object):
if attrs:
self.transaction = transaction
# Once the values are populated add the instance
# Once the values are populated move the instance
# to the file.
self.wrapped_data.add(e.wrapped_data, eid)
e = self.wrapped_data.add(e, eid)
# The file container now handles the lifetime of
# this instance. Tell SWIG that it is no longer
# the owner.
e.wrapped_data.this.disown()
if self.transaction:
self.transaction.store_create(e)
@@ -398,9 +397,9 @@ class file(object):
def __getitem__(self, key):
if isinstance(key, numbers.Integral):
return entity_instance(self.wrapped_data.by_id(key), self)
return self.wrapped_data.by_id(key)
elif isinstance(key, basestring):
return entity_instance(self.wrapped_data.by_guid(str(key)), self)
return self.wrapped_data.by_guid(str(key))
def by_id(self, id: int) -> ifcopenshell.entity_instance:
"""Return an IFC entity instance filtered by IFC ID.
@@ -441,8 +440,8 @@ class file(object):
if self.transaction:
max_id = self.wrapped_data.getMaxId()
inst.wrapped_data.this.disown()
result = entity_instance(self.wrapped_data.add(inst.wrapped_data, -1 if _id is None else _id), self)
# inst.wrapped_data.this.disown()
result = self.wrapped_data.add(inst, -1 if _id is None else _id)
if self.transaction:
added_elements = [e for e in self.traverse(result) if e.id() > max_id]
[self.transaction.store_create(e) for e in reversed(added_elements)]
@@ -461,8 +460,8 @@ class file(object):
:rtype: list[ifcopenshell.entity_instance.entity_instance]
"""
if include_subtypes:
return [entity_instance(e, self) for e in self.wrapped_data.by_type(type)]
return [entity_instance(e, self) for e in self.wrapped_data.by_type_excl_subtypes(type)]
return self.wrapped_data.by_type(type)
return self.wrapped_data.by_type_excl_subtypes(type)
def traverse(
self, inst: ifcopenshell.entity_instance, max_levels=None, breadth_first=False
@@ -486,7 +485,7 @@ class file(object):
else:
fn = self.wrapped_data.traverse
return [entity_instance(e, self) for e in fn(inst.wrapped_data, max_levels)]
return fn(inst, max_levels)
def get_inverse(
self, inst: ifcopenshell.entity_instance, allow_duplicate=False, with_attribute_indices=False
@@ -504,11 +503,11 @@ class file(object):
if with_attribute_indices and not allow_duplicate:
raise ValueError("with_attribute_indices requires allow_duplicate to be True")
inverses = [entity_instance(e, self) for e in self.wrapped_data.get_inverse(inst.wrapped_data)]
inverses = self.wrapped_data.get_inverse(inst)
if allow_duplicate:
if with_attribute_indices:
idxs = self.wrapped_data.get_inverse_indices(inst.wrapped_data)
idxs = self.wrapped_data.get_inverse_indices(inst)
return list(zip(inverses, idxs))
else:
return inverses
@@ -523,7 +522,7 @@ class file(object):
:returns: The total number of references
:rtype: int
"""
return self.wrapped_data.get_total_inverses(inst.wrapped_data)
return self.wrapped_data.get_total_inverses(inst)
def remove(self, inst: ifcopenshell.entity_instance) -> None:
"""Deletes an IFC object in the file.
@@ -538,7 +537,7 @@ class file(object):
"""
if self.transaction:
self.transaction.store_delete(inst)
return self.wrapped_data.remove(inst.wrapped_data)
return self.wrapped_data.remove(inst)
def batch(self):
"""Low-level mechanism to speed up deletion of large subgraphs"""
@@ -605,4 +604,4 @@ class file(object):
@staticmethod
def from_pointer(v):
return file_dict.get(v)()
return file_dict.get(v)() if v else None
@@ -23,10 +23,10 @@ from typing import Optional
def get_references(element: ifcopenshell.entity_instance, should_inherit=True) -> set[ifcopenshell.entity_instance]:
results = set()
if not element.is_a("IfcRoot"):
if hasattr(element, "HasExternalReferences"):
return {r.RelatingReference for r in element.HasExternalReferences or []}
elif hasattr(element, "HasExternalReference"): # Seriously, IFC?
return {r.RelatingReference for r in element.HasExternalReference or []}
if (references := getattr(element, "HasExternalReferences", None)) is not None or (
references := getattr(element, "HasExternalReference", None)
) is not None:
return {r.RelatingReference for r in references}
if should_inherit:
element_type = ifcopenshell.util.element.get_type(element)
if element_type and element_type != element:
@@ -18,20 +18,59 @@
#
#
def get_constraints(product):
import ifcopenshell
from typing import Union
def get_constraints(product: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
"""
Retrieves the constraints assigned to the `product`.
:param product: The IFC element.
:type product: ifcopenshell.entity_instance.entity_instance
:return: List of assigned constraints.
:rtype: list[ifcopenshell.entity_instance.entity_instance]
"""
constraints = []
for rel in product.HasAssociations or []:
if rel.is_a("IfcRelAssociatesConstraint"):
constraints.append(rel.RelatingConstraint)
return constraints
def get_metrics(constraint):
def get_constrained_elements(constraint: ifcopenshell.entity_instance) -> set[ifcopenshell.entity_instance]:
"""
Retrieves the elements constrained by a `constraint`.
:param product: The IFC element.
:type product: ifcopenshell.entity_instance.entity_instance
:return: Set of elements constrained by a `constrant`.
:rtype: set[ifcopenshell.entity_instance.entity_instance]
"""
elements = set()
for rel in constraint.file.get_inverse(constraint):
if rel.is_a("IfcRelAssociatesConstraint"):
elements.update(rel.RelatedObjects)
return elements
def get_metrics(constraint: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
"""
Retrieves the list of nested constraints for a IfcObjective `constraint`.
:param product: IfcObjective constraint.
:type product: ifcopenshell.entity_instance.entity_instance
:return: List of nested constraints.
:rtype: list[ifcopenshell.entity_instance.entity_instance]
"""
metrics = []
for metric in constraint.BenchmarkValues or []:
metrics.append(metric)
return metrics
def get_metric_reference(metric, is_deep=True):
def get_metric_reference(metric: ifcopenshell.entity_instance, is_deep=True):
def get_reference_Attribute(ref, path):
if ref:
if is_deep:
@@ -47,7 +86,10 @@ def get_metric_reference(metric, is_deep=True):
reference = metric.ReferencePath
return get_reference_Attribute(reference, "")
def get_metric_constraints(resource, attribute):
def get_metric_constraints(
resource: ifcopenshell.entity_instance, attribute
) -> Union[list[ifcopenshell.entity_instance], None]:
metrics = []
for constraint in get_constraints(resource) or []:
for metric in get_metrics(constraint) or []:
@@ -60,15 +102,14 @@ def get_metric_constraints(resource, attribute):
return metrics
return None
def is_hard_constraint(metric):
if metric.ConstraintGrade == "HARD" and metric.Benchmark == "EQUALTO":
return True
def is_attribute_locked(product, attribute):
def is_hard_constraint(metric: ifcopenshell.entity_instance) -> bool:
return metric.ConstraintGrade == "HARD" and metric.Benchmark == "EQUALTO"
def is_attribute_locked(product: ifcopenshell.entity_instance, attribute) -> bool:
is_locked = False
metrics = get_metric_constraints(
product, attribute
)
metrics = get_metric_constraints(product, attribute)
for metric in metrics or []:
if is_hard_constraint(metric):
is_locked = True
@@ -20,8 +20,10 @@ import json
from pathlib import Path
import copy
import ifcopenshell
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
import ifcopenshell.util.attribute
import ifcopenshell.util.schema
from typing import Optional, Literal
try:
import glob
@@ -58,8 +60,8 @@ IFC4x3_SPEC_URL_TEMPLATE = "https://ifc43-docs.standards.buildingsmart.org/IFC/R
# child -> description
# note: in IFC4x3 there is no children[] for properties
SCHEMA_FILES = {
SUPPORTED_SCHEMA = Literal["IFC2X3", "IFC4", "IFC4X3"]
SCHEMA_FILES: dict[SUPPORTED_SCHEMA, dict] = {
"IFC2X3": {
"entities": BASE_MODULE_PATH / "schema/ifc2x3_entities.json",
"properties": BASE_MODULE_PATH / "schema/ifc2x3_properties.json",
@@ -81,7 +83,11 @@ SCHEMA_FILES = {
}
db = None
schema_by_name = {"IFC2X3": None, "IFC4": None, "IFC4X3": None}
schema_by_name: dict[SUPPORTED_SCHEMA, Optional[ifcopenshell_wrapper.schema_definition]] = {
"IFC2X3": None,
"IFC4": None,
"IFC4X3": None,
}
def get_db(version):
@@ -103,11 +109,12 @@ def get_db(version):
return db.get(version)
def get_schema_by_name(version: str):
def get_schema_by_name(version: str) -> ifcopenshell_wrapper.schema_definition:
global schema_by_name
version = ifcopenshell.util.schema.get_fallback_schema(version)
if not schema_by_name[version]:
schema_by_name[version] = ifcopenshell.ifcopenshell_wrapper.schema_by_name(version)
schema_name = "IFC4X3_ADD2" if version == "IFC4X3" else version
schema_by_name[version] = ifcopenshell_wrapper.schema_by_name(schema_name)
return schema_by_name[version]
@@ -20,16 +20,17 @@ from __future__ import annotations
import ifcopenshell
import ifcopenshell.util.element
from typing import Any, Callable, Optional, Union, Literal, overload
from collections import namedtuple
def get_pset(
element: ifcopenshell.entity_instance,
name: str,
prop: Optional[str] = None,
psets_only=False,
qtos_only=False,
should_inherit=True,
verbose=False,
psets_only: bool = False,
qtos_only: bool = False,
should_inherit: bool = True,
verbose: bool = False,
) -> Union[Any, dict[str, Any]]:
"""Retrieve a single property set or single property
@@ -429,8 +430,7 @@ def get_predefined_type(element: ifcopenshell.entity_instance) -> str:
element = ifcopenshell.by_type("IfcWall")[0]
predefined_type = ifcopenshell.util.element.get_predefined_type(element)
"""
element_type = get_type(element)
if element_type:
if element_type := get_type(element):
predefined_type = getattr(element_type, "PredefinedType", None)
if predefined_type == "USERDEFINED" or not predefined_type:
predefined_type = getattr(element_type, "ElementType", ...)
@@ -563,7 +563,9 @@ def get_material(
return get_material(relating_type, should_skip_usage)
def get_materials(element: ifcopenshell.entity_instance, should_inherit=True) -> list[ifcopenshell.entity_instance]:
def get_materials(
element: ifcopenshell.entity_instance, should_inherit: bool = True
) -> list[ifcopenshell.entity_instance]:
"""Gets individual materials of an element
If the element has a material set, the individual materials of that set are
@@ -826,7 +828,7 @@ def get_layers(
def get_container(
element: ifcopenshell.entity_instance, should_get_direct=False, ifc_class: Optional[str] = None
element: ifcopenshell.entity_instance, should_get_direct: bool = False, ifc_class: Optional[str] = None
) -> ifcopenshell.entity_instance:
"""
Retrieves the spatial structure container of an element.
@@ -902,6 +904,27 @@ def get_referenced_structures(element: ifcopenshell.entity_instance) -> list[ifc
return [r.RelatingStructure for r in getattr(element, "ReferencedInStructures", [])]
def get_structure_referenced_elements(structure: ifcopenshell.entity_instance) -> set[ifcopenshell.entity_instance]:
"""Retreives a set of elements referenced by a structure
:param structure: IfcSpatialElement
:type element: ifcopenshell.entity_instance.entity_instance
:return: A set of referenced elements, IfcSpatialReferenceSelect
:rtype: set[ifcopenshell.entity_instance.entity_instance]
Example:
.. code:: python
element = file.by_type("IfcBuildingStorey")[0]
print(ifcopenshell.util.element.get_structure_referenced_elements(element))
"""
referenced = set()
for rel in structure.ReferencesElements:
referenced.update(rel.RelatedElements)
return referenced
def get_decomposition(element: ifcopenshell.entity_instance, is_recursive=True) -> list[ifcopenshell.entity_instance]:
"""
Retrieves all subelements of an element based on the spatial decomposition
@@ -1092,6 +1115,66 @@ def get_components(element: ifcopenshell.entity_instance, include_ports=False) -
return is_decomposed_by[0].RelatedObjects
ReferenceData = namedtuple("ReferenceData", "inverse_attribute, rel_class, relating_element_attribute")
# References below are omitted because they do not introduce
# any additional referenced objects besides the objects
# from their supertype IfcExternalReference
# - IfcExternallyDefinedHatchStyle
# - IfcExternallyDefinedSurfaceStyle
# - IfcExternallyDefinedTextFont
REFERENCE_TYPES: dict[str, ReferenceData] = {
"IfcClassificationReference": ReferenceData(
"ClassificationRefForObjects",
"IfcRelAssociatesClassification",
"RelatingClassification",
),
"IfcDocumentReference": ReferenceData("DocumentRefForObjects", "IfcRelAssociatesDocument", "RelatingDocument"),
"IfcLibraryReference": ReferenceData("LibraryRefForObjects", "IfcRelAssociatesLibrary", "RelatingLibrary"),
}
def get_referenced_elements(reference: ifcopenshell.entity_instance) -> set[ifcopenshell.entity_instance]:
"""Get all elements with assigned `reference`
:param reference: IfcExternalReference subtype reference
:type reference: ifcopenshell.entity_instance.entity_instance
:return: The elements with assigned `reference`
:rtype: set[ifcopenshell.entity_instance.entity_instance]
Example:
.. code:: python
reference = file.by_type("IfcClassificationReference")[0]
elements = ifcopenshell.util.element.get_referenced_elements(reference)
"""
related_objects: set[ifcopenshell.entity_instance] = set()
ifc_file = reference.file
ifc_class = reference.is_a()
if ifc_file.schema == "IFC2X3":
reference_data = REFERENCE_TYPES.get(ifc_class)
if reference_data:
for rel in ifc_file.by_type(reference_data.rel_class):
if getattr(rel, reference_data.relating_element_attribute) == reference:
related_objects.update(rel.RelatedObjects)
else:
# IfcExternalReference
for external_rel in reference.ExternalReferenceForResources:
related_objects.update(external_rel.RelatedResourceObjects)
reference_data = REFERENCE_TYPES.get(ifc_class)
if reference_data:
for rel in getattr(reference, reference_data.inverse_attribute):
related_objects.update(rel.RelatedObjects)
return related_objects
def replace_attribute(element: ifcopenshell.entity_instance, old: Any, new: Any) -> None:
for i, attribute_value in enumerate(element):
if has_element_reference(attribute_value, old):
@@ -61,11 +61,21 @@ def get_axis2placement(placement: ifcopenshell.entity_instance) -> MatrixType:
:return: A 4x4 numpy matrix
:rtype: np.ndarray[np.ndarray[float]]
"""
if placement.is_a("IfcAxis2Placement3D"):
ifc_class = placement.is_a()
if ifc_class in ("IfcAxis2Placement3D", "IfcAxis2PlacementLinear"):
z = np.array(placement.Axis.DirectionRatios if placement.Axis else (0, 0, 1))
x = np.array(placement.RefDirection.DirectionRatios if placement.RefDirection else (1, 0, 0))
o = placement.Location.Coordinates
elif placement.is_a("IfcAxis2Placement2D"):
location = placement.Location
if coordinates := getattr(location, "Coordinates", None):
o = coordinates
else:
import ifcopenshell.geom
st = ifcopenshell.geom.settings()
st.set('convert-back-units', True)
shp = ifcopenshell.geom.create_shape(st, placement)
return np.array(shp.matrix).reshape((4, 4), order="F")
elif ifc_class == "IfcAxis2Placement2D":
z = np.array((0, 0, 1))
if placement.RefDirection:
x = np.array(placement.RefDirection.DirectionRatios)
@@ -73,6 +83,13 @@ def get_axis2placement(placement: ifcopenshell.entity_instance) -> MatrixType:
else:
x = np.array((1, 0, 0))
o = (*placement.Location.Coordinates, 0.0)
elif ifc_class == "IfcAxis1Placement":
axis = placement.Axis
z = np.array(axis.DirectionRatios if axis else (0, 0, 1))
x = np.array((1, 0, 0))
o = placement.Location.Coordinates
return a2p(o, z, x)
@@ -103,10 +120,10 @@ def get_local_placement(placement: ifcopenshell.entity_instance) -> MatrixType:
"""
if placement is None:
return np.eye(4)
if placement.PlacementRelTo is None:
if (rel_to := placement.PlacementRelTo) is None:
parent = np.eye(4)
else:
parent = get_local_placement(placement.PlacementRelTo)
parent = get_local_placement(rel_to)
return np.dot(parent, get_axis2placement(placement.RelativePlacement))
@@ -233,7 +233,7 @@ class FormatTransformer(lark.Transformer):
def imperial_length(self, args):
if len(args) == 2:
input_unit = "foot"
input_unit, output_unit = "foot", "foot"
value, precision = args
else:
value, precision, input_unit, output_unit = args
@@ -524,7 +524,10 @@ class FacetTransformer(lark.Transformer):
name = name.children[0].value
def filter_function(element):
element_value = getattr(element, name, None)
if name == "PredefinedType":
element_value = ifcopenshell.util.element.get_predefined_type(element)
else:
element_value = getattr(element, name, None)
return self.compare(element_value, comparison, value)
self.elements = set(filter(filter_function, self.elements))

Some files were not shown because too many files have changed in this diff Show More