solucionado error al guardar
This commit is contained in:
@@ -95,6 +95,12 @@ class _Area:
|
||||
""" Method run when the document is restored """
|
||||
self.setProperties(obj)
|
||||
|
||||
def __getstate__(self):
|
||||
return None # No necesitamos guardar estado adicional
|
||||
|
||||
def __setstate__(self, state):
|
||||
pass
|
||||
|
||||
|
||||
class _ViewProviderArea:
|
||||
def __init__(self, vobj):
|
||||
@@ -263,7 +269,7 @@ class FrameArea(_Area):
|
||||
if not hasattr(o, "Proxy"):
|
||||
continue
|
||||
if o.Proxy.Type == "Tracker":
|
||||
lf.append(obj)
|
||||
lf.append(o)
|
||||
obj.Frames = lf
|
||||
obj.FramesNumber = len(obj.Frames)
|
||||
|
||||
@@ -274,10 +280,17 @@ class FrameArea(_Area):
|
||||
|
||||
def execute(self, obj):
|
||||
''' execute '''
|
||||
#_Area.execute(self, obj)
|
||||
|
||||
|
||||
if not hasattr(obj, "Frames"):
|
||||
return
|
||||
obj.FrameNumber = len(obj.Frames)
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
pass
|
||||
|
||||
|
||||
class ViewProviderFrameArea(_ViewProviderArea):
|
||||
def __init__(self, vobj):
|
||||
@@ -344,7 +357,7 @@ class OffsetArea(_Area):
|
||||
import Utils.PVPlantUtils as utils
|
||||
|
||||
base = obj.Base.Shape
|
||||
land = PVPlantSite.get().Terrain.Mesh
|
||||
land = PVPlantSite.get().Terrain.mesh
|
||||
vec = FreeCAD.Vector(0, 0, 1)
|
||||
wire = utils.getProjected(base, vec)
|
||||
wire = wire.makeOffset2D(obj.OffsetDistance.Value, 2, False, False, True)
|
||||
@@ -354,6 +367,12 @@ class OffsetArea(_Area):
|
||||
pts.extend(section)
|
||||
obj.Shape = Part.makePolygon(pts)
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
pass
|
||||
|
||||
|
||||
class ViewProviderOffsetArea(_ViewProviderArea):
|
||||
def getIcon(self):
|
||||
@@ -372,15 +391,15 @@ class ViewProviderOffsetArea(_ViewProviderArea):
|
||||
|
||||
|
||||
def makeProhibitedArea(base = None):
|
||||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "Exclusions")
|
||||
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "ExclusionArea")
|
||||
ProhibitedArea(obj)
|
||||
ViewProviderForbiddenArea(obj.ViewObject)
|
||||
if base:
|
||||
obj.Base = base
|
||||
try:
|
||||
group = FreeCAD.ActiveDocument.Exclusion
|
||||
group = FreeCAD.ActiveDocument.getObject("Exclusions")
|
||||
except:
|
||||
group = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", 'Exclusion')
|
||||
group = FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", 'Exclusions')
|
||||
group.Label = "Exclusions"
|
||||
group.addObject(obj)
|
||||
|
||||
@@ -401,6 +420,12 @@ class ProhibitedArea(OffsetArea):
|
||||
"""Method run when the document is restored."""
|
||||
self.setProperties(obj)
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
pass
|
||||
|
||||
|
||||
class ViewProviderForbiddenArea(_ViewProviderArea):
|
||||
def getIcon(self):
|
||||
@@ -556,6 +581,12 @@ class PVSubplant:
|
||||
''' '''
|
||||
pass
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
pass
|
||||
|
||||
|
||||
class ViewProviderPVSubplant:
|
||||
def __init__(self, vobj):
|
||||
@@ -742,12 +773,11 @@ class CommandPVSubplant:
|
||||
area = makePVSubplant()
|
||||
sel = FreeCADGui.Selection.getSelection()
|
||||
for obj in sel:
|
||||
if obj.Name[:7] == "Tracker":
|
||||
if hasattr(obj, 'Proxy') and obj.Proxy.Type == "Tracker":
|
||||
frame_list = area.Frames
|
||||
frame_list.append(obj)
|
||||
area.Frames = frame_list
|
||||
|
||||
|
||||
def IsActive(self):
|
||||
if FreeCAD.ActiveDocument:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user