Object Lock

Function Syntax LockObjects / UnlockObjects / DisableLock
Current Version 1.0
Download ObjectLock.lsp
View HTML Version ObjectLock.html

Program Description

This is a purely academic piece of code demonstrating the ability to prevent modification of a set of objects using reactors.

The user can 'lock' a set of entities by typing 'LockObjects' at the AutoCAD command-line and making a selection of objects. The program then stores the handles and DXF data of the selected entities and initiates an Editor Reactor to be triggered following command completion.

When a command has ended, the callback function of the Editor Reactor is evaluated and the 'locked' entities are modified to revert back to the stored DXF data.

The code also demonstrates a method of saving the handles of the locked objects in a drawing dictionary, so that the reactors may be re-built upon loading the code in another drawing session.

The user can unlock a selection of objects by typing 'UnlockObjects' at the AutoCAD command-line, or indeed unlock all locked objects using the 'DisableLock' command.

Instructions for Running

Please refer to How to Run an AutoLISP Program.


increase · reset · decrease

Designed & Created by Lee Mac © 2010