import_from#
- dlubal.api.rstab.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
from dlubal.api import common
# --- Import from IFC ---
ifc_filepath = os.path.abspath('ifc_structure.ifc')
rstab_app.import_from(
filepath=ifc_filepath,
import_attributes=common.import_export.IfcImportAttributes()
)
# Edit IFC model
ifc_model: rstab.ifc_objects.IfcFileModelObject = rstab_app.get_object(
obj=rstab.ifc_objects.IfcFileModelObject(no=1)
)
ifc_model.mirror_axis_z=True
rstab_app.update_object(obj=ifc_model)
# --- Import from XML ---
rstab_app.import_from(
filepath=os.path.abspath('xml_structure.xml'),
import_attributes=common.import_export.XmlImportAttributes()
)
# --- Import from RSECTION ---
rsection_filepath = os.path.abspath('cross_section.rsc')
rstab_app.import_from(
filepath=rsection_filepath,
import_attributes=common.import_export.RsectionImportAttributes()
)
// --- Import from IFC ---
await RstabApp.import_from(
filepath: Path.GetFullPath("ifc_structure.ifc"),
importAttributes: Any.Pack(new Common.ImportExport.IfcImportAttributes())
);
// Edit IFC model
Rstab.IfcObjects.IfcFileModelObject ifcModel = await RstabApp.get_object<Rstab.IfcObjects.IfcFileModelObject>(
obj: new Rstab.IfcObjects.IfcFileModelObject{ No = 1 }
);
ifcModel.MirrorAxisZ = true;
await RstabApp.update_object(obj: ifcModel);
// --- Import from XML ---
await RstabApp.import_from(
filepath: Path.GetFullPath("xml_structure.xml"),
importAttributes: Any.Pack(new Common.ImportExport.XmlImportAttributes())
);
// --- Import from RSECTION ---
await RstabApp.import_from(
filepath: Path.GetFullPath("cross_section.rsc"),
importAttributes: Any.Pack(new Common.ImportExport.RsectionImportAttributes())
);
Examples