@ -800,9 +800,9 @@ class TechDrawExtensions:
if obj.TypeId == 'TechDraw::DrawPage':
self.onPageLoaded(obj)
main_part = doc.getObjectsByLabel(doc.Name)
if len(main_part) == 1:
main_part = main_part[0]
main_parts = doc.getObjectsByLabel(doc.Name)
if len(main_parts) == 1:
main_part = main_parts[0]
except:
pass