/*------------------------------------------------------------------------- * 功能描述:XYZConverter * 作者:xulisong * 创建时间: 2019/6/19 16:40:15 * 版本号:v1.0 * -------------------------------------------------------------------------*/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using JBIM; using JBIM.Definition; using Newtonsoft.Json; namespace RevitToJBim.JsonConverter { public class XYZConverter : Newtonsoft.Json.JsonConverter { public override bool CanConvert(Type objectType) { return objectType == typeof(XYZ); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { throw new NotImplementedException(); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { writer.WriteNull(); return; } writer.WriteValue(value.ToString()); } } }