Exemplo n.º 1
0
 /// <summary>
 /// 以属性得到实体
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public new static WorkPieceInfo GetAttribute(NXObject obj)
 {
     try
     {
         return(new WorkPieceInfo(MoldInfo.GetAttribute(obj), UserModel.GetAttribute(obj)));
     }
     catch (NXException ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 以属性得到实体
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public new static EDMInfo GetAttribute(NXObject obj)
 {
     try
     {
         return(new EDMInfo(MoldInfo.GetAttribute(obj), UserModel.GetAttribute(obj)));
     }
     catch (NXException ex)
     {
         ClassItem.WriteLogFile("未获取到EdmNumber 属性" + ex.Message);
         return(null);
     }
 }
Exemplo n.º 3
0
 /// <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 static ParentAssmblieInfo GetAttribute(NXObject obj)
 {
     try
     {
         string             partType = AttributeUtils.GetAttrForString(obj, "PartType");
         ParentAssmblieInfo info     = new ParentAssmblieInfo(MoldInfo.GetAttribute(obj), UserModel.GetAttribute(obj));
         info.Type = (PartType)Enum.Parse(typeof(PartType), partType);
         return(info);
     }
     catch (NXException ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
        /// <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));
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// 获取属性
 /// </summary>
 /// <param name="part"></param>
 protected virtual void GetAttribute(Part part)
 {
     this.PartTag = part;
     MoldInfo.GetAttribute(part);
     this.PartType = AttributeUtils.GetAttrForString(part, "PartType");
 }