public static revitMaterial ToMaterial(MaterialJSON MatJSON, revitDoc doc) { revitMaterial rMat = (revitMaterial)doc.GetElement(MatJSON.UniqueId); rMat.Name = MatJSON.Name; foreach (ParameterJSON paramJson in MatJSON.Parameters) { ParameterJSON.ModifyParameter(paramJson, rMat); } return(rMat); }
public static string ToJSON(MaterialJSON material) { return(Newtonsoft.Json.JsonConvert.SerializeObject(material, Formatting.Indented)); }