Model.CE_ExportOneFile#

Model.CE_ExportOneFile(collection, ce_style, filename, option, reserved1, reserved2, reserved3)#

Exports selected connectors which belong to a specified original file to the file in original format or specified format. The exported connectors file in XML format can be viewed either in an internet browser or in XML notepad. The ASCII or VIP format file can be viewed in any text viewer.

Parameters:
  • collection (Collection) – The collection containing the connector entities to export.

  • ce_style (hwString) – Filter the specific type of connector to exported. Valid values are all, spot, bolt, apply_mass, seam, area.

  • filename (hwString) – The full path and filename of the original file.

  • option (int) –

    Specifies the output format. Valid values are:

    0 - original format

    1 - ASCII

    3 - XML

    4 - VIP

    5 - XML 2.0

    6 - XML 2.0 (version A)

    7 - XML 2.0 (version B)

  • reserved1 (hwString) – Reserved for future development. Must be set to “”.

  • reserved2 (double) – Reserved for future development. Must be set to 0.0.

  • reserved3 (int) – Reserved for future development. Must be set to 0.

Example#

Export all of the displayed connectors which belong to “C:/ce_info.xml” in XML format#
import hm
import hm.entities as ent

model = hm.Model()

connector_collection = hm.CollectionByDisplayed(model, ent.Connector)
model.CE_ExportOneFile(
    collection=connector_collection,
    ce_style="all",
    filename="C:/ce_info.xml",
    option=3,
    reserved1="",
    reserved2=0.0,
    reserved3=0,
)