# Import/Export DXF
+import os
import salome
salome.salome_init()
-import GEOM,os
+import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
-
-# Example of import/export file in DXF format
-
-print "Test Export/Import DXF ..."
-
-tmpDir = os.getenv("TEMP")
-if tmpDir == None:
- tmpDir = "/tmp"
-# File for Export/Import testing
-fileExportImport = tmpDir + "/testExportImportDXF.dxf"
+# - path to the file
+dxfFile = os.path.join(os.getenv("TEMP", "/tmp"), "testExportImportDXF.dxf")
-# create shape
-box = geompy.MakeBoxDXDYDZ(100,100,100)
-
-# export shape
-geompy.ExportDXF(box,fileExportImport)
-
-# import shape
-Shape1 = geompy.ImportDXF(fileExportImport)
-geompy.addToStudy(Shape1, "ImportDXF_1")
+# - create shape
+box = geompy.MakeBoxDXDYDZ(100, 100, 100)
-# It is possible also to use next format of importing and publishing in study
+# - export shape
+geompy.ExportDXF(box, dxfFile)
-Shape2 = geompy.ImportDXF(fileExportImport,"ImportDXF_2")
+# - import shape
+shape = geompy.ImportDXF(dxfFile)
-print "OK"
\ No newline at end of file
+# - publish in study
+geompy.addToStudy(shape, "ImportDXF")