SIDE_MODULE=2 for plug-ins

This commit is contained in:
Thomas Krijnen
2026-05-05 21:42:39 +02:00
parent 3b3ed47e89
commit ea4747ccb1
10 changed files with 48 additions and 62 deletions
@@ -23,8 +23,8 @@ from collections.abc import Generator, Iterable
from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union, cast, overload
from .. import ifcopenshell_wrapper, open
from ..entity_instance import entity_instance
from ..file import file
from .. import entity_instance
from .. import file
from . import has_occ
if TYPE_CHECKING:
@@ -625,8 +625,9 @@ def make_shape_function(fn):
return _
serialise = make_shape_function(ifcopenshell_wrapper.serialise)
tesselate = make_shape_function(ifcopenshell_wrapper.tesselate)
# @todo, plug-ins now
# serialise = make_shape_function(ifcopenshell_wrapper.serialise)
# tesselate = make_shape_function(ifcopenshell_wrapper.tesselate)
def transform_string(v: Union[str, serializers.buffer]) -> serializers.buffer:
@@ -659,7 +660,7 @@ class serializers:
# Hdf- Xml- and glTF- serializers don't support writing to a buffer, only to filename
# so no wrap_buffer_creation() for these serializers
xml = ifcopenshell_wrapper.XmlSerializer
# xml = ifcopenshell_wrapper.XmlSerializer
buffer = ifcopenshell_wrapper.buffer
# gltf, hdf5, collada and json availability depend on IfcOpenShell configuration settings
try:
@@ -29,8 +29,8 @@ try:
import ifcopenshell.util.schema
from . import ifcopenshell_wrapper
from .entity_instance import entity_instance
from .file import file
from . import entity_instance
from . import file
class StreamTransformer(Transformer):
file: file
@@ -25,7 +25,6 @@ import ifcopenshell
import ifcopenshell.ifcopenshell_wrapper as W
import ifcopenshell.util.schema
import ifcopenshell.util.type
from ifcopenshell.entity_instance import entity_instance
templates: dict[ifcopenshell.util.schema.IFC_SCHEMA, "PsetQto"] = {}
@@ -78,7 +77,7 @@ class PsetQto:
pset_only=False,
qto_only=False,
schema: ifcopenshell.util.schema.IFC_SCHEMA = "IFC4",
) -> list[entity_instance]:
) -> list[ifcopenshell.entity_instance]:
"""Get applicable property set templates."""
any_class = not ifc_class
entity = None
@@ -179,7 +178,7 @@ class PsetQto:
return False
@lru_cache
def get_by_name(self, name: str) -> Optional[entity_instance]:
def get_by_name(self, name: str) -> Optional[ifcopenshell.entity_instance]:
for template in self.templates:
for prop_set in template.by_type("IfcPropertySetTemplate"):
if prop_set.Name == name:
@@ -190,7 +189,7 @@ class PsetQto:
return bool(self.get_by_name(name))
def get_pset_template_type(pset_template: entity_instance) -> Literal["PSET", "QTO", None]:
def get_pset_template_type(pset_template: ifcopenshell.entity_instance) -> Literal["PSET", "QTO", None]:
"""Get the type of the pset template.
If type is mixed or not defined, return None."""