Regarding adding your new features to Arch, I would suggest the following:
1) We add your repo to the the FreeCAD addons repo. You should fill the "description" field on your github repo so it appears on the addon manager
2) Your scripts (straightrebar, ushaperebar, etc) must become FreeCAD commands (a toolbar button and/or menu item). Making such a command is easy, it's basically a class like this:
Code: Select all
class MyTool:
def GetResources(self):
return {'Pixmap' : ':/icons/someIcon.svg',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Arch_Rebar_Straight", "My Tool"),
'ToolTip' : QtCore.QT_TRANSLATE_NOOP(Arch_Rebar_Straight", "Explanantion of what my tool does")}
# Arch_Rebar_Straight above must be the same name as used in "addCommand" below
def IsActive():
# this is optional but always good
if FreeCADGui.ActiveDocument:
return True
else:
return False
def Activated(self):
# this is executed when the tool has been invoked (toolbar button or menu item has been pressed)
# ex.
import StraightRebar
StraightRebar.doSomeStuff()
FreeCADGui.addCommand('Arch_Rebar_Straight',MyTool())
4) That file should also have a function that returns all command names that the module adds, ex: ["Arch_Rebar_Straight","Arch_Rebar_UShape"]
5) Once you have that file, I'll add some code to Arch to try to import it (try: import RebarTools).
6) If the import succeeds, it means your stuff is present. Then the Arch module can grab a list of the new commands with the function from point 4)
7) Instead of the current rebar button, it will display a drop-down tool with all the different tools that you have
I think this will allow you to keep working without the hassle to submit pull requests all the time, and when you are ready for a big merge, there will be almost no modification needed to have your stuff merged in Arch.
What do you think?