mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Structural UI - refactor common code to tool, fix bugs
Also revert previous change in UI - `draw_attributes` doesn't cover it and there indeed should be special handling.
This commit is contained in:
+20
-2
@@ -16,11 +16,28 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
import ifcopenshell
|
||||
from typing import Any
|
||||
from typing import Any, TypedDict, Literal, Union
|
||||
|
||||
|
||||
AttributeDict = TypedDict(
|
||||
"AttributeDict",
|
||||
{
|
||||
"type": Union[
|
||||
Literal[
|
||||
"string",
|
||||
"null",
|
||||
],
|
||||
str, # IFC Class.
|
||||
],
|
||||
"value": Any,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def edit_structural_boundary_condition(
|
||||
file: ifcopenshell.file, condition: ifcopenshell.entity_instance, attributes: dict[str, Any]
|
||||
file: ifcopenshell.file,
|
||||
condition: ifcopenshell.entity_instance,
|
||||
attributes: dict[str, AttributeDict],
|
||||
) -> None:
|
||||
"""Edits the attributes of an IfcBoundaryCondition
|
||||
|
||||
@@ -29,6 +46,7 @@ def edit_structural_boundary_condition(
|
||||
|
||||
:param condition: The IfcBoundaryCondition entity you want to edit
|
||||
:param attributes: a dictionary of attribute names and values.
|
||||
Each value is represented by a dictionary.
|
||||
:return: None
|
||||
"""
|
||||
for name, data in attributes.items():
|
||||
|
||||
Reference in New Issue
Block a user