Revit 2010 VSTA Filter Performance

by Guy Robinson 13. March 2009 11:26

Out of interest I took the same code I used in this post and with the required changes for using in VSTA, ran the macro against the same project in the previous post. Here are the results:

R2010 iterator creation time 111ms
R2010 Total elements : 2319, wall count : 1754, door count : 404, in 16774ms

R2010 iterator creation time 92ms
R2010 Total elements : 2319, wall count : 1754, door count : 404, in 15061ms

R2010 iterator creation time 95ms
R2010 Total elements : 2319, wall count : 1754, door count : 404, in 14736ms

R2010 iterator creation time 92ms
R2010 Total elements : 2319, wall count : 1754, door count : 404, in 15250ms

R2010 iterator creation time 96ms
R2010 Total elements : 2319, wall count : 1754, door count : 404, in 15272ms

As we can see a macro version of the Filter test runs about 12x slower than the standard API test. I’m guessing, but this is probably due to the marshalling across AppDomains. And not getting faster with subsequent runs is probably due to the macro system using a new instance of the assembly every time the macro is run.

So in conclusion, Filters in macros perform fairly well. But if you find your macros are too slow for your liking convert them to a standard Revit API command for a good jump in performance.

FYI, I haven’t forgotten about the user settings series… Posts coming.

Comments are closed

About the Author

A .NET software Developer providing custom applications and commands for architecture firms exclusively working with Autodesk Revit and integration with any associated applications. All from a little place north of Whitianga, New Zealand.

Page List

Disclaimer

I'm self employed so the opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway☺

© Copyright2008

Creative Commons License
Blog content is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

With the following exception. All code snippets, application and libraries are licensed under a a Apache License Version 2.0

Autodesk Revit®

Autodesk: Revit is a product that is wholly owned by Autodesk. Any reference to Revit,Revit API, Revit Architecture, Revit MEP or Revit Structure on this site is made acknowledging this ownership. Refer to Autodesk's own web site and product pages for specific trademark and copyright information. Autodesk represents a great many products and every attempt will be made to respect their ownership whenever one of these other products is mentioned on this site.