IAttributeInstance Interface

IAttributeInstance Interface | Send Feedback
See Also Members Example

Allows access to a BlockAttribute instance.

# Syntax

Visual Basic |
--- | ---
    Public Interface IAttributeInstance

C# |
--- | ---
    public interface IAttributeInstance

JavaScript |
--- | ---
    Object dsAttributeInstance

COM native C++ |
--- | ---
    interface IAttributeInstance

C++ |
--- | ---
    class dsAttributeInstance

# Example

This code snippet shows how to write the names and values of the BlockAttribute instances to a file.

#### COM native C++

void CAddinDumpManager::DumpAttributeInstances( CStdioFile& fileOutput, LPCWSTR tabStr, IBlockInstancePtr blkIns )
{
CString strPrint;
_variant_t pVariantArrayAI = blkIns->GetAttributeInstances();
if( V_VT( &pVariantArrayAI ) != VT_EMPTY )
{
IAttributeInstancePtr *AttrIns = NULL;
int countOfAI = 0;
TypeConverter::convertVariantArrayToPtrArray<IAttributeInstancePtr, IAttributeInstance>( pVariantArrayAI, AttrIns, countOfAI );

strPrint.Format(L"%sAttribute instances (%d):\r\n", tabStr, countOfAI);
fileOutput.WriteString(strPrint);

if( AttrIns && countOfAI > 0)
{
for( int i = 0; i < countOfAI; ++i )
{
bstr_t AttInstName = AttrIns[i]->GetName();
strPrint.Format( L"%s\tName: %s\r\n", tabStr, AttInstName.operator const wchar_t*() );
fileOutput.WriteString( strPrint );

bstr_t AttInstValue = AttrIns[i]->GetValue();
strPrint.Format( L"%s\tValue: %s\r\n", tabStr, AttInstValue.operator const wchar_t*() );
fileOutput.WriteString( strPrint );
}
delete[] AttrIns;
}
else
{
strPrint.Format( L"%s\tERROR GetAttributeInstances\r\n", tabStr );
fileOutput.WriteString( strPrint );
}
}
else
{
strPrint.Format( L"%s\tERROR GetAttributeInstances\r\n", tabStr );
fileOutput.WriteString( strPrint );
}
}

# Example

Get and Set Block Definitions, Block Instances, and Block Attribute Instances (C#)
Get and Set Block Definitions, Block Instances, and BlockAttribute Instances (VB.NET)
Get and Set Block Definitions, Block Instances, and BlockAttribute Instances (VBA)

# Accessors

IBlockInstance::GetAttributeIntances

IDocument::GetObjectByHandle

# Object Model

AttributeInstance

# See Also

####

IAttributeInstance Members
Interop.dsAutomation Namespace
IBlockInstance Interface
IAttributeDefinition Interface
IBlockDefinition Interface