- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am a noob using the following code to get all parameters in my family document in Revit 2015. I cannot find a way to get the actual value of the parameters. Hope this is easy and that I'm overlooking something. My ultimate goal is to search for a few specific family/shared parameters and return their values. Any help would be greatly appreciated!
Document doc = this.ActiveUIDocument.Document;
FamilyManager famMgr = doc.FamilyManager;
foreach(FamilyParameter fp in famMgr.Parameters)
{
StringBuilder paramInfo = new StringBuilder();
bool isShared = false;
try
{
Guid paramGuid = fp.GUID;
// following line will be reached only when parameter is shared parameter
isShared = true;
}
catch (Autodesk.Revit.Exceptions.InvalidOperationException)
{
// This exception will be thrown when the parameter is not a shared parameter.
isShared = false;
}
paramInfo.Append("Name: " + fp.Definition.Name + "; ");
paramInfo.Append("Is Shared: " + isShared + "; ");
paramInfo.Append("Is Instance: " + fp.IsInstance + "; ");
paramInfo.Append("Value: ");
Trace.WriteLine(paramInfo.ToString());
TaskDialog.Show("Parameter Info", paramInfo.ToString());
}
Solved! Go to Solution.