Here is the set of “using” statements that I currently have in my macros file
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Events;
using Autodesk.Revit.UI.Events;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
For the output to Excel post I also used
using Microsoft.Office.Interop.Excel;
But as I noted in that post, that namespace and Autodesk.Revit.DB both have classes named Line and Parameter, so to avoid that I have commented out the Excel using statement and the macro that does the Excel output.
If you are missing “using” statements, the error you will see is like this one:
The type or namespace name ‘Room’ could not be found (are you missing a using directive or an assembly reference?) (CS0246) –
[…] https://boostyourbim.wordpress.com/2012/12/23/using-statements/ […]
[…] Common Using Statements […]
Please add the following to the list:
using System.Collections.ObjectModel;