]> SALOME platform Git repositories - plugins/dxfplugin.git/blob - doc/salome/examples/DXFPlugindemo.py
Salome HOME
Merge from rnv/geom_plugin_imp branch
[plugins/dxfplugin.git] / doc / salome / examples / DXFPlugindemo.py
1 # Import/Export DXF
2
3 import os
4 import salome
5 salome.salome_init()
6 import GEOM
7 from salome.geom import geomBuilder
8 geompy = geomBuilder.New(salome.myStudy)
9     
10 # - path to the file
11 dxfFile = os.path.join(os.getenv("TEMP", "/tmp"), "testExportImportDXF.dxf")
12     
13 # - create shape
14 box = geompy.MakeBoxDXDYDZ(100, 100, 100)
15
16 # - export shape
17 geompy.ExportDXF(box, dxfFile)
18
19 # - import shape
20 shape = geompy.ImportDXF(dxfFile)
21
22 # - publish in study
23 geompy.addToStudy(shape, "ImportDXF")