from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
-# Example of import file in XT format
+# - path to the file
+xtFile = "/path/to/the/xt/file.x_t"
-print "Test Import XT ..."
+if os.path.exists(xtFile):
+ # - import shape
+ shape = geompy.ImportXT(xtFile)
+
+ # - publish in study
+ geompy.addToStudy(shape, "ImportXT")
-dir = "" # please define import directory here
-if dir != "":
- # File for Import testing
- fileImport = dir + "" # please define file name here
- if fileImport != dir:
- # import shape
- Shape1 = geompy.ImportXT(fileImport)
- geompy.addToStudy(Shape1, "ImportXT_1")
- # It is possible also to use next format of importing and publishing in study
- Shape2 = geompy.ImportXT(fileImport,"ImportXT_2")
- print "OK"
- else:
- print "please define file name in python file"
else:
- print "please define import directory in python file"
\ No newline at end of file
+ print "ERROR: File %s does not exist" % xtFile