IBlockDefinition Interface Send Feedback
See Also  Members   Example
Allows access to a Block definition.

Syntax

Visual Basic 
Public Interface IBlockDefinition 
C# 
public interface IBlockDefinition 
JavaScript 
Object dsBlockDefinition
COM native C++ 
interface IBlockDefinition
C++ 
class dsBlockDefinition

Example

This code snippet shows how to write the names of the Block definitions to a file.

COM native C++ 

void CAddinDumpManager::DumpBlockDefinitions( CStdioFile& fileOutput, LPCWSTR tabStr, IDocumentPtr dsDoc )
{
    CString strPrint;
    
    _variant_t pVariantArray = dsDoc->GetBlockDefinitions();
    if( V_VT( &pVariantArray ) != VT_EMPTY )
    {
        IBlockDefinitionPtr *blkDefs = NULL;
        int countOfBlockDefs = 0;
        TypeConverter::convertVariantArrayToPtrArray<IBlockDefinitionPtr, IBlockDefinition>( pVariantArray, blkDefs, countOfBlockDefs );

        strPrint.Format( L"Block definitions (%d):\r\n", countOfBlockDefs );
        fileOutput.WriteString( strPrint );

        if( blkDefs && countOfBlockDefs > 0)
        {                           
            for( int i = 0; i < countOfBlockDefs; ++i )
            {
                bstr_t BLockName= blkDefs[i]->GetName();
                strPrint.Format(L"Block definition name: %s\r\n", BLockName.operator const wchar_t*());
                fileOutput.WriteString(strPrint);
                               
                CAddinDumpManager::DumpAttributeDefinitions( fileOutput, L"", blkDefs[i] );

                CAddinDumpManager::DumpBlockInstances( fileOutput, L"\t", blkDefs[i] );

            }           
            delete[] blkDefs;
        }                       
    }
    else
        fileOutput.WriteString( L"ERROR GetBlockDefinitions\r\n" );
}

Example

Accessors

Object Model

See Also