Model.feinputwithdata2#
- Model.feinputwithdata2(import_reader, filename, overwrite_flag, reserved1, cleanup_tolerance, blanked_component, offset_flag, string_array, scale_factor, name_comps_by_layer)#
Inputs data from sources such as CAD files, connector files/MCF/MWF, and FE files, with additional input parameters.
To determine the proper options and strings to use for this function, it is best to first perform the import action using the workspace, and then look at the values written to the function file.
- Parameters:
import_reader (hwString) – The full path and filename of the import reader program. This can indicate a CAD reader, Connector/MCF/MWF reader, or FE reader. Paths with spaces must be enclosed in quotes. Core readers also support a short name, instead of the full path and filename.
filename (hwString) – The full path and filename of the import file. Paths with spaces must be enclosed in quotes.
overwrite_flag (int) –
Flag indicating whether should offset or overwrite any existing entity IDs. This option is only valid for FE files. For CAD files and connector files/MCF/MWF, this value should always be 0.
0 - Offset any existing entity IDs.
1 - Overwrites any existing entity IDs. Also see the
offset_flag option.reserved1 (double) – Not used. Always set to 0.
cleanup_tolerance (double) –
A real number indicating the cleanup tolerance to use during geometry import to clean the topology.
> 0 - Use this value as the cleanup tolerance.
= 0 - Do not cleanup topology.
< 0 - Use the automatic cleanup tolerance.
blanked_component (int) – Flag indicating whether to create a blanked component for relevant data. This is only valid for IGES and CATIA files.
offset_flag (unsigned char) –
If
overwrite_flag=1, use0 - For the next available entity IDs.
1 - To apply a user-defined offset.
If the
offset_flag=1, the entity offsets must be defined for each relevant entity using thefeinputoffsetid()function. This function must be run before each import, if an offset is required as the offset values only apply to the next file import.string_array (hwStringList) – The string array ID that contains the additional input parameters.
scale_factor (double) – Real value indicating the scale factor to apply to the data (CAD import only). Set to 1.0 when not being used.
name_comps_by_layer (int) –
Flag indicating whether to name components.
0 - Without the layer as part of the name.
1 - With the layer as part of the name.
Examples#
Import an Abaqus file named “C:/model.inp”, offset any existing IDs using the next available IDs, and skip reading any loads or loadcols from the file#import hm import hm.entities as ent model = hm.Model() model.feinputwithdata2( import_reader="#abaqus/abaqus", filename="C:/model.inp", overwrite_flag=0, reserved1=0.0, cleanup_tolerance=0.0, blanked_component=0, offset_flag=0, string_array=["LOADS_SKIP ","LOADCOLS_SKIP "], scale_factor=1.0, name_comps_by_layer=0 )
Read a UG input file named “ug_part.prt” with parameters setup from the UG Part browser#import hm import hm.entities as ent model = hm.Model() model.feinputwithdata2( import_reader="#ug/ug", filename="ug_part.prt", overwrite_flag=1, reserved1=0.0, cleanup_tolerance=-0.01, blanked_component=1, offset_flag=0, string_array=["SELECTIONS 0 1 0 0 0 1 0 0 0", "", "BEGIN_PARTS", "END_PARTS", "", "BEGIN_LAYERINFO", "DISABLE ", "ENABLE *", "END_LAYERINFO", "", "COMPONENT_NAME default"], scale_factor=1.0, name_comps_by_layer=0, )
Import connectors using a MCF/MWF#import hm import hm.entities as ent model = hm.Model() model.feinputwithdata2( import_reader="#connectors/connectors", filename="C:/example1.mwf", overwrite_flag=0, reserved1=0.0, cleanup_tolerance=0.0, blanked_component=1, offset_flag=0, string_array=["~HM_MAX_CE_ID [hm_entitymaxid CONNECTORS]"], scale_factor=1.0, name_comps_by_layer=0, )
Import connectors using a MCF/MWF with the optional ID map file#import hm import hm.entities as ent model = hm.Model() model.feinputwithdata2( import_reader="#connectors/connectors", filename="C:/example2.mwf", overwrite_flag=0, reserved1=0.0, cleanup_tolerance=0.0, blanked_component=1, offset_flag=0, string_array=[ "~HM_MAX_CE_ID [hm_entitymaxid CONNECTORS]", "~CHARTFILE C:/id_map_file.txt", ], scale_factor=1.0, name_comps_by_layer=0, )