public ElectrodeInfo(MoldInfo mold, UserModel user, ElectrodeAllInfo allInfo, Matrix4Info matInfo) : base(mold, user) { this.Type = PartType.Electrode; this.MatrInfo = matInfo; this.AllInfo = allInfo; this.Matr = matInfo.Matr; }
/// <summary> /// 以属性得到实体 /// </summary> /// <param name="obj"></param> /// <returns></returns> public new static ElectrodeInfo GetAttribute(NXObject obj) { try { return(new ElectrodeInfo(MoldInfo.GetAttribute(obj), UserModel.GetAttribute(obj), ElectrodeAllInfo.GetAttribute(obj), Matrix4Info.GetAttribute(obj))); } catch (NXException ex) { ClassItem.WriteLogFile("未获取到属性" + ex.Message); return(null); } }
/// <summary> /// 以属性得到实体 /// </summary> /// <param name="obj"></param> /// <returns></returns> public new static WorkInfo GetAttribute(NXObject obj) { int num = 0; Matrix4 mat = new Matrix4(); mat.Identity(); try { num = AttributeUtils.GetAttrForInt(obj, "WorkNumber"); WorkInfo info = new WorkInfo(MoldInfo.GetAttribute(obj), UserModel.GetAttribute(obj), num, Matrix4Info.GetAttribute(obj).Matr); info.Interference = AttributeUtils.GetAttrForBool(obj, "Interference"); return(info); } catch (NXException ex) { ClassItem.WriteLogFile("未获取到属性" + ex.Message); return(new WorkInfo(MoldInfo.GetAttribute(obj), UserModel.GetAttribute(obj), num, mat)); } }