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

Method get_settings

src/ifcdiff/ifcdiff.py:231–254  ·  view source on GitHub ↗
(self, ifc: ifcopenshell.file)

Source from the content-addressed store, hash-verified

229 return shapes
230
231 def get_settings(self, ifc: ifcopenshell.file) -> ifcopenshell.geom.settings:
232 settings = ifcopenshell.geom.settings()
233 # Are you feeling lucky?
234 settings.set("disable-boolean-result", True)
235 # Are you feeling very lucky?
236 settings.set("disable-opening-subtractions", True)
237 # Facetation is to accommodate broken Revit files
238 # See https://forums.buildingsmart.org/t/suggestions-on-how-to-improve-clarity-of-representation-context-usage-in-documentation/3663/6?u=moult
239 body_contexts = [
240 c.id()
241 for c in ifc.by_type("IfcGeometricRepresentationSubContext")
242 if c.ContextIdentifier in ["Body", "Facetation"]
243 ]
244 # Ideally, all representations should be in a subcontext, but some BIM programs don't do this correctly
245 body_contexts.extend(
246 [
247 c.id()
248 for c in ifc.by_type("IfcGeometricRepresentationContext", include_subtypes=False)
249 if c.ContextType == "Model"
250 ]
251 )
252 if body_contexts:
253 settings.set("context-ids", body_contexts)
254 return settings
255
256 def json_dump_default(self, obj):
257 # result of DeepDiff may contain ordered sets

Callers 1

summarise_shapesMethod · 0.95

Calls 4

setMethod · 0.45
idMethod · 0.45
by_typeMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected