Table of Contents

Method ConvertToStaticBlock

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

ConvertToStaticBlock(string)

Makes the INSERT of a dynamic block place a block of its own name that draws what it draws now, as AutoCAD's ConvertToStaticBlock(newBlockName): a new block of that name, its origin and units those of the block it places, the anonymous copy AutoCAD made for it (AnonymousBlockTableRecord) or the dynamic block itself, holding copies of that block's entities, as WblockCloneObjects(IEnumerable<DxfEntity>, DxfBlockTableRecord) copies them; the INSERT's 2 named it, and the entry AcDbBlockRepresentation of its extension dictionary, which ties it to the dynamic block, taken out. The INSERT is then no dynamic block's, its attributes kept as they are; the anonymous block stays for the other INSERTs that place it.

public void ConvertToStaticBlock(string newBlockName)

Parameters

newBlockName string

The name of the new block.

Exceptions

ArgumentNullException

Thrown when the name is null.

ArgumentException

Thrown when the name is one AutoCAD does not take, or that of a block of the drawing already, letters of either case the same; or when an INSERT of the drawing names a block of that name, which it has not, and the new block would come to insert itself through it: P holding an INSERT of MM, a block the drawing has not, and the dynamic block's copy an INSERT of P, MM would place P and P that MM. Nothing is written then.

InvalidOperationException

Thrown when the INSERT is in no drawing, is erased, or places no dynamic block, as AutoCAD refuses a reference that is not dynamic.

ConvertToStaticBlock()

Makes the INSERT of a dynamic block place an anonymous block that draws what it draws now, as AutoCAD's ConvertToStaticBlock(): as ConvertToStaticBlock(string) does, the new block named as AutoCAD names one itself, the first of *U1, *U2 and on the drawing has no block of and no INSERT of it names, and flagged anonymous (70 of 1).

public void ConvertToStaticBlock()

Exceptions

InvalidOperationException

Thrown when the INSERT is in no drawing, is erased, or places no dynamic block.