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.
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.
Good Job man .. (^_^)...see you in italy
ReplyDeleteSee you ;)
Deletebut where is code details..as you said in your vedio ?? (^_^)
ReplyDeleteIt is not released yet. I need to work on it more to have it readable ;)
ReplyDeleteAwesome.. 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..
ReplyDeleteI 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.
ReplyDeleteThanks for reading my blog.
selamunaleykum muhammed. very nice work. can you send me plugins?
ReplyDeletearchitectenes@gmail.com.
thx. ( takabbel ALLAH )
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
ReplyDeleteThanks for your interests.
ReplyDeleteI am not done with this project yet. I will publish it as soon as I can.
hanks,
Hi, great stuff. Funny that you call the GH elements "batteries".
ReplyDeleteMy childrens say always: are you playing with the batteries again, when i'm trying to get somthing meanigfull out of GH :)
-rpict
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
ReplyDeleteIncredible Job mate, I can't wait to test the Batteries
ReplyDeleteSorry 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.
ReplyDeleteMohammad
We are looking forward to !!
ReplyDeleteHi, Mohammad.ghx2rvt look awome.Can you send me link to try this miracle:). My e-mail is simeonsimeonov76@gmail.com . Thank you
ReplyDeleteHi,
ReplyDeleteYou 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
Mohammed,
DeleteThankyou very much, I'll try it
Just awesome Mohammad! Could you let me know how to install it please?
ReplyDeleteTHX
How can we install this linking between revit and grasshopper !!
ReplyDelete