IBlockDefinition Interface

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

Get and Set Block Definitions, Block Instances, and BlockAttribute 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)
Insert Block, Notes, and Sketch Entities (JavaScript)

# Accessors

IBlockInstance::GetBlockDefinition

IDocument::CreateBlockDefinition

IDocument::GetBlockDefinition

IDocument::GetBlockDefinitions

IDocument::GetObjectByHandle

IExternalReference::GetBlockDefinition

# Object Model

BlockDefinition

# See Also

####

IBlockDefinition Members
Interop.dsAutomation Namespace
IAttributeDefinition Interface
IBlockInstance Interface