Revit API IExportContext Skip Polymesh Calculation?

Revit API IExportContext Skip Polymesh Calculation?

Anonymous
Not applicable
1,095 Views
4 Replies
Message 1 of 5

Revit API IExportContext Skip Polymesh Calculation?

Anonymous
Not applicable

Hello, I'm working on a export plugin for Revit. What I'd like to do is to Get All Categories of Those Elements With Polymeshes. However this requires to invoke the export process and the polymeshes are all actually calculated which wastes too much time. Is there a way to skip this calculation and only retrieve categories of thoses elements whose polymeshes will be exported?

Thanks in advance.

0 Likes
1,096 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

The function that I'd like to implement is to select which Categories of elements are to be exported in the plugin ui. I've tried Document.Setting.Categories and also FilteredElementCollector class, both of which yield too much irrelevant elements which are not exported at all. I'd appreciate it very much (humble my appreciation is, though) if anyone could help me with this problem.

0 Likes
Message 3 of 5

jeremytammik
Autodesk
Autodesk

I can think of a number of possible approaches for this.

 

However, I can guarantee that none of them will exactly fit your needs, so, whatever you find, you will have to fine-tune it for your specific task.

 

I would suggest looking through The Building Coder topic group on filtering for elements:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9

 

You might want to pay special attention to the group of discussions on Selecting Model Elements or Visible 3D Elements; it sounds as if that might be approximately what you are in fact trying to achieve.

 

I also do not see why the custom exporter approach should be too slow. If you optimise your custom exporter, I would expect it to yield pretty good results. You can set up the 3D view that you run it in to eliminate certain unwanted groups of elements.

 

A filtered element collector will certainly be faster, though.

  

Please do let us know how you end up solving this.

 

Thank you!

 



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

0 Likes
Message 4 of 5

Anonymous
Not applicable

Thanks for the replay!

About the CustomExporter: when I export using an empty IExportContext (it does nothing except for invoking the export process), a project of 80M takes about 1 minute to finish. This is for my use cases a bit too slow...

You've mentioned optimizing CustomExporter; I also prefer this method because of its simplicity. But is there a way to know which elements have polymesh and yet somehow skip the overhead of all those OnPolymesh calls?

Vielen Dank!

0 Likes
Message 5 of 5

jeremytammik
Autodesk
Autodesk

> Is there a way to know which elements have polymesh and yet somehow skip the overhead of all those OnPolymesh calls?

 

I am not aware of any such possibility. Sorry.

  

I think the most efficient way to go would be via a suitable filtered element collector.

 



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

0 Likes