Model.exportbom#

Model.exportbom(file_name, options)#

Exports a UDMXML BOM file for a given part.

<option>=<value> options must be enclosed in quotes, but can be provided in any order.

Parameters:
  • file_name (hwString) – The name and path of the file to write.

  • options (hwString) –

    The string containing all the <option>=<value> pairs.

    part_hmid=<value>

    • The part ID to be used as root for exporting.

    • If not specified, part_udmid is used.

    part_udmid=<value>

    • If part_hmid is not provided, this is the UDMID of the part to be used as root for exporting.

    recursive=<value>

    • 0 - Only the top level elements under the part ID are exported.

    • 1 - All elements under the part ID are exported (default).

    subsystem=<value>

    • 0 - Do not export subsystem structure.

    • 1 - Export subsystem structure.

Example#

Export a UDMXML BOM for part 2 to “ C:/temp / exportedbom.xml “#
import hm
import hm.entities as ent

model = hm.Model()

model.exportbom(file_name="C:/temp/exportedbom.xml", options="part_hmid=2")