Commit Graph

396 Commits

Author SHA1 Message Date
Andrej730 ee7cf918ea get_pset() fix bug getting inherited psets with psets_only/qtos_only = True 2024-04-18 10:48:24 +02:00
Andrej730 bea8b2cddc typing 2024-04-18 10:48:24 +02:00
Dion Moult df4478a90a Fix #4290. You can now format custom thousands separators and decimal separators in IfcCSV. 2024-04-18 10:48:24 +02:00
Dion Moult 97eb34ca0d Fix #4490. Fix fundamental bug where get_pset would return none for inherited props with a boolean False value. 2024-04-18 10:48:24 +02:00
Andrej730 ede278db8f ifcopenshell.util.element.get_nest test 2024-04-18 10:48:24 +02:00
Andrej730 3db33a1071 nest.unassign_object - support batching #4474 2024-04-18 10:48:24 +02:00
Andrej730 d270a4fef8 nest.assign_object - support batching #4474 2024-04-18 10:48:24 +02:00
Andrej730 da838a2c7c 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-18 10:48:24 +02:00
Andrej730 163f5f2611 aggregate.unassign_object - support batching #4474 2024-04-18 10:48:23 +02:00
Andrej730 833f67cf45 aggregate.assign_object - support batching #4474 2024-04-18 10:48:23 +02:00
Andrej730 b106d6a4d1 temporary support for deprecated api arguments #4531 2024-04-18 10:48:23 +02:00
Andrej730 65d419d5c7 fix test after 7dd0d7601 2024-04-18 10:48:23 +02:00
Andrej730 d35f2dd0e9 layer.unassign_layer - support batching #4474 2024-04-18 10:48:23 +02:00
Andrej730 a003bc0018 layer.assign_layer - support batching #4474 2024-04-18 10:48:23 +02:00
Andrej730 eebcc48238 group.unassign_group - support batching #4474 2024-04-18 10:48:23 +02:00
Andrej730 df9a306730 spatial.unassign_container - support batching #4474 2024-04-18 10:48:22 +02:00
Andrej730 52995d1cdd spatial.assign_container - support batching #4474 2024-04-18 10:48:22 +02:00
Andrej730 ee6c7a9fad black format 2024-04-18 10:48:22 +02:00
Andrej730 e5cfe5cf3c ifcopenshell.validate to check unique guids (IfcRoot.UR1) 2024-04-18 10:48:21 +02:00
Dion Moult 33f5db2e26 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-04-18 10:48:06 +02:00
Dion Moult 7e689f2456 Fix #4305. Bug where importing spreadsheets into IFC didn't intelligently cast attribute data types 2024-04-18 10:47:36 +02:00
Andrej730 489e92da4e typing 2024-04-17 14:54:42 +02:00
Andrej730 088e1d07bf util.selector.set_element_value to work w/o preassigned placement #4439 2024-04-17 14:54:42 +02:00
Andrej730 67b657f2cb small fix 2024-04-17 14:54:41 +02:00
Andrej730 5ee0c4c967 ifccsv - support for assigning x/y/z coordinates from csv 2024-04-17 14:54:41 +02:00
Andrej730 edce320756 utils.filter_elements docs and tests 2024-04-17 14:46:06 +02:00
Andrej730 8d1559b486 small fixes after d209cc9ff, added a test 2024-04-17 14:46:06 +02:00
Andrej730 e5d1c8cfb9 add test for util.unit.calculate_unit_scale 2024-04-17 14:46:06 +02:00
Andrej730 ac4669f841 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-04-17 14:42:55 +02:00
Andrej730 1d7c882231 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-04-17 14:42:55 +02:00
Andrej730 a99fbbfdd8 reassign_class - cover with tests 2024-04-17 14:41:52 +02:00
Andrej730 1f532491ec 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-04-17 14:41:52 +02:00
Andrej730 f381dce64d fix tests after a971860 2024-04-17 14:41:52 +02:00
Andrej730 a86ac68e0c 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-04-17 13:41:18 +02:00
Andrej730 4ac771a214 Fix #4342 2024-04-16 13:28:46 +02:00
Andrej730 dd27107be8 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-04-16 13:28:46 +02:00
Andrej730 17da72232d unassign_material_style to handle constituents 2024-04-16 13:28:46 +02:00
Andrej730 c7ca87f9c4 api.unassign_representation_styles 2024-04-16 13:28:46 +02:00
Andrej730 f22369b960 assigning material styles to reuse existing styled item + tests 2024-04-16 13:28:46 +02:00
Andrej730 46eae7a7d2 assign_representation_styles to reuse existing styled item + tests 2024-04-16 13:28:46 +02:00
Andrej730 ec107d2f7f fixed bug migrating attributes to older ifc version (after 8728fa3) 2024-04-16 13:28:45 +02:00
Andrej730 356c81e80f black format 2024-04-16 13:28:45 +02:00
Andrej730 0077036716 Fix issues editing work time in ifc4x3 #4295 2024-04-16 13:28:45 +02:00
Andrej730 89da2b3b7d IFC4.3 test bootstrap 2024-04-16 13:28:45 +02:00
Andrej730 45a23d9371 style.assign_material_style to assign style to related shape aspects 2024-04-16 13:28:45 +02:00
Andrej730 c76a5a7ee7 promote get_shape_aspects to util.element method 2024-04-16 13:28:45 +02:00
Andrej730 3a9c023d33 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-04-16 11:38:49 +02:00
Andrej730 f522e2beb7 some typing 2024-04-16 11:38:20 +02:00
Andrej730 075b9e4775 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-04-16 11:38:20 +02:00
Andrej730 e289f23c40 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-04-16 11:35:31 +02:00