[Radiance-general] Revit to Radiance proof of concept

Georg Mischler schorsch at schorsch.com
Wed Feb 24 14:53:15 PST 2016


Hi all,

I have recently had access to a Revit installation and decided to 
experiment
a bit with its API. The resulting Python file is attached for anyone to 
try.
I consider this a proof of concept implementation at the moment. There 
are many
rough edges, and lots of features missing that would be expected in a 
full blown
translator. It has been tested on the sample files supplied with Revit, 
but not
on any other files.

I may or may not have access to Revit in the coming months, so this is 
what
you get for now...


Technical considerations

Revit doesn't have the same geometry primitives as Radiance, but
uses B-Rep geometry in winged edge representation.
Surface elements don't close in on themselfes. This eliminates
ambiguous positioning issues for the software. For an exporter,
it means that eg. a cylinder is not one surface, but typically
composed of two half-cylinders. A circle consists of two half
arcs, etc.
Recognizing simple volume types requires analyzing and reassembling
several surface elements. This only seems to make sense for
circles/rings and cylinders (cones?) which are sufficiently easy.


Working features:

* Exports all geometry visible in the active 3D view (minus RPCs)
* Seperate function for exporting topography meshes.
* cylinders and circles/rings as Radiance primitives.
* Planar faces as polygons (including holes)
* All other surfaces tesselated into triangles (rectangles for
   partial cylinders.
* Names based on level and leaf node family name (type name for
   non-family types) and material
* Metric or imperial export (configured in code)


To do

* Turn into an external add-in
* Export RPCs in some way
* Export regions (parts of a surface using different color/material)
* Alternative primitive naming options (substitution lists?)
* Possibly split up the output into several files (eg. by level?)
* Detect cones (are those always coaxial in Revit?)
* Export unmodified (other than positioning/scaling) Family instances
   as seperate objects to be included via replmarks.
* Export (sufficiently large) meshes as Radiance meshes
* Export normals with curved surfaces for smoothing
* Export material properties in addition to the names
* Export light sources
* Export views
* Maybe export elements via selection instead of a complete view
* Dialog box to configure output interactively
* others?


Issues to research

* It's not always easily possible to figure out on which level a certain
   element resides (assuming they are associated with a level at all).
* Small objects with fine detail may result in many zero-area polygons.
* Installing an export function as a macro is clumsy. There may be a way 
to create
   an external installable via the Revit Python Shell.


Installation

Due to my lazyness, I created the exporter as an "Application Macro".
Not sure if it can be installed as an external add-on without changes to 
the code.
To install as a macro, select the "Manage" tab, click on "Macros".
Select the "Application" tab in the opening dialog, and press "Create 
Module".
Give your new application a name, chose "Python" as a language and press 
"Ok".
The SharpDevelop IDE should open with a new project containing 
boilerplate
code. Replace that with the contents of my file and press F8 to compile.

Now open the "Macros" dialog again, and your Module will have sprouted 
two macros
named "ExportToRadiance" and "ExportTopoToRadiance". Select one of those 
and
press "Run" (only works if the current view is a 3D-view).


Configuration

Currently all relevant configuration happens in the code, near the top 
of
the file. Configuration options are:

* Metric or Imperial
* Output file name (default: "revout.rad" on your desktop)
* Output file name for topography (default: "revout_topo.rad" on your 
desktop)


The attached jpg is from one of the Revit samples. The scene file is 
around 50MB.
Ironically, just in this example, the Brown chair at left shows some 
missing
faces at the front of the armrest... Not sure if this is my fault or 
Revit's.

Anyone who wants to try improving and extending RRadout, just go ahead 
and share your
results. Depending on the feedback, I may create a Github project.


Have fun!

-schorsch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: office_hall_03.jpg
Type: image/jpeg
Size: 82008 bytes
Desc: not available
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20160224/73e883cb/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RRadout_01.py
Type: text/x-python
Size: 19149 bytes
Desc: not available
URL: <http://www.radiance-online.org/pipermail/radiance-general/attachments/20160224/73e883cb/attachment-0001.py>


More information about the Radiance-general mailing list