Allow geometry from other bodies in the same par as external geometry for sketches

This commit is contained in:
jrheinlaender
2013-07-03 11:51:27 +02:00
committed by Stefan Tröger
parent 68920a7cd8
commit 73d55c538b
4 changed files with 14 additions and 8 deletions

View File

@@ -83,6 +83,8 @@ SketchObject::SketchObject()
ADD_PROPERTY_TYPE(Constraints, (0) ,"Sketch",(App::PropertyType)(App::Prop_None),"Sketch constraints");
ADD_PROPERTY_TYPE(ExternalGeometry,(0,0),"Sketch",(App::PropertyType)(App::Prop_None),"Sketch external geometry");
allowOtherBody = true;
for (std::vector<Part::Geometry *>::iterator it=ExternalGeo.begin(); it != ExternalGeo.end(); ++it)
if (*it) delete *it;
ExternalGeo.clear();
@@ -2713,7 +2715,7 @@ int SketchObject::DeleteUnusedInternalGeometry(int GeoId)
int SketchObject::addExternal(App::DocumentObject *Obj, const char* SubName)
{
// so far only externals to the support of the sketch and datum features
if (Support.getValue() != Obj)
if (!allowOtherBody && (Support.getValue() != Obj))
if (!Obj->getTypeId().isDerivedFrom(App::Plane::getClassTypeId()) &&
!Obj->getTypeId().isDerivedFrom(Part::Datum::getClassTypeId()))
return -1;