import_from#
- dlubal.api.rfem.Application.import_from(self, *, filepath, import_attributes, model_id=None)#
Imports data into the model from the specified file format.
- Parameters:
filepath (str) – The full path of the file to be imported.
import_attributes (Any) – Specifies the format and attributes of the import. Supported message types: IfcImportAttributes XmlImportAttributes RsectionImportAttributes
model_id (ModelId | None) – The unique identifier of the model. If None, the active model is used.
- Returns:
None
Usage
# --- Import from IFC ---
rfem_app.import_from(
filepath=os.path.abspath('ifc_structure.ifc'),
import_attributes=common.import_export.IfcImportAttributes()
)
# Edit IFC model
ifc_model: rfem.ifc_objects.IfcFileModelObject = rfem_app.get_object(
obj=rfem.ifc_objects.IfcFileModelObject(no=1)
)
ifc_model.mirror_axis_z=True
rfem_app.update_object(obj=ifc_model)
# --- Import from XML ---
rfem_app.import_from(
filepath=os.path.abspath('xml_structure.xml'),
import_attributes=common.import_export.XmlImportAttributes()
)
# --- Import from RSECTION ---
rfem_app.import_from(
filepath=os.path.abspath('cross_section.rsc'),
import_attributes=common.import_export.RsectionImportAttributes()
)
// --- Import from IFC ---
await RfemApp.import_from(
filepath: Path.GetFullPath("ifc_structure.ifc"),
importAttributes: Any.Pack(new Common.ImportExport.IfcImportAttributes())
);
// Edit IFC model
Rfem.IfcObjects.IfcFileModelObject ifcModel = await RfemApp.get_object<Rfem.IfcObjects.IfcFileModelObject>(
obj: new Rfem.IfcObjects.IfcFileModelObject{ No = 1 }
);
ifcModel.MirrorAxisZ = true;
await RfemApp.update_object(obj: ifcModel);
// --- Import from XML ---
await RfemApp.import_from(
filepath: Path.GetFullPath("xml_structure.xml"),
importAttributes: Any.Pack(new Common.ImportExport.XmlImportAttributes())
);
// --- Import from RSECTION ---
await RfemApp.import_from(
filepath: Path.GetFullPath("cross_section.rsc"),
importAttributes: Any.Pack(new Common.ImportExport.RsectionImportAttributes())
);
Examples