Have you ever wondered how to convert a Revit macro into an addin? You can follow Harry’s steps over at this post.
What about getting some sample code for Python and Ruby Revit projects? From AEC DevBlog:
… the code examples are hidden in the default macro projects created by macro manager, see below image, the project is the default python project, there are several “if False” statements, if you remove the line of “if False”, uncomment and unindent 4 spaces to methods below it, the methods will become available macros and appear in the macro manager, and you will see the same “if false” in Ruby projects too:
You may also be interested in the Revit Python Wrapper here http://revitpythonwrapper.readthedocs.io/en/latest/