Commit Graph

73 Commits

Author SHA1 Message Date
Raj 124c02897c Feature faster unit method ---> Main (#5257)
* feature_faster_unit_method > main: added constants

* feature_faster_unit_method > main: extended `file` class to dynamically save unit information

* feature_faster_unit_method > main: refactored `get_property_unit` method

1. split out case that returns the wrong type (dictionary of units) into its own method

2. cleaned up (but preserved) logic

3. refactored common part of all cases (the method which prioritises unit then value-entity then measure_class)

---------

Co-authored-by: raj-open <raj-open@users.noreply.github.com>
Co-authored-by: Dion Moult <dion@thinkmoult.com>
2025-01-26 19:04:49 +11:00
Andrej730 42d01ac222 Fix append_asset conversion issue after 3ffc0bc #6012
Custom file.add wasn't considering IfcLengthMeasure attributes...
2025-01-23 18:14:16 +05:00
Dion Moult 7b62b035c9 Fix #5964. Only get the unit assignment from the project to prevent ambiguity.
I really don't know why I didn't do this before.
2025-01-20 23:50:03 +11:00
LM-Nascimento 80996dee1f Update unit.py 2025-01-12 17:25:21 +11:00
civilx64 ad35ceef2a add missing import for ifcopenshell.api.georeference 2024-12-07 18:17:36 +01:00
Andrej730 b35ef2f101 black . 2024-10-31 18:40:13 +05:00
Thomas Krijnen 4cd8428d1d Update unit.py 2024-10-31 11:00:02 +01:00
Dion Moult 04365053a8 Fix deep purge of unit when converting units and fix bug where unit was removed if map unit was the same as the project unit 2024-07-12 22:48:23 +10:00
Dion Moult e28b4d40ab Converting project length units now intelligently preserves map unit and coordinate operation scale. 2024-07-11 23:10:24 +10:00
Dion Moult a6940d2cba Fix bug where schema instead of schema_identifer was used to get the schema_by_name. Fix tests to use IFC4X3_ADD2 so that you only need the official version compiled 2024-07-11 22:26:19 +10:00
Dion Moult 0d401c9272 Fix bug where migrating length units didn't change properties. Unit utility for checking attribute types now considers select types too
Changing properties is very critical for IFC2X3 georeferencing which is stored in a pset.
2024-06-29 17:04:27 +10:00
Dion Moult 07060fc769 Replace all ifcopenshell.api.run with ifcopenshell.api static functions. 2024-06-28 12:36:31 +10:00
Dion Moult 7142f3856c Add documentation for some unit utilities 2024-05-27 09:42:28 +10:00
Andrej730 f2eb08a066 typing 2024-05-22 17:43:05 +05:00
Dion Moult 93639e9e50 Even more cleaning of documentation references 2024-05-07 19:08:13 +10:00
Andrej730 716a33f347 convert_file_length_units - fix issue converting to imperial units
ifcpatch ConvertLengthUnit - change used units from plural to singular names, to make it consistent across the api

more test coverage - test converting to more units and back from them
2024-04-24 15:15:30 +05:00
Andrej730 1c729a74d1 util.unit to support converting aggregate of aggregates 2024-04-24 14:12:13 +05:00
Andrej730 db31574103 typing 2024-04-24 14:12:13 +05:00
Andrej730 757a010172 typing 2024-04-19 16:18:57 +05:00
Andrej730 d1bcec7a6a typing 2024-04-09 18:33:25 +05:00
sebphi 5d6119e542 Fix import of ifcopenshell.util.unit in Python <3.10 #4520 2024-04-05 17:46:55 +02:00
Andrej730 06d823b9d8 typing 2024-03-26 15:54:45 +05:00
Andrej730 7132c4e9bf typing and small refactor 2024-03-22 16:54:42 +05:00
Andrej730 09da42d649 typing 2024-03-20 17:30:58 +05:00
Andrej730 0576914e07 small fixes after d209cc9ff, added a test 2024-03-11 15:15:17 +05:00
Andrej730 8e502c9bb7 util.unit.py - black format 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
Sigma Dimensions (Yass) f1b5f7d558 add conversion based unit symbols 2024-01-05 18:45:54 +01:00
krande 9335c8a0c8 add test and update ci 2023-12-17 18:09:28 +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
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
Sigma Dimensions (Yass) 48a0d8c508 fix displaying undefined or userdefined units in cost schedules 2023-10-25 15:01:52 +01:00
A. R. S 9eba3b6eaa Try to get unit from EnumerationReference for IfcPropertyEnumeratedValue 2023-09-22 17:41:05 +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
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
Ryan Schultz 7935bd22c2 Small fix for feet and inch formatting on Spreadsheet Import/Export 2023-09-06 13:49:32 -05:00
Ryan Schultz 921d412fc7 Spreadsheet Import/Export: Fix feet and inch formatting 2023-08-28 10:11:24 -05:00
Dion Moult e9c24a2656 Fix #3587. IfcCSV now supports custom formatting functions. 2023-08-26 15:15:34 +10: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
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
Dion Moult 7c275a99a2 New utility functions for automatic local to global elevation conversions and easier unit conversions 2023-02-02 23:01:12 +11:00
Dion Moult c8ba96cde8 Make syntax highlighting explicit in docs 2023-01-10 10:16:28 +11:00
Dion Moult b90ab70658 Modeling dimensions now have sensible defaults depending on units and show prior to element creation 2022-10-15 11:06:21 +11:00
Dion Moult 91fac6d4bd Add IfcTester support and test cases for bounded, table, and reference props 2022-09-12 22:35:05 +10:00
Dion Moult c7c59d9496 IfcTester now supports list and enumerated properties 2022-09-12 21:34:06 +10:00