How to lock Block Table Records from being edited?

By Philippe Leefsma

Q:

<p>It would be nice to have the ability to lock up table records like block definitions so they can't be altered. I know this can be done through the use of reactors, but I don't want our blocks being changed when going out to a client or design firm. This would allow to keep drawing integrity better.</p>    <p><a name="section2"></a></p>  <p><b>A:</b></p>  <p>You are correct with what you say about using reactors - without your application loaded the user can indeed modify the AcDbBlockTableRecord's.</p>  <p>The other way to do what you want is to create your own custom AcDbBlockTableRecord by deriving from AcDbBlockTableRecord and simply vetoing the subOpen() for write. This will work fine - unfortunately, the exception is when your custom AcDbBlockTableRecord DBX is not loaded; in this case AutoCAD does not expect to find Proxy entities residing in the AcDbBlockTable and because of this, implements no proxy support whatsoever. Obviously, without the proxy entity support trying to access the custom AcDblockTableRecord without the DLL host loaded will cause an exception.</p>  <p>At this time, there is no workaround.

Comments

3 responses to “How to lock Block Table Records from being edited?”

  1. There is a commercial solution. CADVault also requires the recipient to install the object enabler (aka runtime), but AutoCAD won’t crash if they haven’t installed it.

  2. So that’s the same limitation than what the post is talking about in the first place concerning reactors, without the app installed on client machines there is no way to enforce locking block records.

  3. Sorry, I should have been more clear. It’s actually not the same. In the missing reactors case, you end up with a normal block definition. In the case of a vault with a missing runtime, you end up with proxy graphics.

Leave a Reply to Philippe LeefsmaCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading