public static double GetAttrValue(Snap.NX.Body body, string title) { double d; if (body.GetAttributeInfo().Where(u => u.Title == title).Count() > 0) { var attr = body.GetAttributeInfo().FirstOrDefault(u => u.Title == title); switch (attr.Type) { case Snap.NX.NXObject.AttributeType.Integer: { d = body.GetIntegerAttribute(title); break; } case Snap.NX.NXObject.AttributeType.Real: { d = body.GetRealAttribute(title); break; } default: { d = 0; break; } } } else { d = 0; } return(d); }
public static bool IsElec(Snap.NX.Body body) { bool result = false; result = body.GetAttributeInfo().Where(u => u.Title == JYElecConst.ELEC_FINISH_NUMBER || u.Title == JYElecConst.ELEC_MIDDLE_NUMBER || u.Title == JYElecConst.ELEC_ROUGH_NUMBER).Count() > 0; return(result); }