Model.CE_ExportMainConnectorsFile#

Model.CE_ExportMainConnectorsFile(collection, filename, header_string, with_md)#

Exports selected connectors information into a main connectors file.

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

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

  • header_string (hwString) – Optional string information to include in the header. It must start with a # or $ sign.

  • with_md (int) –

    Indicates whether to write metadata information. Valid values are:

    0 - Metadata is not written.

    1 - Metadata is written.

Example#

Export all of the displayed connectors to a main connectors file named “C:/ce_info.txt”, including all metadata, with a header#
import hm
import hm.entities as ent

model = hm.Model()

connector_collection = hm.CollectionByDisplayed(model, ent.Connector)
model.CE_ExportMainConnectorsFile(
    collection=connector_collection,
    filename="C:/ce_info.xml",
    header_string="#mcf file",
    with_md=1,
)