Model.end_batch_import#

Model.end_batch_import()#

Finalizes a sequence of multi-file batch import/merge operations. This is intended to improve performance of importing/merging a series of files. Certain operations that generally are run for each import/merge, and queued up and executed just once at then end of the import. These operations are different for each type of import/merge operation, and therefore cannot be mixed. It is essential to only import/merge valid file types per the mode argument.

This function must be preceded by a corresponding call to Model.start_batch_import(). It is potentially dangerous to perform other operations within a Model.start_batch_import()/ Model.end_batch_import() block, so take proper precaution and make sure to always call these functions in pairs.

Example#

Execute a sequence of import multiple CAD files , where the variable * cad_files * contains the list of files#
import hm
import hm.entities as ent

model = hm.Model()

model = hm.Model()

model.start_batch_import(mode=3)
cad_files = ["C:/temp/file1.x_t", "C:/temp/file2.x_t"]

for cad in cad_files:

    model.feinputwithdata2(
        import_reader="#Detect",
        filename=cad,
        overwrite_flag=1,
        reserved1=0,
        cleanup_tolerance=-0.01,
        blanked_component=0,
        offset_flag=0,
        string_array=["LOADS_SKIP ","LOADCOLS_SKIP "],
        scale_factor=1.0,
        name_comps_by_layer=0
    )

model.end_batch_import()