Removed shape duplicities.

This commit is contained in:
Jose Luis Cercós pita 2012-05-01 17:08:07 +02:00
parent 0c12188acf
commit 2a846428fe
2 changed files with 3 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class Ship:
obj.addProperty("App::PropertyLength","Beam","Ship", str(Translator.translate("Ship beam (B) [m]"))).Beam=0.0 obj.addProperty("App::PropertyLength","Beam","Ship", str(Translator.translate("Ship beam (B) [m]"))).Beam=0.0
obj.addProperty("App::PropertyLength","Draft","Ship", str(Translator.translate("Ship draft (T) [m]"))).Draft=0.0 obj.addProperty("App::PropertyLength","Draft","Ship", str(Translator.translate("Ship draft (T) [m]"))).Draft=0.0
# Add shapes # Add shapes
obj.addProperty("Part::PropertyPartShape","Shape","Ship", str(Translator.translate("Ship surfaces"))).Shape = Part.makeShell(faces) obj.Shape = Part.makeShell(faces)
obj.Proxy = self obj.Proxy = self
self.obj = obj self.obj = obj
@ -54,7 +54,7 @@ class Ship:
''' Print the name of the property that has changed ''' ''' Print the name of the property that has changed '''
# FreeCAD.Console.PrintMessage("Change property: " + str(prop) + "\n") # FreeCAD.Console.PrintMessage("Change property: " + str(prop) + "\n")
if prop == "Length" or prop == "Beam" or prop == "Draft": if prop == "Length" or prop == "Beam" or prop == "Draft":
fp.Shape = Part.makeShell(obj.Shape.Faces) pass
def execute(self, obj): def execute(self, obj):
''' Print a short message when doing a recomputation, this method is mandatory ''' ''' Print a short message when doing a recomputation, this method is mandatory '''

View File

@ -49,6 +49,7 @@ class TaskPanel:
obj.Draft = self.form.draft.value() obj.Draft = self.form.draft.value()
# Discretize it # Discretize it
ship.discretize(self.form.nSections.value(), self.form.nPoints.value()) ship.discretize(self.form.nSections.value(), self.form.nPoints.value())
App.ActiveDocument.recompute()
return True return True
def reject(self): def reject(self):