Not applicable
01-16-2018
12:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've developed a family browser, where I can search and find families and can read their additional information. However, the value I'm reading for type parameter is different from one shows in the Revit 2017. Below is the screenshot of property window of my application and Revit 2017. Here the value displays for Dimension's Depth is different from one I can see in the Revit.
Here is the code behind:
static string FamilyParamValueString(FamilyType t, FamilyParameter fp, Document doc) { string value = t.AsValueString(fp); switch (fp.StorageType) { case StorageType.Double: value = Util.RealString( (double)t.AsDouble(fp)) + " (double)"; break; case StorageType.ElementId: ElementId id = t.AsElementId(fp); Element e = doc.GetElement(id); value = id.IntegerValue.ToString() + " (" + Util.ElementDescription(e) + ")"; break; case StorageType.Integer: value = t.AsInteger(fp).ToString() + " (int)"; break; case StorageType.String: value = "'" + t.AsString(fp) + "' (string)"; break; } return value; }
here's how I'm calling the FamilyParamValueString method.
foreach (FamilyType familytype in mgr.Types) { string name = familytype.Name; MultiValueDictionary<string, Tuple<string, string>> Parameters = new MultiValueDictionary<string, Tuple<string, string>>(); foreach (string key in keys) { FamilyParameter fp = fps[key]; var definition = fp.Definition; string ParameterGroupid = LabelUtils.GetLabelFor(definition.ParameterGroup); if (familytype.HasValue(fp)) { // Reading type's parameter value string value = FamilyParamValueString(familytype, fp, doc); //store parameter information along with its group Parameters.Add(ParameterGroupid, new Tuple<string, string>(key, value)); } } }
Please guide me, how I can able to read exactly the same values as it displays in the Revit type's properties. Thank you for support!
Solved! Go to Solution.
Link copied