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

Method create_new

src/bcf/bcf/v2/bcfxml.py:173–192  ·  view source on GitHub ↗

Create a new BcfXml object. Args: project_name: The name of the project. xml_handler: XML parser and serializer. Returns: A new BcfXml object.

(
        cls,
        project_name: Optional[str] = None,
        xml_handler: Optional[AbstractXmlParserSerializer] = None,
    )

Source from the content-addressed store, hash-verified

171
172 @classmethod
173 def create_new(
174 cls,
175 project_name: Optional[str] = None,
176 xml_handler: Optional[AbstractXmlParserSerializer] = None,
177 ) -> BcfXml:
178 """
179 Create a new BcfXml object.
180
181 Args:
182 project_name: The name of the project.
183 xml_handler: XML parser and serializer.
184
185 Returns:
186 A new BcfXml object.
187 """
188 instance = cls(xml_handler=xml_handler or XmlParserSerializer())
189 instance.project_info = mdl.ProjectExtension(
190 project=mdl.Project(name=project_name, project_id=str(uuid.uuid4())), extension_schema=""
191 )
192 return instance
193
194 def save(self, filename: Optional[Path] = None, keep_open: bool = False) -> None:
195 """Save the BCF file to the given filename."""

Callers 11

new_projectMethod · 0.95
export_bcfxmlMethod · 0.45
to_fileMethod · 0.45
build_sampleFunction · 0.45
test_massive_bcfFunction · 0.45
build_sampleFunction · 0.45
test_massive_bcfFunction · 0.45
add_topicMethod · 0.45
executeMethod · 0.45

Calls 1

XmlParserSerializerClass · 0.90

Tested by 6

build_sampleFunction · 0.36
test_massive_bcfFunction · 0.36
build_sampleFunction · 0.36
test_massive_bcfFunction · 0.36