We have an application which places a vast amount of family parts on building parts. The application quickly calculates the positions where the familyparts are placed and the size parameters of the family parts, then it places the family parts on the building parts very slowly. Loading the family parts, especially the creation of the family parts (NewFamilyInstance or FamilyImstance2) then moving the family parts to the right position (ElementTransformUtils) takes a long time. According the profiler, the application runs 98% of the time in database related places (RevitDB.dll).
Since the application spends most of its time in database related operations, the performance of this operations has a significant impact on the the application performance. Placing a couple of hundreds family parts on a couple of walls takes long minutes for example.
We tried one by one placement method with NewFamilyInstance calls, we tried bulk placement approach with FamilyImstance2, we disabled all the rules of the Performance Advisor. Nothing helped. The user must wait long minutes to see how result looks like.
Can someone advise us how to improve the performance of the family part placement?
Thanks
Dear 782235,
The operations you describe can indeed take a long time.
Revit performs a lot of background calculations updating the BIM parametrics and relationships.
I assume you are using manual transaction mode and committing the transactions as seldom as possible?
Some operations require an intermediate commit, however.
I would suggest that you implement a benchmark to time the exact performance.
Next, I would suggest that you share that together with a minimal reproducible case with your peers, either here in the Revit API discussion forum or on The Building Coder, to see whether anyone has any suggestions for improvement:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
If you would like to provide a reproducible case including benchmarking instrumentation, I can also pass that on to the development team for analysis.
I hope this helps.
Best regards,
Jeremy