Tuesday, January 5, 2010

Revit API: Mathematical Form-Making

In addition to my continued exploration with Grasshopper, I will begin doing posts relating to my recent interest with the Revit API.... and as my previous post suggests, these interests are not necessarily going to be "exclusive" from one another....

Below are some examples of making some parametric surfaces using a simple API script. The kinds of surfaces you are able to create is limited for two reasons:
1. There are only about 4 ways to create a surface (Loft, extrude, sweep, revolve)...
A surface from a point cloud or from 4-points would be very handy, Autodesk!
2. Revit doesn't seem to "like" self-intersecting surfaces very much... and even sometimes mistakes 'closed' shapes or shapes where edges touch for self-intersection....so no Kleins or Catalans, booo!

Wave Surface
Torus Shell Mobius Segment

Sample Code (Wave surface):
Dim ref_ar_ar As ReferenceArrayArray = New ReferenceArrayArray()
Dim XYZ As Autodesk.Revit.Geometry.XYZ

For u As Double = 0 To 4 * Math.PI Step Math.PI / 4
Dim rfptsarr As ReferencePointArray = New ReferencePointArray()
For v As Double = 0 To 4 * Math.PI Step Math.PI / 4

Dim refpt As Autodesk.Revit.Elements.ReferencePoint

Dim x As Double
Dim y As Double
Dim z As Double

x = 10 * u
y = 10 * v
z = 10 * Math.Cos(u) + 10 * Math.Sin(v)

XYZ = revit_app.Create.NewXYZ(x, y, z)
refpt = revit_doc.FamilyCreate.NewReferencePoint(XYZ)

rfptsarr.Append(refpt)
Next
Dim crv As CurveByPoints = revit_doc.FamilyCreate.NewCurveByPoints(rfptsarr)
Dim ref_ar As ReferenceArray = New ReferenceArray()
ref_ar.Append(crv.GeometryCurve.Reference)
ref_ar_ar.Append(ref_ar)
Next

Dim loftform As Autodesk.Revit.Elements.Form = revit_doc.FamilyCreate.NewLoftForm(True, ref_ar_ar)

Enjoy!

Sunday, January 3, 2010

Streaming Grasshopper Points into a Revit Conceptual Mass

This will be the first of a series of posts where I will explore various strategies for moving geometric and analytical data between software platforms...

While often times sufficient, I have sometimes found the standard means of Importing/Exporting model information using file formats to be quite cumbersome and limiting
... especially in the case of Revit where it is next to impossible to modify or build from linked/imported files

Below is a basic example of streaming a list of XYZ coordinates from Grasshopper into a *csv file and then using that file to create reference points in a Revit conceptual mass... A custom script was written using the Revit API to read the CSV file and make the points.


Here is the Revit API code (in VB.NET) for reading the *.csv file :

Dim XYZfile As String = "insert file path here"

If File.Exists(XYZfile) Then

Dim FileReadXYZ As New StreamReader(XYZfile)

Do While FileReadXYZ.Peek <> -1
Dim XYZLine As String = FileReadXYZ.ReadLine()
Dim XYZData As String() = XYZLine.Split(",")
Dim XYZ As Autodesk.Revit.Geometry.XYZ
Dim RefPt As Autodesk.Revit.Elements.ReferencePoint

XYZ = revit_app.Create.NewXYZ(Convert.ToDouble(XYZData(0)), Convert.ToDouble(XYZData(1)), Convert.ToDouble(XYZData(2)))
RefPt = revit_doc.FamilyCreate.NewReferencePoint(XYZ)
Loop

End If

Monday, December 28, 2009

NBBJ: Parametric Strategies in the Design of Hangzhou Stadium (Part 1)

Copyright NBBJ + CCDI

This is the first of a series of posts which will give an overview of the parametric design processes that are being used to design and develop the Hangzhou Stadium by NBBJ and CCDI.

Grasshopper was used to create the parametric model. Click the images below to get a description of the techniques used.


Location: Hangzhou, The People's Republic of China
Client: Hangzhou Olympic & International Expo Centre Construction and Investment Co. Ltd.
International Architect: NBBJ
Local Architect: CCDI
Program: 80,000 seat stadium, tennis tournament + practice facility (23 courts), cultural center, retail + commercial center
Copyright NBBJCopyright NBBJCopyright NBBJ
Copyright NBBJ
Copyright NBBJ + CCDI

NBBJ + CCDI: Ground Broken on Hangzhou Sports Center!

On December 26th, ground was broken on the Hangzhou Sports Center. I am happy to have been a part of this amazing project since the competition that took place over a year and a half ago. Check back soon for some additional information regarding the use of advanced digital modeling (Grasshopper) on the stadium...

Location: Hangzhou, The People's Republic of China
Client: Hangzhou Olympic & International Expo Centre Construction and Investment Co. Ltd.
International Architect: NBBJ
Local Architect: CCDI
Program: 80,000 seat stadium, tennis tournament + practice facility (23 courts), cultural center, retail + commercial center


Photo Copyright NBBJ
Photo Copyright NBBJPhoto Copyright NBBJPhoto Copyright NBBJPhoto Copyright NBBJ

Monday, December 14, 2009

Grasshopper Course @ USC

I am happy to announce that I will be teaching a 5 week Grasshopper course at the University of Southern California.

The class will begin in April 2010. Stay tuned for details!