Block Definitions

Block Definitions

Kluppy
Explorer Explorer
613 Views
2 Replies
Message 1 of 3

Block Definitions

Kluppy
Explorer
Explorer

Hi Everybody,

Can anyone tell me how to stop a user from editing/Exploding blocks with the Acad block editor.  You can set a block as 'explodeable' = false, bot that seems to only work in the drawing context.  I would like to stop the user from altering the block definition by any method. 

 

The block is a titleblock and is used to display drawing information which is held in a multiline attribute(containing an XML formatted srting) of an invisible block.  The user gets a custom dialog to edit the XML which is then written to an attributed block nested inside another block and not explodable.  Effectively, the titleblock is a presenter for the drawing information.  The titleblock can be erased but a new titleblock can be populated with the data held in the invisible block.

 

I would like to stop the inquisitive user from editing or exploding the blocks via the block editor.

 

0 Likes
614 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

You could set the system variable BLOCKEDITLOCK to 1 but they could always change it back.

 

See if these help

 

http://www.theswamp.org/index.php?topic=36206.msg412806#msg412806

 

http://through-the-interface.typepad.com/through_the_interface/2008/08/preventing-an-a.html

0 Likes
Message 3 of 3

Kluppy
Explorer
Explorer

Thanks Jeff for your code example.  It works fine on standard blocks but in this case where i have a block with attributes that has been 'wblocked' again, it doesn't prevent the inner block from being exploded and thus the ability to update those attributes. I added the name of both the outer and inner blocks to the 'blockNames' list. I also modified this line:-

 

ObjectId btrObjId = bt[bName].GetObject(OpenMode.ForRead).ObjectId;

 

so that we can have multiple blocknames in the list and each are tested. 

 

I also noticed that, although the block reference cannot be exploded, the block definition changes have been saved and when you insert that block again, it has the modified appearance.

0 Likes