- 积分
- 25231
- 明经币
- 个
- 注册时间
- 2003-6-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2020-10-12 08:49:10
|
显示全部楼层
switch (obj.GetType().Name)
{
case "bool": //string
return new TypedValue((int)DxfCode.ExtendedDataBinaryChunk, obj);
case "String": //string
return new TypedValue((int)DxfCode.ExtendedDataAsciiString, obj);
case "Int32": //int
case "Int16": //short
case "UInt32": //uint
case "Int64": //long
case "UInt16": //ushort
return new TypedValue((int)DxfCode.ExtendedDataInteger32, obj);
case "Double": //double
case "Single": //float
case "Decimal": //decimal
return new TypedValue((int)DxfCode.ExtendedDataReal, obj);
case "Object": //object
return new TypedValue((int)DxfCode.ExtendedDataAsciiString, obj);
case "SByte": //sbyte
case "Byte": //byte
return new TypedValue((int)DxfCode.ExtendedDataInteger16, obj);
case "Vector3d":
case "Point3d":
return new TypedValue((int)DxfCode.ExtendedDataWorldXCoordinate, obj);
case "Handle":
return new TypedValue((int)DxfCode.ExtendedDataHandle, obj);
default:
return new TypedValue((int)DxfCode.ExtendedDataAsciiString, obj.ToString());
} |
|