Fixed bugs in Transformed features
This commit is contained in:
parent
35e35527db
commit
0ddff2419f
|
@ -462,10 +462,11 @@ void TaskLinearPatternParameters::apply()
|
|||
App::DocumentObject* obj;
|
||||
getDirection(obj, directions);
|
||||
std::string direction = getPythonStr(obj, directions);
|
||||
if (!direction.empty()) {
|
||||
if (!direction.empty() && obj) {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Direction = %s", name.c_str(), direction.c_str());
|
||||
} else
|
||||
} 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(),getReverse());
|
||||
|
||||
ui->spinLength->apply();
|
||||
|
|
|
@ -393,10 +393,11 @@ bool TaskDlgMirroredParameters::accept()
|
|||
App::DocumentObject* obj;
|
||||
mirrorParameter->getMirrorPlane(obj, mirrorPlanes);
|
||||
std::string mirrorPlane = getPythonStr(obj, mirrorPlanes);
|
||||
if (!mirrorPlane.empty()) {
|
||||
if (!mirrorPlane.empty() && obj) {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.MirrorPlane = %s", name.c_str(), mirrorPlane.c_str());
|
||||
} else
|
||||
} else {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.MirrorPlane = None", name.c_str());
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
||||
if (!TransformedView->getObject()->isValid())
|
||||
throw Base::Exception(TransformedView->getObject()->getStatusString());
|
||||
|
|
|
@ -385,11 +385,15 @@ void TaskPolarPatternParameters::changeEvent(QEvent *e)
|
|||
void TaskPolarPatternParameters::apply()
|
||||
{
|
||||
std::string name = TransformedView->getObject()->getNameInDocument();
|
||||
std::string axis = getAxis();
|
||||
if (!axis.empty()) {
|
||||
std::vector<std::string> axes;
|
||||
App::DocumentObject* obj;
|
||||
getAxis(obj, axes);
|
||||
std::string axis = getPythonStr(obj, axes);
|
||||
if (!axis.empty() && obj) {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Axis = %s", name.c_str(), axis.c_str());
|
||||
} else
|
||||
} else {
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Axis = None", name.c_str());
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %u",name.c_str(),getReverse());
|
||||
ui->polarAngle->apply();
|
||||
ui->spinOccurrences->apply();
|
||||
|
|
Loading…
Reference in New Issue
Block a user