MatmlWriter#

class ansys.materials.manager.util.matml.matml_from_material.MatmlWriter(materials: Sequence[ansys.materials.manager.material.Material])#

Exports a list of MAPDL materials to an engineering data XML file.

Examples

> writer = MatmlWriter(materials) > writer.export(‘engineering_data.xml’)

Overview#

write

Write a MatML (engineering data XML format) representation of materials to buffer.

export

Write a MatML (engineering data XML format) representation of materials to file.

Import detail#

from ansys.materials.manager.util.matml.matml_from_material import MatmlWriter

Method detail#

MatmlWriter.write(buffer: BinaryIO, indent: bool | None = False, xml_declaration: bool | None = False) None#

Write a MatML (engineering data XML format) representation of materials to buffer.

Parameters:
buffer:

Buffer to write to.

indentOptional[bool]

Whether to add an indent to format the XML output. Defaults to false.

xml_declaration: Optional[bool]

Whether to add the XML declaration to the output.

MatmlWriter.export(path: _PATH_TYPE, indent: bool | None = False, xml_declaration: bool | None = False) None#

Write a MatML (engineering data XML format) representation of materials to file.

Parameters:
path:

File path.

indentOptional[bool]

Whether to add an indent to format the XML output. Defaults to false.

xml_declaration: Optional[bool]

Whether to add the XML declaration to the output.