So the ExternalDefinitionCreationOptions had a spelling error in the Revit 2015 API that was corrected in the 2016 API.
I try to make my app as compatible as possible with the current version + previous, but this time I'm not even able to compile it since I can only reference one of the two API DLL's, and the ExternalDefinitionCreationOptions
plays a big role in the process.
The code is the following:
private static Definition GetSimpleParameterDefinition(UIApplication uiApp, Document doc, DefinitionGroup defGroup, string name)
{
var definition = defGroup.Definitions.FirstOrDefault(d => d.Name == name);
if (definition != null) return definition;
var parameterType = ParameterType.Text;
var defOptions = new ExternalDefinitionCreationOptions(name, parameterType);
BuiltInCategory target = BuiltInCategory.OST_Furniture;
var cat = doc.Settings.Categories.get_Item(target);
var catSet = uiApp.Application.Create.NewCategorySet();
catSet.Insert(cat);
definition = defGroup.Definitions.Create(defOptions);
return definition;
}
I'm reading about DI and IoC, but all the samples have all the code under control, not referencing a third-party API and dealing with it. I've run out of ideas.
Any thoughts on how to accomplish this?