Revit to Radiance proof of concept

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

RRadout_01.py (18.7 KB)

Wow, Schorsch -- that's quite the unexpected gift! We were just talking about a Revit exporter at the last Radiance workshop. Everyone agreed it was a good idea, but no one really knew where to start. Thanks for giving us the leg up!

Cheers,
-Greg

···

From: Georg Mischler <[email protected]>
Subject: [Radiance-general] Revit to Radiance proof of concept
Date: February 24, 2016 2:53:15 PM PST

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

This is an excellent proof of concept Schorsch, particularly enabling some of the Radiance primitives beyond the basic polygon. I am most interested in tracking and perhaps modestly assisting in some way, future development.
Bravo,

Rob

Rob Shakespeare, Lighting Designer
Designing Visually Accessible Spaces,
Indiana University P.I.
Adjunct Professor,
School of Computing,University of UTAH
[email protected]

···

From: Georg Mischler <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>, Radiance discussion <[email protected]<mailto:[email protected]>>
Date: Wednesday, February 24, 2016 at 5:53 PM
To: Radiance discussion <[email protected]<mailto:[email protected]>>
Subject: [Radiance-general] Revit to Radiance proof of concept

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

Georg,

Our students (and our graduates) would put such a tool to good use. We will give it a test. Thanks. We are still using dxf2rad.

Rick

···

-----Original Message-----
From: Georg Mischler [mailto:[email protected]]
Sent: Wednesday, February 24, 2016 5:53 PM
To: [email protected]
Subject: [Radiance-general] Revit to Radiance proof of concept

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

Also just great to hear from you again, Schorsch!

···

On 2/24/16, 5:58 PM, "Greg Ward" <[email protected]> wrote:

Wow, Schorsch -- that's quite the unexpected gift! We were just talking
about a Revit exporter at the last Radiance workshop. Everyone agreed it
was a good idea, but no one really knew where to start. Thanks for
giving us the leg up!

Cheers,
-Greg

From: Georg Mischler <[email protected]>
Subject: [Radiance-general] Revit to Radiance proof of concept
Date: February 24, 2016 2:53:15 PM PST

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

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Wow! Thanks Schorsch! I've uploaded your email and the python script to
radiance-online to make it easier to access in the future:
http://www.radiance-online.org/download-install/third-party-utilities/revitradout

···

On Thu, Feb 25, 2016 at 8:02 AM, Guglielmetti, Robert < [email protected]> wrote:

Also just great to hear from you again, Schorsch!

On 2/24/16, 5:58 PM, "Greg Ward" <[email protected]> wrote:

>Wow, Schorsch -- that's quite the unexpected gift! We were just talking
>about a Revit exporter at the last Radiance workshop. Everyone agreed it
>was a good idea, but no one really knew where to start. Thanks for
>giving us the leg up!
>
>Cheers,
>-Greg
>
>> From: Georg Mischler <[email protected]>
>> Subject: [Radiance-general] Revit to Radiance proof of concept
>> Date: February 24, 2016 2:53:15 PM PST
>>
>> 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
>
>_______________________________________________
>Radiance-general mailing list
>[email protected]
>http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

That's pretty amazing. Thanks.

···

--
Randolph M. Fritz, Lighting Design and Simulation
+1 206 659-8617 || [email protected]

On Thu, Feb 25, 2016 at 9:22 AM, Andy McNeil <[email protected]> wrote:

Wow! Thanks Schorsch! I've uploaded your email and the python script to
radiance-online to make it easier to access in the future:

http://www.radiance-online.org/download-install/third-party-utilities/revitradout

On Thu, Feb 25, 2016 at 8:02 AM, Guglielmetti, Robert < > [email protected]> wrote:

Also just great to hear from you again, Schorsch!

On 2/24/16, 5:58 PM, "Greg Ward" <[email protected]> wrote:

>Wow, Schorsch -- that's quite the unexpected gift! We were just talking
>about a Revit exporter at the last Radiance workshop. Everyone agreed it
>was a good idea, but no one really knew where to start. Thanks for
>giving us the leg up!
>
>Cheers,
>-Greg
>
>> From: Georg Mischler <[email protected]>
>> Subject: [Radiance-general] Revit to Radiance proof of concept
>> Date: February 24, 2016 2:53:15 PM PST
>>
>> 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
>
>_______________________________________________
>Radiance-general mailing list
>[email protected]
>http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general