Restore the ViewObject
I think we need to restore the ViewObject in such cases. I assume this problems exists for all Draft and BIM objects. So this commit is just an example implementation.
This commit is contained in:
@@ -59,12 +59,12 @@ class DraftAnnotation(object):
|
||||
Check if new properties are present after the object is restored
|
||||
in order to migrate older objects.
|
||||
"""
|
||||
if not hasattr(obj, "ViewObject"):
|
||||
if not getattr(obj, "ViewObject", None):
|
||||
return
|
||||
vobj = obj.ViewObject
|
||||
if not vobj:
|
||||
return
|
||||
if not getattr(vobj, "Proxy", None):
|
||||
# Object was save without GUI.
|
||||
# onDocumentRestored in the object class should restore the ViewObject.
|
||||
return
|
||||
if hasattr(vobj, "ScaleMultiplier") and hasattr(vobj, "AnnotationStyle"):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user