Hello all, Is there any way not to show a particular block in block definition table ?
Could somebody give me a tip or something.
My program bring a block into drawing thru a user form . And set some Xdata to it after insertion . If user bring the
block manually into drawing then how would we know which one has xdata and which one doesn't. I came to this
solution to hide it in block definition list. Any Idea or better approach ?
Cheers .
Solved! Go to Solution.
Solved by StephenPreston. Go to Solution.
That's known as an anonymous block. Set the BlockReference.Name to "*U" when you add the BlockTable.
One method I use to validate the input is have a dictionary entry in the drawing that I create. This will contain the handle's of the blocks that I have inserted in the drawing. Then if someone copies one or inserts there own then I will know. I've also stored the insertion point so i will know if the object was moved.
If you're going to create the Dictionary object to begin with, might as well dispose of the block as well. 😉
I've run into problems with "invisible data blocks" from a variety of professionally developed applications before. As users copy/paste, insert/explode, make their own blocks using the application instead of plain AutoCAD, etc., copies of those data blocks can proliferate into every corner of your DWG universe. Hence, standard procedure for my own applications is to store such data in extension dictionaries under the NamedObjectDictionary. Invisible to the casual user, non-toxic to other organizations that may get the drawing, and easily removed.