I need a sanity check on a user's (hopefully not) impossible request.
I've developed a few routines that start when double-clicking on a block, display the appropriate form, and then rebuild the block according to the form information (I delete all entities in the BlockRecord and add as required).
It all works great when there's only one copy of the block in the drawing. Now I'm being asked to make it update only the selected instance of the block. I've tried anonymous blocks but if the user copies the existing anonymous block, it's no longer unique. Creating a dynamic block programmatically isn't really possible yet (fyi: I'm in 2013) and having a dynamic block with 30+ visibility states when I might be using 3 max just isn't feasible. Attributes alone also don’t solve my issue.
So…is it possible to have multiple copies of a block that I can update independently via the .Net API but all copies of the block have the same name?
Solved! Go to Solution.
Solved by CallMeJames. Go to Solution.
I can create a unique copy of the block with a different name but it won't stop the user from copying the existing block and assuming they're separate.
Just thinking off the cuff here, you could embed the block reference ObjectId in the block definition, xdata or a dictionary, and do a lookup. When the user double-clicks a block and the ObjectId doesn't match the one that is stored for that particular block definition, create a new block definition and replace the block that the user double-clicked...
Not sure if that makes sense, it's late.
Or get the block name when doubleclicked and check if there is more than 1, if there is rename them all as required and then edit the target block?
Figured it out! What finally worked is the following steps:
Thanks to everyone who helped with this.