- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I've done some searching here without luck on the specific issue I'm running into, so I thought I'd turn here for help.
I'm trying to instance a structural column via API. I used a variation of the NewFamilyInstance() method in Autodesk.Revit.Creation.Document (NewFamilyInstance Method (XYZ, FamilySymbol, Level, StructuralType)). Everything worked great when I built the add-in locally, and all the columns came in correctly. I targeted Revit 2024. However, when packaging the add-in and getting it to one of our users in Revit 2023, they received a "Method not found" error. It was somewhat truncated by the error task dialog, but it claimed it could not find a method with the same signature as above (XYZ, FamilySymbol, Level, StructuralType).
I was confused at first, but then noticed that the namespace of the function it could not find was in Autodesk.Revit.Creation.ItemFactoryBase, not in Autodesk.Revit.Creation.Document. My read of the API docs is that this is correct -- but Document apparently inherits from ItemFactoryBase and then adds its own overrides. But for some reason, my user's instance of the add-in is just not able to find it.
// "doc" here is of type Autodesk.Revit.DB.Document
FamilyInstance column = doc.Create.NewFamilyInstance(location, familySymbol, baseLevel, StructuralType.Column);
To make matters more confusing, my IDE (Visual Studio Professional 2022, with ReSharper) seems to think this override of NewFamilyInstance is actually a member of ItemFactoryBase:
I've tried a variety of methods to force the correct override here but without much success. Has anyone come up against this before, and is there a solution?
Solved! Go to Solution.