Prevent pages and views from being put into the drawing sheet.

This commit is contained in:
Michael Georg Hansen 2014-12-19 22:17:32 +01:00 committed by wmayer
parent ec4ed868b6
commit 8effb87566

View File

@ -3140,23 +3140,30 @@ class Drawing(Modifier):
self.page = self.createDefaultPage()
else:
self.page = None
# if the user selected a page, put the objects on that page
for obj in sel:
if obj.isDerivedFrom("Drawing::FeaturePage"):
self.page = obj
sel.pop(sel.index(obj))
break
if not self.page:
# no page selected, default to the first page in the document
for obj in self.doc.Objects:
if obj.isDerivedFrom("Drawing::FeaturePage"):
self.page = obj
break
if not self.page:
# no page in the document, create a default page.
self.page = self.createDefaultPage()
otherProjection = None
# if an existing projection is selected, reuse its projection properties
for obj in sel:
if obj.isDerivedFrom("Drawing::FeatureView"):
otherProjection = obj
break
sel.reverse()
for obj in sel:
if obj.ViewObject.isVisible():
if ( obj.ViewObject.isVisible() and not obj.isDerivedFrom("Drawing::FeatureView")
and not obj.isDerivedFrom("Drawing::FeaturePage") ):
name = 'View'+obj.Name
# no reason to remove the old one...
#oldobj = self.page.getObject(name)