diff --git a/src/App/Document.cpp b/src/App/Document.cpp
index 000517be2..122f88f37 100644
--- a/src/App/Document.cpp
+++ b/src/App/Document.cpp
@@ -1386,7 +1386,9 @@ bool Document::_recomputeFeature(DocumentObject* Feat)
else {
returnCode->Which = Feat;
_RecomputeLog.push_back(returnCode);
+#ifdef FC_DEBUG
Base::Console().Error("%s\n",returnCode->Why.c_str());
+#endif
Feat->setError();
}
return false;
diff --git a/src/Mod/PartDesign/App/FeatureTransformed.cpp b/src/Mod/PartDesign/App/FeatureTransformed.cpp
index a17ef4e75..b32b8d4f8 100644
--- a/src/Mod/PartDesign/App/FeatureTransformed.cpp
+++ b/src/Mod/PartDesign/App/FeatureTransformed.cpp
@@ -40,6 +40,7 @@
#include "FeatureAdditive.h"
#include "FeatureSubtractive.h"
#include "FeatureMirrored.h"
+#include "FeatureLinearPattern.h"
#include
#include
@@ -78,10 +79,17 @@ App::DocumentObject* Transformed::getSupportObject() const
App::DocumentObject* Transformed::getSketchObject() const
{
std::vector originals = Originals.getValues();
- if (!originals.empty() && originals.front()->getTypeId().isDerivedFrom(PartDesign::SketchBased::getClassTypeId()))
+ if (!originals.empty() && originals.front()->getTypeId().isDerivedFrom(PartDesign::SketchBased::getClassTypeId())) {
return (static_cast(originals.front()))->getVerifiedSketch();
- else
- return NULL;
+ }
+ else if (this->getTypeId().isDerivedFrom(LinearPattern::getClassTypeId())) {
+ // if Originals is empty then try the linear pattern's Direction property
+ const LinearPattern* pattern = static_cast(this);
+ return pattern->Direction.getValue();
+ }
+ else {
+ return 0;
+ }
}
short Transformed::mustExecute() const
@@ -177,7 +185,9 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
// Check for intersection with support
if (!Part::checkIntersection(support, mkTrf.Shape(), false, true)) {
+#ifdef FC_DEBUG // do not write this in release mode because a message appears already in the task view
Base::Console().Warning("Transformed shape does not intersect support %s: Removed\n", (*o)->getNameInDocument());
+#endif
nointersect_trsfms.insert(t);
} else {
v_transformations.push_back(t);
diff --git a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
index 9537a9387..30911452a 100644
--- a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
+++ b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
@@ -406,6 +406,7 @@ TaskDlgLinearPatternParameters::TaskDlgLinearPatternParameters(ViewProviderLinea
Content.push_back(parameter);
}
+
//==== calls from the TaskView ===============================================================
bool TaskDlgLinearPatternParameters::accept()
@@ -421,14 +422,19 @@ bool TaskDlgLinearPatternParameters::accept()
TaskLinearPatternParameters* linearpatternParameter = static_cast(parameter);
std::string direction = linearpatternParameter->getDirection();
if (!direction.empty()) {
- QString buf = QString::fromUtf8("(App.ActiveDocument.%1,[\"%2\"])");
+ App::DocumentObject* sketch = 0;
if (direction == "H_Axis" || direction == "V_Axis" ||
(direction.size() > 4 && direction.substr(0,4) == "Axis"))
- buf = buf.arg(QString::fromUtf8(linearpatternParameter->getSketchObject()->getNameInDocument()));
+ sketch = linearpatternParameter->getSketchObject();
else
- buf = buf.arg(QString::fromUtf8(linearpatternParameter->getSupportObject()->getNameInDocument()));
- buf = buf.arg(QString::fromUtf8(direction.c_str()));
- Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = %s", name.c_str(), buf.toStdString().c_str());
+ sketch = linearpatternParameter->getSupportObject();
+
+ QString buf = QString::fromUtf8("(App.ActiveDocument.%1,[\"%2\"])");
+ if (sketch) {
+ buf = buf.arg(QString::fromLatin1(sketch->getNameInDocument()));
+ buf = buf.arg(QString::fromUtf8(direction.c_str()));
+ Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = %s", name.c_str(), buf.toStdString().c_str());
+ }
} else
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = None", name.c_str());
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),linearpatternParameter->getReverse());