- ## Deprecated, used only for compatibility! Please, use ExportToMEDX() method instead.
- # Exports the mesh in a file in MED format and chooses the \a version of MED format
- ## allowing to overwrite the file if it exists or add the exported data to its contents
- # @param f the file name
- # @param version values are SMESH.MED_V2_1, SMESH.MED_V2_2
- # @param opt boolean parameter for creating/not creating
- # the groups Group_On_All_Nodes, Group_On_All_Faces, ...
- # @param overwrite boolean parameter for overwriting/not overwriting the file
- # @param autoDimension: if @c True (default), a space dimension of a MED mesh can be either
- # - 1D if all mesh nodes lie on OX coordinate axis, or
- # - 2D if all mesh nodes lie on XOY coordinate plane, or
- # - 3D in the rest cases.
- #
- # If @a autoDimension is @c False, the space dimension is always 3.
- # @ingroup l2_impexp
- def ExportToMED(self, f, version, opt=0, overwrite=1, autoDimension=True):
- self.mesh.ExportToMEDX(f, opt, version, overwrite, autoDimension)
+ def ExportToMED(self, *args, **kwargs):
+ """
+ Deprecated, used only for compatibility! Please, use :meth:`ExportMED` method instead.
+ Export the mesh in a file in MED format
+ allowing to overwrite the file if it exists or add the exported data to its contents
+
+ Parameters:
+ fileName: the file name
+ opt (boolean): parameter for creating/not creating
+ the groups Group_On_All_Nodes, Group_On_All_Faces, ...
+ overwrite: boolean parameter for overwriting/not overwriting the file
+ autoDimension: if *True* (default), a space dimension of a MED mesh can be either
+
+ - 1D if all mesh nodes lie on OX coordinate axis, or
+ - 2D if all mesh nodes lie on XOY coordinate plane, or
+ - 3D in the rest cases.
+
+ If **autoDimension** is *False*, the space dimension is always 3.
+ """
+
+ print("WARNING: ExportToMED() is deprecated, use ExportMED() instead")
+ # process positional arguments
+ #args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]] # backward compatibility
+ fileName = args[0]
+ auto_groups = args[1] if len(args) > 1 else False
+ overwrite = args[2] if len(args) > 2 else True
+ autoDimension = args[3] if len(args) > 3 else True
+ # process keywords arguments
+ auto_groups = kwargs.get("opt", auto_groups) # old keyword name
+ auto_groups = kwargs.get("auto_groups", auto_groups) # new keyword name
+ overwrite = kwargs.get("overwrite", overwrite)
+ autoDimension = kwargs.get("autoDimension", autoDimension)
+ minor = -1
+ # invoke engine's function
+ self.mesh.ExportMED(fileName, auto_groups, minor, overwrite, autoDimension)
+
+ def ExportToMEDX(self, *args, **kwargs):
+ """
+ Deprecated, used only for compatibility! Please, use ExportMED() method instead.
+ Export the mesh in a file in MED format
+
+ Parameters:
+ fileName: the file name
+ opt (boolean): parameter for creating/not creating
+ the groups Group_On_All_Nodes, Group_On_All_Faces, ...
+ overwrite: boolean parameter for overwriting/not overwriting the file
+ autoDimension: if *True* (default), a space dimension of a MED mesh can be either
+
+ - 1D if all mesh nodes lie on OX coordinate axis, or
+ - 2D if all mesh nodes lie on XOY coordinate plane, or
+ - 3D in the rest cases.
+
+ If **autoDimension** is *False*, the space dimension is always 3.
+ """
+
+ print("WARNING: ExportToMEDX() is deprecated, use ExportMED() instead")
+ # process positional arguments
+ #args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]] # backward compatibility
+ fileName = args[0]
+ auto_groups = args[1] if len(args) > 1 else False
+ overwrite = args[2] if len(args) > 2 else True
+ autoDimension = args[3] if len(args) > 3 else True
+ # process keywords arguments
+ auto_groups = kwargs.get("auto_groups", auto_groups)
+ overwrite = kwargs.get("overwrite", overwrite)
+ autoDimension = kwargs.get("autoDimension", autoDimension)
+ minor = -1
+ # invoke engine's function
+ self.mesh.ExportMED(fileName, auto_groups, minor, overwrite, autoDimension)