Message 1 of 6
Exception: "Input type is not a recognized Revit API type"

Not applicable
04-16-2019
02:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to fetch all walls/floors/ceiling/etc using the following code:
Assembly DLL = Assembly.LoadFile("C:/Program Files/Autodesk/Revit 2019/RevitAPI.dll"); Type type = DLL.GetType("Autodesk.Revit.DB." + typeName); FilteredElementCollector hostObjects = new FilteredElementCollector(Document).OfClass(type);
But i get an exception:
Autodesk.Revit.Exceptions.ArgumentException HResult=0x80131500 Message=Input type(Autodesk.Revit.DB.Wall) is not a recognized Revit API type Parameter name: type
Any idea why this code doesn't work?