Tuesday, April 24, 2012

Rhino / Grasshopper To Revit - ARCH 689 Project 2

In this project, I have tried to make a real-time link between Rhino /Grasshopper and Revit. There are some limitations exist in accessing Revit in real-time, which delayed the first step of this project. I will provide more documentation about the real-time link in my next post. But, providing link between grasshopper and Revit seems possible and reasonable. In the following I will demonstrate how this link created.

In order to read the geometries in grasshopper, I have created a battery name "ghx2rvt" which gets objects, surfaces, and Breps as input, recognizes their type and creates a "csv" file with the data that Revit needs to create the same geometry using Revit API. To create the geometries in Revit, an application named"ghx2rvt" is created. If the user runs this application, Revit API reads the csv file and creates the geometries in Revit. This program is still under construction and needs more work in the following parts:
  • Create the real-time link
  • Increase the variety of geometries can be exported by grasshopper
  • Increase the variety of geometries can be imported by Revit
  • Providing an application panel which is easy to use in grasshopper
  • Providing an application panel which covers various capabilities in Revit.
The following part provides some detail examples that can be exported from grasshopper and imported to Revit and the process.

A few number of geometries are chosen to be exported from grasshopper to Revit. The first one is "Point" which is the base for all other geometries. ghx2rvt battery has the capability of getting a list of points and create them in Revit. The list of points should be connected to the anyObject input of the ghx2rvt battery. This battery takes the X, Y, and Z coordinate of the point and writes it down on the ghx2rvt.csv file, with the symbol of point. Later when this files is read by Revit API, it can recognize that the object is a point. Figure-1 shows the points, that are result of a surface division, exported to Revit. The user can manipulate this points in Revit.



Figure 1 - Points from Grasshopper to Revit

For creating lines in the Revit based on the respective geometry in grasshopper, I wrote a function in Revit API which takes the end points of the line and creates the line. For each line, the ghx2rvt battery adds a line to ghx2csv battery that has the end points of the line and its symbol. Seeing the symbol of a line, Revit API calls  line function and creates the line. The ghx2evt battery gets a list of line, which can be connected to anyObject input. Figure-2 shows a list of line that is made in Revit based on the existing geometry in grasshopper.


Figure 2 - Lines from Grasshopper to Revit



In order to import circles to Revit from grasshopper, the center point of the circle and its radius is needed. Therefore, these information will be written to ghx2rvt.csv file. Revit API reads these information and creates circles by their center point and radius in Revit.

Figure 3 - Circle (Curves) from Grasshopper to Revit

The process of creating nurbscurves and splines is the same as creating points. Putting each list of curves in an reference point array, gives us an option to create nurbscurves or splines.

Figure 4 - NurbsCurves from Grasshopper to Revit


In order to create surface one step is added to creating nurbscurves. The curves are inserted to a array of arrays. By lofting between these curves the surface an be created.

Figure 5 - Surfaces from Grasshopper to Revit


Using the same methodology, we can create  3D geometries such as Box and Ellipsoid which are shown in Image 6 and 7.

Figure 6 - Box (Extruded Geometry) from Grasshopper to Revit


Figure 7 - Revolved geometry from Grasshopper to Revit


The following video demonstrates that how the ghx2rvt battery can be used. In this video all above-mentioned examples are demonstrated. The video has an case that exports all object at one step to Revit. In this case Revit API separates the objects based on their symbol in the ghx2rvt.csv file and creates them without any problem.



Video 1 - Demonstrates the process of "ghx2rvt" battery

You can download the source code here. See the comments for details and more updates.

Thanks for reading.

19 comments:

  1. Good Job man .. (^_^)...see you in italy

    ReplyDelete
  2. but where is code details..as you said in your vedio ?? (^_^)

    ReplyDelete
  3. It is not released yet. I need to work on it more to have it readable ;)

    ReplyDelete
  4. Awesome.. Is there any chance of sampling this at the current stage? as Im trying to get my model into revit? Ive tried contacting you via email..

    ReplyDelete
  5. I will publish the final result soon. But, if you are in hurry and need the source code, please Email me and I can provide you the download link by Email.

    Thanks for reading my blog.

    ReplyDelete
  6. selamunaleykum muhammed. very nice work. can you send me plugins?
    architectenes@gmail.com.
    thx. ( takabbel ALLAH )

    ReplyDelete
  7. Hi Mohammad! Can you send me Plugins from GH to Revit? I need it to get my model into Revit. Thanks you very much. My emai : ktsnguyenvinhha@gmail.com

    ReplyDelete
  8. Thanks for your interests.

    I am not done with this project yet. I will publish it as soon as I can.

    hanks,

    ReplyDelete
  9. Hi, great stuff. Funny that you call the GH elements "batteries".
    My childrens say always: are you playing with the batteries again, when i'm trying to get somthing meanigfull out of GH :)

    -rpict

    ReplyDelete
  10. I pay attention to your research for a long time,waitting for your plugin's first release.But now I get a little projt in my school course need this very much,can you seed me the plugin to test?Thanks very much.My email: Lirenzhooong@gmail.com

    ReplyDelete
  11. Incredible Job mate, I can't wait to test the Batteries

    ReplyDelete
  12. Sorry for not updating for such a long time. I was out of country for more than 2 months. I will start work again and provide updates soon.

    Mohammad

    ReplyDelete
  13. We are looking forward to !!

    ReplyDelete
  14. Hi, Mohammad.ghx2rvt look awome.Can you send me link to try this miracle:). My e-mail is simeonsimeonov76@gmail.com . Thank you

    ReplyDelete
  15. Hi,

    You can download the source file through this link:

    https://dl.dropbox.com/u/25537565/BlogPost%20Version.zip

    Since I have not spent time to make it ready to be installed yet, it is a little tricky to make it work now. I will try to make it better hopefully, but it is not my priority anymore. You can find much better programs out there now.

    Mohammad

    ReplyDelete
  16. Just awesome Mohammad! Could you let me know how to install it please?

    THX

    ReplyDelete
  17. How can we install this linking between revit and grasshopper !!

    ReplyDelete