예제 #1
0
파일: EX.cs 프로젝트: suifengsigan/TEST_1
 public static void DeleteUserAttributes(this NXObject obj, NXOpen.NXObject.AttributeType type, Update.Option option)
 {
     //JAM.StartCall();
     //int status = JA_NXOBJECT_delete_user_attributes(obj.Tag, type, option);
     //if (status != 0)
     //{
     //    throw NXException.Create(status);
     //}
     obj.DeleteAllAttributesByType(type, option);
 }
예제 #2
0
파일: EX.cs 프로젝트: suifengsigan/TEST_1
 public static void DeleteUserAttribute(this NXObject obj, NXOpen.NXObject.AttributeType type, string title, bool deleteEntireArray, Update.Option option)
 {
     //JAM.StartCall();
     //IntPtr ptr = JAM.ToText(title);
     //int status = JA_NXOBJECT_delete_user_attribute(obj, type, ptr, deleteEntireArray, option);
     //JAM.TextFree(ptr);
     //if (status != 0)
     //{
     //    throw NXException.Create(status);
     //}
     obj.DeleteAttributeByTypeAndTitle(type, title, option);
 }
예제 #3
0
        public string[,] GetAttributeStrings()
        {
            NXOpen.NXObject.AttributeInformation[] userAttributes = this.NXOpenDisplayableObject.GetUserAttributes();
            int length = userAttributes.Length;

            string[,] strArray = new string[length, 3];
            for (int i = 0; i < length; i++)
            {
                NXOpen.NXObject.AttributeType type = userAttributes[i].Type;
                string title = userAttributes[i].Title;
                strArray[i, 0] = type.ToString();
                strArray[i, 1] = title;
                strArray[i, 2] = "Nothing";
                switch (type)
                {
                case NXOpen.NXObject.AttributeType.Null:
                    strArray[i, 2] = "";
                    break;

                case NXOpen.NXObject.AttributeType.Integer:
                    strArray[i, 2] = this.GetIntegerAttribute(title).ToString();
                    break;

                case NXOpen.NXObject.AttributeType.Real:
                {
                    double realAttribute = this.GetRealAttribute(title);
                    strArray[i, 2] = Snap.Number.ToString(realAttribute);
                    break;
                }

                case NXOpen.NXObject.AttributeType.String:
                    strArray[i, 2] = this.GetStringAttribute(title);
                    break;

                case NXOpen.NXObject.AttributeType.Time:
                    strArray[i, 2] = this.GetDateTimeAttribute(title).ToString();
                    break;
                }
            }
            return(strArray);
        }
예제 #4
0
 public void DeleteAttributes(AttributeType type, string title)
 {
     NXOpen.NXObject.AttributeType type2 = (NXOpen.NXObject.AttributeType)type;
     this.NXOpenDisplayableObject.DeleteUserAttribute(type2, title, true, Update.Option.Now);
 }
예제 #5
0
파일: Part.cs 프로젝트: suifengsigan/TEST_1
 public void DeleteAttributes(NXOpen.NXObject.AttributeType type, string title)
 {
     this.NXOpenPart.DeleteUserAttribute(type, title, true, Update.Option.Now);
 }
예제 #6
0
파일: EX.cs 프로젝트: suifengsigan/TEST_1
 public static NXOpen.NXObject.AttributeInformation GetUserAttribute(this NXObject obj, string title, NXOpen.NXObject.AttributeType type, int index)
 {
     return(new NXObject.AttributeInformation());
 }