Hi,
We are in a process of migrating a project in VB.NET to use with Revit 2017. Previously, it worked with Revit 2016.
I get several errors of the type Type 'Autodesk.Revit.DB.Structure.LoadCaseArray' is not defined (similarly for LoadCombinationArray, LoadUsageArray) and I can't locate any documentation on these arrays in Revit 2017 API. As far as I can see, they were not marked as obsolete, they were working OK within our 2016 project.
Any help is much appreciated. Thank you!
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Emil,
Well, you did not look carefully enough 🙂
I performed a simple Internet search for "revit api LoadCaseArray".
One of the first hits is The Building Coder article on
http://thebuildingcoder.typepad.com/blog/2016/04/whats-new-in-the-revit-2017-api.html
Searching that for LoadCaseArray, you first see it listed in the section on
http://thebuildingcoder.typepad.com/blog/2016/04/whats-new-in-the-revit-2017-api.html#2.22
It does not refer to the LoadCaseArray class, though, but the NewLoadCombination method that was using it.
Another hit is the old online Revit 2014 API documentation entry for LoadCaseArray:
http://revitapisearch.com/html/b956962a-5802-cca1-e806-cc0461fac741.htm
That tells me that this is a collection class.
In the far distant past, the Revit API defined heaps of custom collection classes.
They have (almost) all been replaced by generic collections, i.e., something like List<LoadCase>.
You need to look for the updated signature of whatever method call you need to make.
What method is it?
NewLoadCombination?
What argument does it take?
I performed a new Internet search for "revit api NewLoadCombination", which turns up The Building Coder article on
http://thebuildingcoder.typepad.com/blog/2015/04/whats-new-in-the-revit-2016-api.html
It includes this section:
The Revit API classes related to Load Cases and Load Combinations have been significantly renovated. This has introduced new members to the LoadCombnation, LoadCase, LoadNature and LoadUsage class, and resulted in several previously existing member being marked deprecated and replaced, as shown in this table:
I hope this answers your question.
Well, maybe not quite.
The whole area of load combinations seems to have been cleaned up quite significantly in the past few releases.
One of the first places to look for working sample code and see how different classes, method calls and properties are used together to achieve certain tasks is the Revit SDK sample collection.
Always perform the following searches before asking anyone else for help:
1. Revit API help file RevitAPI.chm for classes, properties and methods
2. Developer Guide for background understanding.
3. Revit SDK samples to see how to solve tasks
In this cases, I see lots and lots of results searching the Revit SDK samples for LoadCombination.
I much more hope that your are not only fed, but also transformed into a competent fisherman 🙂
Good luck with your further searches.
Cheers,
Jeremy
Dear Emil,
I thought my hints about how and where to search for Revit API help are worth preserving, if only for my own future use, so I cleaned up and published them on The Building Coder, including some explicit links to the three resources that I hope you will find useful as well:
http://thebuildingcoder.typepad.com/blog/2016/09/trusted-signature-motivation-and-fishing.html#3
Cheers,
Jeremy