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:

How to find python macro exmaples

Original post: http://adndevblog.typepad.com/aec/2016/03/revitapi-how-to-find-code-examples-for-macro-of-python-or-ruby.html

You may also be interested in the Revit Python Wrapper here http://revitpythonwrapper.readthedocs.io/en/latest/

I have previously posted about RevitPythonShell a number of times. In this post Dima Chiriacov gives a real-world example on using the shell to change the case of text.

There are quite a number of free add-ins which can easily change case too, like this one or this one (which also allows merging of text).

Read how to use RevitPythonShell at:
DP stuff: Convert Revit Text to Upper Case

I have previously posted about Python and Revit (including revitpythonshell ) here.

There are some very detailed posts coming from openRevit about using Python in Energy Modeling.  Check them out:

Python for Energy Modelers – Part 1 | openRevit
This even shows you how to install it…

Python for Energy Modelers – Part 2 – Simple Pre-processing | openRevit
This focuses on some basic simulation scenarios.  Quote:

  1. Identify in your simulation workflow something that you need to do manually many times for each simulation, or something you need to do for each of your many simulations. If you can write the problem down in one sentence, it’s a great candidate for scripting.
  2. Next, break up the problem into many small simple steps, this is your pseudocode.
  3. Now try to write it out in Python. Remember, Google is your best friend, if you have a question about something in Python, chances are there have been hundreds of others out there with the same question!
  4. Finally, once it all works, clean up and comment your code, think about how you or someone else might use it in a year!

Another major addition to 1.1 includes the addition of two additional sample libraries available as separate downloads: PyKinect for working with the Kinect Beta SDK and Pyvot for working with Excel spreadsheets…

via
Python Tools for Visual Studio – Download: 1.1 Beta 1

Here is a question for you:

How will the new Python Tools allow further interaction with Revit via revitpythonshell?
http://thebuildingcoder.typepad.com/blog/2011/07/python-shell-in-revit-and-vasari.html
 

EDIT – added links to buildz post with 2012 installers etc.  Also embedded extra Youtube video.

http://buildz.blogspot.com/2011/09/python-scripting-in-vasari-21.html

Download some starter samples from here (via buildz)

Link to the Google Project:
revitpythonshell – An IronPython plugin for Autodesk Revit Architecture 2010 – Google Project Hosting

Link to a revitpythonshell install guide:
Installing IronPython with Vasari (The Proving Ground)