CadBlocks
from OpenCAD2D import CadBlocks
class CadBlocks(System.Object) ยท CadBlocks in the .NET reference
What the block dialogs check and list as the block commands do: the names AutoCAD takes and the blocks a user names.
Methods
IsName
@staticmethod
def IsName(name: str) -> bool
Gets whether AutoCAD takes a name for a block: 1 to 255 letters, none of <>/\":;?*|,=` and no space at either end.
IsTag
@staticmethod
def IsTag(tag: str) -> bool
Gets whether AutoCAD takes a tag for an attribute: one word, with no space.
Named
@staticmethod
def Named(database: DxfDatabase) -> System.Collections.Generic.IReadOnlyList[DxfBlockTableRecord]
Gets the blocks of a drawing a user names, in ordinal order of their names, letters of either case alike first: no layout, no block AutoCAD names itself (*U1, *D2), no external reference.
Rename
@staticmethod
def Rename(document: CadDocument, name: str, newName: str) -> CadEditResult
Renames a block with every reference to it, as -RENAME Block does: each INSERT, dimension and table that draws it, its dynamic and attribute definitions with it. Refused for a block of a layout, an external reference or one AutoCAD names itself, Cannot find block "X".; for a name AutoCAD does not take, Invalid block name.; and for the name of another block, letters of either case the same, Block "X" already exists.