47
48
sAppModule = "PartDesign";
48
49
sGroup = QT_TR_NOOP("PartDesign");
49
sMenuText = QT_TR_NOOP("Pad...");
50
sMenuText = QT_TR_NOOP("Pad");
50
51
sToolTipText = QT_TR_NOOP("Pad a selected sketch");
51
52
sWhatsThis = sToolTipText;
52
53
sStatusTip = sToolTipText;
54
sPixmap = "PartDesign_Pad";
58
60
unsigned int n = getSelection().countObjectsOfType(Part::Part2DObject::getClassTypeId());
60
62
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
61
QObject::tr("Select a Sketch or 2D object."));
63
QObject::tr("Select a sketch or 2D object."));
69
71
openCommand("Make Pad");
70
72
doCommand(Doc,"App.activeDocument().addObject(\"PartDesign::Pad\",\"%s\")",FeatName.c_str());
71
73
doCommand(Doc,"App.activeDocument().%s.Base = App.activeDocument().%s",FeatName.c_str(),Sel[0].FeatName);
72
doCommand(Doc,"App.activeDocument().%s.Dir = (0.0,0.0,-100.0)",FeatName.c_str());
74
doCommand(Doc,"App.activeDocument().%s.Dir = (0.0,0.0,-5.0)",FeatName.c_str());
73
75
doCommand(Gui,"Gui.activeDocument().hide(\"%s\")",Sel[0].FeatName);
91
93
sAppModule = "PartDesign";
92
94
sGroup = QT_TR_NOOP("PartDesign");
93
95
sMenuText = QT_TR_NOOP("Fillet");
94
sToolTipText = QT_TR_NOOP("Make a fillet on a edge, face or body");
96
sToolTipText = QT_TR_NOOP("Make a fillet on an edge, face or body");
95
97
sWhatsThis = sToolTipText;
96
98
sStatusTip = sToolTipText;
99
sPixmap = "Part_Fillet";
100
103
void CmdPartDesignFillet::activated(int iMsg)
102
unsigned int n = getSelection().countObjectsOfType(Part::Part2DObject::getClassTypeId());
105
//unsigned int n = getSelection().countObjectsOfType(Part::Feature::getClassTypeId());
107
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
109
if (selection.size() != 1) {
104
110
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
105
QObject::tr("Select a edge, face or body."));
111
QObject::tr("Select an edge, face or body. Only one body is allowed."));
115
if ( ! selection[0].isObjectTypeOf(Part::Feature::getClassTypeId())){
116
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong object type"),
117
QObject::tr("Fillet works only on parts"));
120
std::string SelString = selection[0].getAsPropertyLinkSubString();
109
121
std::string FeatName = getUniqueObjectName("Fillet");
111
std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();
113
openCommand("Make Pad");
123
openCommand("Make Fillet");
114
124
doCommand(Doc,"App.activeDocument().addObject(\"PartDesign::Fillet\",\"%s\")",FeatName.c_str());
115
doCommand(Doc,"App.activeDocument().%s.Base = App.activeDocument().%s",FeatName.c_str(),Sel[0].FeatName);
116
doCommand(Gui,"Gui.activeDocument().hide(\"%s\")",Sel[0].FeatName);
125
doCommand(Doc,"App.activeDocument().%s.Base = %s",FeatName.c_str(),SelString.c_str());
126
doCommand(Gui,"Gui.activeDocument().hide(\"%s\")",selection[0].getFeatName());