init.py is just an empty file
initGui.py imports all necessary scripts and puts them in a menu.
each command looks like this, and to make a new command, i copy it, change the name, icon, and edit the block under
Code: Select all
def Activated(self):
Code: Select all
poly=Gui.Selection.getSelection()[0]
a=FreeCAD.ActiveDocument.addObject("Part::FeaturePython","CubicSurface_64")
AN.CubicSurface_64(a,poly)
Code: Select all
a.ViewObject.Proxy=0 # just set it to something different from None (this assignment is needed to run an internal notification)
a.ViewObject.DisplayMode = u"Shaded"
a.ViewObject.ShapeColor = (0.33,0.67,1.00)
getting the icon path to work was tricky. i got this method using the dummy file from Chris_G (if i remember correctly, lots of people helped at the time)
once it's all set up, the folder with all this stuff sits in my Mod folder...and that's it.