PartDesign/Feature: add an optional parameter to getBaseObject() to prevent it from throwing exceptions
In most cases getBaseObject() is used with an exception handler which only detects if it failed but not the reason. This modification allows to use it without excess exception handlers. Also add the same parameter to SketchBased::getVerifiedSketch().
This commit is contained in:
committed by
Stefan Tröger
parent
bba3733086
commit
af385f1c57
@@ -1827,7 +1827,7 @@ void CmdPartDesignMirrored::activated(int iMsg)
|
||||
return;
|
||||
|
||||
if(features.front()->isDerivedFrom(PartDesign::SketchBased::getClassTypeId())) {
|
||||
Part::Part2DObject *sketch = (static_cast<PartDesign::SketchBased*>(features.front()))->getVerifiedSketch();
|
||||
Part::Part2DObject *sketch = (static_cast<PartDesign::SketchBased*>(features.front()))->getVerifiedSketch(/* silent =*/ true);
|
||||
if (sketch)
|
||||
Gui::Command::doCommand(Doc,"App.activeDocument().%s.MirrorPlane = (App.activeDocument().%s, [\"V_Axis\"])",
|
||||
FeatName.c_str(), sketch->getNameInDocument());
|
||||
@@ -1874,7 +1874,7 @@ void CmdPartDesignLinearPattern::activated(int iMsg)
|
||||
return;
|
||||
|
||||
if(features.front()->isDerivedFrom(PartDesign::SketchBased::getClassTypeId())) {
|
||||
Part::Part2DObject *sketch = (static_cast<PartDesign::SketchBased*>(features.front()))->getVerifiedSketch();
|
||||
Part::Part2DObject *sketch = (static_cast<PartDesign::SketchBased*>(features.front()))->getVerifiedSketch(/* silent =*/ true);
|
||||
if (sketch)
|
||||
doCommand(Doc,"App.activeDocument().%s.Direction = (App.activeDocument().%s, [\"H_Axis\"])",
|
||||
FeatName.c_str(), sketch->getNameInDocument());
|
||||
@@ -1923,7 +1923,7 @@ void CmdPartDesignPolarPattern::activated(int iMsg)
|
||||
return;
|
||||
|
||||
if(features.front()->isDerivedFrom(PartDesign::SketchBased::getClassTypeId())) {
|
||||
Part::Part2DObject *sketch = (static_cast<PartDesign::SketchBased*>(features.front()))->getVerifiedSketch();
|
||||
Part::Part2DObject *sketch = (static_cast<PartDesign::SketchBased*>(features.front()))->getVerifiedSketch(/* silent =*/ true);
|
||||
if (sketch)
|
||||
doCommand(Doc,"App.activeDocument().%s.Axis = (App.activeDocument().%s, [\"N_Axis\"])",
|
||||
FeatName.c_str(), sketch->getNameInDocument());
|
||||
|
||||
Reference in New Issue
Block a user