MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / create_unit

Method create_unit

src/ifc5d/ifc5d/csv2ifc.py:398–410  ·  view source on GitHub ↗
(self, symbol: str)

Source from the content-addressed store, hash-verified

396 self.create_cost_items(cost_item["children"], cost_item["ifc"])
397
398 def create_unit(self, symbol: str) -> ifcopenshell.entity_instance:
399 unit = self.units.get(symbol, None)
400 if unit:
401 return unit
402 assert self.file
403 unit = self.file.create_entity(
404 "IfcContextDependentUnit",
405 self.file.create_entity("IfcDimensionalExponents", 0, 0, 0, 0, 0, 0, 0),
406 "USERDEFINED",
407 symbol,
408 )
409 self.units[symbol] = unit
410 return unit
411
412 def create_boilerplate_ifc(self) -> None:
413 self.file = ifcopenshell.file(schema="IFC4")

Callers 1

create_cost_itemMethod · 0.95

Calls 2

getMethod · 0.45
create_entityMethod · 0.45

Tested by

no test coverage detected