Example #1
0
        /// <summary>
        /// This static function will create an Attribute Set for the provided object if one with that name
        /// does not already exist.  The newly created AttributeSet object is returned.  If the object is not
        /// attribute capable, the function will throw a system exception.
        /// </summary>
        /// <param name="obj">Object</param>
        /// <param name="attributeSetName">AttributeSet name as a string</param>
        /// <returns></returns>
        public static Inventor.AttributeSet CreateAttributeSet(this object obj, string attributeSetName)
        {
            dynamic temp = (dynamic)obj;

            if (!ObjectIsAttributeCapable(obj))
            {
                throw new SystemException("The selected object is not attribute-capable.");
            }

            if (AttributeSetExists(obj, attributeSetName))
            {
                return(temp.AttributeSets[attributeSetName]);
            }
            else
            {
                Inventor.AttributeSets attributeSets = temp.AttributeSets;
                return(attributeSets.Add(attributeSetName));
            }
        }
Example #2
0
 public static InvAttributeSets ByInvAttributeSets(Inventor.AttributeSets invAttributeSets)
 {
     return(new InvAttributeSets(invAttributeSets));
 }
Example #3
0
 private InvAttributeSets(Inventor.AttributeSets invAttributeSets)
 {
     InternalAttributeSets = invAttributeSets;
 }