CustomExporter - Change Export Order

CustomExporter - Change Export Order

Anonymous
Not applicable
508 Views
4 Replies
Message 1 of 5

CustomExporter - Change Export Order

Anonymous
Not applicable

Hello all.  I'm new to teh Revit API, and am trying my hand at generating a custom Collada exporter based on the one outlined here.

 

My problem is that there is a very specific order I'm trying to export elements in, but I cannot seem to find a way to change the export order to anyhting other than by element ID.  

 

To be more specific, I'm trying to export something that looks like this:

<Doors>

    <3'-0" Doors>

        <Individual door instance>

        </instance>

    </3'-0" Doors>

</Doors>

<Walls>

    <Type A Walls>

        <instance>

        </instance>

    </Type A Walls>

   <Type B Walls>

        <instance>

        </instance>

   </Type B Walls>

</Walls>

 

Any help would be greatly apprecciated.  Thanks.

0 Likes
509 Views
4 Replies
Replies (4)
Message 2 of 5

arnostlobel
Alumni
Alumni

hello preynoldsarh:

 

Unfortunately there is no way to prescribe Revit in which order it should process elements during export. There is an internal logic that dictates the order in which elements must be processed (some must be processed several times, in fact). If your application desires a different order, for whatever reason, you will have to do your export in several runs – first pre-fly the export to find what elements are coming, and then do the actual run and position incoming elements to their respective slots according to the internal logic of your exporter.

 

Arnošt Löbel

Sr. Principal Engineer

Autodesk, Revit R&D

Arnošt Löbel
0 Likes
Message 3 of 5

jeremytammik
Autodesk
Autodesk

alternatively, you could just execute one single run of the exporter and save all the data you receive in a collection that you can sort as desired. next, sort the collection, then process as needed.

 

cheers,

 

jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 5

Anonymous
Not applicable

This is the route I've been experimenting with, but I've run into a bit of a wall (literally >_>).  I cannot figure out how to determine if there are any instances of a given wall type in the scene: Selecting all instances of a wall

 

0 Likes
Message 5 of 5

Anonymous
Not applicable
Hmm... this is not a bad idea... I guess I'd probably have to create a custom collection for it though, considering all the data that there is to store.... but yeah, this could certainly work. Thank you for the suggestion.
0 Likes