Getting Parameter Data

For “info347074” who asked at AUGI about getting the values of shared parameters that are shown in labels on a sheet, here is a little macro showing how it can be done. Getting the parameter values from the sheets is no different than getting the values from any other Revit element.

CADFile Parameter

public void GetSheetParams()
    Document doc = this.ActiveUIDocument.Document;
    string sheetInfo = "";
    foreach (Element e in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)))
        // get the parameter
        Parameter parameter = e.get_Parameter("CADFile");

        // get the string value of the parameter
        string cadFileData = parameter.AsString();

        sheetInfo += cadFileData + "\n";
    TaskDialog.Show("CADFile", sheetInfo);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s