Table of Contents

CadDynamicBlocks

from OpenCAD2D import CadDynamicBlocks

class CadDynamicBlocks(System.Object) ยท CadDynamicBlocks in the .NET reference

Dynamic blocks in use, as AutoCAD 2021 drives them: the custom grips of a dynamic INSERT, a grip dragged or clicked, a property of the Custom group of Properties typed or chosen, and RESETBLOCK. Each change is one undo step, and the block is worked out anew by the library (DxfDynamicBlockReferenceProperty.Value) into an anonymous block that keeps its tie to the dynamic block, so that Properties still names it by the dynamic block's name. Parameters and actions are read, not added: the app drives the dynamic data a drawing holds.

Methods

Choose

.NET

@staticmethod
def Choose(document: CadDocument, handle: str, gripIndex: int, value: str) -> CadEditResult

Chooses a value of the list of a visibility, a lookup or a block table grip, as AutoCAD's list at the grip: the state shown, the lookup's row, every value it looks up set with it, or the table's row, Block Table1 set to its index and every column with it. One undo step.

Click

.NET

@staticmethod
def Click(document: CadDocument, handle: str, gripIndex: int) -> CadEditResult

Clicks a custom grip of a dynamic INSERT, as AutoCAD does: a flip grip flips the block (its state 0 to 1, 1 to 0), one undo step. A grip of another kind is refused: a visibility, a lookup or a block table grip lists its values (CadDynamicBlocks.ValuesOf), the others are dragged.

ResetBlock

.NET

@staticmethod
def ResetBlock(
    document: CadDocument,
    handles: System.Collections.Generic.IReadOnlyCollection[str],
) -> CadEditResult

Puts every dynamic property of the dynamic INSERTs among entities back to the block's own, as AutoCAD's RESETBLOCK: each INSERT places its dynamic block again (DxfBlockReference.ResetBlock), keeping its place, scale and attributes. One undo step.

SetProperty

.NET

@staticmethod
def SetProperty(
    document: CadDocument,
    handles: System.Collections.Generic.IReadOnlyCollection[str],
    name: str,
    text: str,
) -> CadEditResult

Sets a property of the Custom group of the dynamic INSERTs among entities, as AutoCAD's palette sets it: a distance typed as a number, an angle in degrees, a flip's state by its name or as 0 or 1, a visibility state or a lookup's label by its name, a table's row by its index, a text as typed. The value is taken to the parameter's value set by the library, as AutoCAD takes it: a Width of a list of 800, 900 and 1 000 typed 870 is 900. One undo step.

ValuesOf

.NET

@staticmethod
def ValuesOf(
    document: CadDocument,
    handle: str,
    gripIndex: int,
) -> tuple[System.Collections.Generic.IReadOnlyList[str], str]

Gets what a visibility, a lookup or a block table grip lists when clicked, as AutoCAD's list at the grip: the values allowed, in the parameter's order, and the one the INSERT shows, ticked; of a block table its rows, each its cells parted by commas, a number to 4 places, as "100.0000, 50.0000", the row the INSERT shows ticked, none where it shows none.