/// <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)); } }
protected override void GetModelForAttribute(NXObject obj) { this.Info = WorkInfo.GetAttribute(obj); }
public WorkModel(WorkInfo info) { this.Info = info; }