/// <summary> /// Sets an element's parameters based on a Dictionary object with the Key being the parameter name and the Value being the parameter value. /// </summary> /// <param name="element">A Dynamo wrapped element.</param> /// <param name="dictionary">A Synthetic Dictionary</param> /// <returns></returns> public static DynaElem SetParamterByDictionary(DynaElem element, synthDict dictionary) { RevitDoc doc = element.InternalElement.Document; TransactionManager.Instance.EnsureInTransaction(doc); foreach (KeyValuePair <string, object> keyValue in synthDict.UnwrapDictionary(dictionary)) { if (element.InternalElement.GetParameters(keyValue.Key)[0].IsReadOnly == false) { element.SetParameterByName(keyValue.Key, keyValue.Value); } } TransactionManager.Instance.TransactionTaskDone(); return(element); }
private static void SetExpectedWallHeight(Element wall, double value) { var name = "Unconnected Height"; wall.SetParameterByName(name, value); }