is there any chance to enable the Datum Coordinate System in PartDesign WB toolbar and menu for v0.18 release ? (~/src/Mod/PartDesign/App/DatumCS.h|cpp) It will be very important for LinkStage3 and asm3 (v0.19 ?), so it would be great if people could get used to it, and also if the usage could be improved a bit. The functionality is there since a looong time (v0.16 probably), can be added by the Python window, the commands and buttons are all there, but strangely they are not enabled in the GUI. It's not a new feature, it's only a button in a toolbar and an entry in a menu.
It needs 2 lines in
~/src/Mod/PartDesign/Gui/Workbench.cpp
Code: Select all
Gui::MenuItem* Workbench::setupMenuBar() const
...
<< "PartDesign_Plane"
+++ << "PartDesign_CoordinateSystem"
Code: Select all
Gui::ToolBarItem* Workbench::setupToolBars() const
...
<< "PartDesign_Plane"
+++ << "PartDesign_CoordinateSystem"
and a dozen lines, which are only clones of Datum_Plane, _Line, _Point, in
~/src/Mod/PartDesign/Gui/Command.cpp
Code: Select all
/* Datum feature commands =======================================================*/
+++
DEF_STD_CMD_A(CmdPartDesignCS);
CmdPartDesignCS::CmdPartDesignCS()
:Command("PartDesign_CoordinateSystem")
{
sAppModule = "PartDesign";
sGroup = QT_TR_NOOP("PartDesign");
sMenuText = QT_TR_NOOP("Create a local coordinate system");
sToolTipText = QT_TR_NOOP("Create a new local coordinate system");
sWhatsThis = "PartDesign_CoordinateSystem";
sStatusTip = sToolTipText;
sPixmap = "PartDesign_CoordinateSystem";
}
void CmdPartDesignCS::activated(int iMsg)
{
Q_UNUSED(iMsg);
UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::CoordinateSystem"),"LCS");
}
bool CmdPartDesignCS::isActive(void)
{
if (getActiveGuiDocument())
return true;
else
return false;
}
+++
Code: Select all
void CreatePartDesignCommands(void)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
rcCmdMgr.addCommand(new CmdPartDesignShapeBinder());
rcCmdMgr.addCommand(new CmdPartDesignClone());
+++ rcCmdMgr.addCommand(new CmdPartDesignCS());
rcCmdMgr.addCommand(new CmdPartDesignPlane());
rcCmdMgr.addCommand(new CmdPartDesignLine());
rcCmdMgr.addCommand(new CmdPartDesignPoint());
Tested with v0.18—Py3—Qt5 and v0.18—LinkStage3.