Model.start_batch_import#
- Model.start_batch_import(mode, isInRepLoading=0)#
Initializes a sequence of multi-file batch import/merge operations to improve performance when importing or merging a series of files. Operations that are typically run for each import/merge are queued and executed once at the end. These operations differ by import/merge type, so only valid file types per the mode argument should be used. This function must be followed by a corresponding call to
Model.end_batch_import(). Avoid performing other operations within aModel.start_batch_import()/Model.end_batch_import()block, and always call these functions in pairs.- Parameters:
mode (unsigned int) –
1 - Merge HyperMesh files using
Model.mergefile()orModel.mergefile2()2 - Import FE files using
Model.feinputwithdata2()3 - Import CAD files using
Model.feinputwithdata2()isInRepLoading (unsigned int) – Reserved for future development.
Example#
Execute a sequence of importing multiple CAD files (Parasolid - .x_t)#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()