From 1f74c1d413434eb6f266eb478445649ed64dcf4a Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos Pita Date: Fri, 16 Oct 2015 13:43:04 +0200 Subject: [PATCH] Filtered out the bad entities from the ship before the load condition generation --- src/Mod/Ship/shipCreateLoadCondition/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Ship/shipCreateLoadCondition/__init__.py b/src/Mod/Ship/shipCreateLoadCondition/__init__.py index f115e7e95..05276ebef 100644 --- a/src/Mod/Ship/shipCreateLoadCondition/__init__.py +++ b/src/Mod/Ship/shipCreateLoadCondition/__init__.py @@ -85,6 +85,10 @@ def load(): s.set("B3", ship.Name) s.setForeground('A1:B3', (0.5,0.5,0.5)) + # Clean the Ship instance before generating the load condition + ship.Proxy.cleanWeights(ship) + ship.Proxy.cleanTanks(ship) + # Add the weights data s.mergeCells('A4:D4') s.setAlignment('A4:A4', 'center', 'keep') @@ -125,8 +129,6 @@ def load(): lcs = ship.LoadConditions[:] lcs.append(s.Name) ship.LoadConditions = lcs - ship.Proxy.cleanWeights(ship) - ship.Proxy.cleanTanks(ship) ship.Proxy.cleanLoadConditions(ship) # Recompute to take the changes