Value Property (IAttributeInstance) Send Feedback
See Also  Example
Gets or sets the value of the BlockAttribute instance.

Syntax

Visual Basic 
Property Value As System.String
C# 
System.string Value {get; set;}
JavaScript 
get_Value () : String
put_Value (
   NewVal : String
)
COM native C++ 
HRESULT get_Value(
   BSTR* Val
) 
HRESULT put_Value( 
   BSTR NewVal
C++ 
DSRESULT get_Value (
   dsString* Val
)
DSRESULT put_Value(
   const dsString& NewVal
)

Property Value

Value of the BlockAttribute instance

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

See Also

Availability

DraftSight V1R1