Table of Contents

CadBlockEditor

from OpenCAD2D import CadBlockEditor

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

The Block Editor open on a drawing (CadDocument.BlockEditor): the block it shows, the space that shows it and whether it has changes not saved.

Properties and fields

CurrentDrawing

.NET

CurrentDrawing: ClassVar[str]

The name the Edit Block Definition dialog lists first, which opens model space itself.

NotAllowed

.NET

NotAllowed: ClassVar[str]

What a command that leaves the block says while the editor is open.

BasePoint

.NET

@property
def BasePoint(self) -> GeoPoint3

Gets the base point of the block, where the UCS icon stands: the origin of its definition, or the drawing's $INSBASE for <Current Drawing>.

HasUnsavedChanges

.NET

@property
def HasUnsavedChanges(self) -> bool

Gets whether the block has changes not saved: an edit since it was opened or last saved, or a new block never saved. Undoing back to where it was opened leaves none.

IsCurrentDrawing

.NET

@property
def IsCurrentDrawing(self) -> bool

Gets whether model space itself is open (<Current Drawing>).

IsNew

.NET

@property
def IsNew(self) -> bool

Gets whether the block was made by BEDIT and has not been saved yet: closing without saving makes no block.

Name

.NET

@property
def Name(self) -> str

Gets the name of the block, or CadBlockEditor.CurrentDrawing where model space is open.

Space

.NET

@property
def Space(self) -> CadSpace

Gets the space that shows the block, the document's current space while the editor is open.

VisibilityState

.NET

@property
def VisibilityState(self) -> str | None

Gets the visibility state the editor shows, as AutoCAD's Visibility State box: the first of the block's when it opens; null for a block of none. The entities another state lists and this one does not are hidden; an entity no state lists, as one drawn in the editor, is shown in every state.

VisibilityStates

.NET

@property
def VisibilityStates(self) -> System.Collections.Generic.IReadOnlyList[str]

Gets the visibility states of the block open, as AutoCAD's Visibility State box lists them, read anew from the block on each call (DxfBlockTableRecord.GetVisibilityStates); empty for a block of none, or for <Current Drawing>.