Click or drag to resize

BlockTableExtensionGetBlock Method

Gets the objectId of a block definition (BlockTableRecord) from its name. If the block is not found in the block table, a dwg file is searched in the support paths and added to the block table.

Namespace:  Gile.AutoCAD.R20.Extension
Assembly:  Gile.AutoCAD.R20.Extension (in Gile.AutoCAD.R20.Extension.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
public static ObjectId GetBlock(
	this BlockTable blockTable,
	string blockName
)

Parameters

blockTable
Type: BlockTable
Block table.
blockName
Type: SystemString
Block name.

Return Value

Type: ObjectId
The ObjectId of the block table record or ObjectId.Null if not found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BlockTable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if blockTable is null.
ArgumentExceptionThrown if blockName is null or empty.
See Also