Author: Nathalie Gore
"""
+from qtsalome import QMessageBox
from salome.shaper import model
from salome.shaper import geom
import ModelAPI
filepath = apath.value()
if filepath != "" :
- part = model.activeDocument()
+ part = model.activeDocument()
if self.lfeatures :
for feature in self.lfeatures:
part.removeFeature(feature.feature())
self.lfeatures = []
- #part.removeFeature(self.folder.feature())
+ model.removeFolder(self.folder)
from os.path import basename
filename = basename(filepath)
with open(filepath) as file:
for line in file:
coord = line.split(self.separator)
+ if len(coord) != 3:
+ #QMessageBox.warning( self, 'Error!', '3D coords waited!' )
+ return
x = float(coord[0]); y = float(coord[1]); z = float(coord[2]);
point = model.addPoint(part, x,y,z); point.execute(True); self.lfeatures.append(point)
vertex = model.addVertex(part, [point.result()]); vertex.execute(True); self.lfeatures.append(vertex)
self.folder = model.addFolder(part, self.lfeatures[0], compound)
self.folder.setName(nameRes)
return
-
+
setError("The file does not exist")
def isMacro(self):
compoundVertices feature is macro: removes itself on the creation transaction
finish.
"""
- return True
+ return False