Crop Revit 3D View With Python Shell

When you do navigate through your Revit model and trying to look up a certain condition 2D views usually don’t tell you the whole story. It is a good idea to isolate a certain area in a 3D view. The Section Box function comes in very handy in this case – you can crop Revit 3D view to that particular condition that you are looking at and see what is going on. Often when the model gets “heavy” trying to drag the edit arrows of the Section Box becomes a real pain. It takes usually quite a few attempts to get the crop right manually and you have to wait for the view to regenerate on the screen (when the model is “heavy”). Sure, you can right click on the view cube and “Orient to View” but I often (50-100 times a day!1) just want to crop it out around some particular element like a door or a stair to see what is going on there.

So I looked it up online and couldn’t really find any plugins that would do that. In the situations like this Revit Python Shell comes in really handy. You can often very quickly code some functionality that is missing in Revit without having to write, compile and install a Revit API add in. Huge time saver with just a few lines of code. So, down below you can find a piece of Python code that lets you crop Revit 3D View Section Box to your selection.

Directions (Assuming you have Revit IronPython Shell installed) :

  • Save code below to a .txt file on your computer
  • In any view select element(s) to which you want to crop your 3D view to
  • Switch to a 3D View and make sure the elements are still in your selection
  • Run Revit Python Shell while in the 3D View
  • Open the .txt file that you previously saved and Run it
  • Close Python Shell

Now your 3D View Section Box should be cropped to your selection (with the 2′ offset, by default)!

Download the Python Code for Revit 2013 from HERE.

Share →

9 Responses to Crop Revit 3D View To Selection, Section Box and some Python Shell

  1. Дмитрий Дронов says:

    Dima is best of the best of the best)

  2. Adriel says:

    hi Dima, is this similar to COINS Auto-Section Box?

    • Hi Adriel, just found it on adsk exchange page – looks like it is pretty similar – thanks for pointing out! I write an add in version of this python script – you can download it from the downloads page on this blog.

  3. Сергей Пучков says:

    Добрый день!
    А нет ли Вас этого волшебного приложения под 2012 версию. Ну оооочень надо!

    • Dima Chiriacov says:

      Нет, к сожалению только для 2013/2014!
      No, unfortunately only for 2013/2014. I’ve stopped supporting 2012.

  4. Andrea says:

    Hi Dima,
    Is this plug-in available for Revit14? Could you reccomend anything?

  5. Andrea says:

    Thank you Dima

Leave a Reply

Your email address will not be published. Required fields are marked *