Class AttributeShim
A collection of static methods that accesses attributes
Inheritance
Inherited Members
Namespace: InventorShims
Assembly: InventorShims.dll
Syntax
public static class AttributeShim
Methods
| Improve this Doc View SourceAttributeExists(Object, String, String)
This static function will return boolean value indicating if the specified Attribute exists in the provided object. If the object is not attribute capable, the function will throw a system exception.
Declaration
public static bool AttributeExists(this object obj, string attributeSetName, string attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.String | attributeName | Attribute name as a string |
Returns
Type | Description |
---|---|
System.Boolean |
AttributeSetExists(Object, String)
This static function will return boolean value indicating if the specified AttributeSet exists in the provided object. If the object is not attribute capable, the function will throw a system exception.
Declaration
public static bool AttributeSetExists(this object obj, string attributeSetName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
Returns
Type | Description |
---|---|
System.Boolean |
CreateAttributeSet(Object, String)
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.
Declaration
public static AttributeSet CreateAttributeSet(this object obj, string attributeSetName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
Returns
Type | Description |
---|---|
Inventor.AttributeSet |
GetAttributeValue(Object, String, Object)
This static function will return an Attribute's value for the provided object and Attribute name. If the specified attribute does not exist, an empty string is returned. If the object is not attribute capable, the function will throw a system exception.
Declaration
public static object GetAttributeValue(this object obj, string attributeSetName, object attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.Object | attributeName | Attribute name as a string |
Returns
Type | Description |
---|---|
System.Object |
ObjectIsAttributeCapable(Object)
This static function will return boolean value indicating if the specified Object is Attribute capable.
Declaration
public static bool ObjectIsAttributeCapable(this object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveAttribute(Object, String, Object)
This static method will remove a specified Attribute from the provided Object if one exists. If the object is not attribute capable, the function will throw a system exception.
Declaration
public static void RemoveAttribute(this object obj, string attributeSetName, object attributeName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.Object | attributeName | Attribute name as a string |
RemoveAttributeSet(Object, String)
This static method will remove a specified AttributeSet from the provided Object if one exists. If the object is not attribute capable, the function will throw a system exception.
Declaration
public static void RemoveAttributeSet(this object obj, string attributeSetName)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
SetAttributeValue(Object, String, String, Boolean)
Sets the value of a specified attribute in the provided object. The attribute is specified by it's name. If no such attribute exists, one is created. If the containing object is not attribute capable, the method will throw a system exception. This signature accepts a System.Boolean value. Note that the Inventor.Parameter object does not utilize a true boolean value, but instead a ValueTypeEnum.kBooleanType which is actually an integer value of 0 or 1.
Declaration
public static void SetAttributeValue(this object obj, string attributeSetName, string attributeName, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.String | attributeName | Attribute name as a string |
System.Boolean | value | Attribute value as a Boolean |
SetAttributeValue(Object, String, String, Double)
Sets the value of a specified attribute in the provided object. The attribute is specified by it's name. If no such attribute exists, one is created. If the containing object is not attribute capable, the method will throw a system exception. This signature accepts a double value.
Declaration
public static void SetAttributeValue(this object obj, string attributeSetName, string attributeName, double value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.String | attributeName | Attribute name as a string |
System.Double | value | Attribute value as a double |
SetAttributeValue(Object, String, String, Int32)
Sets the value of a specified attribute in the provided object. The attribute is specified by it's name. If no such attribute exists, one is created. If the containing object is not attribute capable, the method will throw a system exception. This signature accepts an integer.
Declaration
public static void SetAttributeValue(this object obj, string attributeSetName, string attributeName, int value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.String | attributeName | Attribute name as a string |
System.Int32 | value | Attribute value as an integer |
SetAttributeValue(Object, String, String, String)
Sets the value of a specified attribute in the provided object. The attribute is specified by it's name. If no such attribute exists, one is created. If the containing object is not attribute capable, the method will throw a system exception. This signature accepts a string value.
Declaration
public static void SetAttributeValue(this object obj, string attributeSetName, string attributeName, string value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object |
System.String | attributeSetName | AttributeSet name as a string |
System.String | attributeName | Attribute name as a string |
System.String | value | Attribute value as a string |