I have entities with xdata and who's handles are stored in the NOD.
When using ARRAY what events occur to allow me to accommodate the command?
db_ObjectAppended & db_DeepCloneEnded don't seem to be triggered.
Solved! Go to Solution.
Solved by ActivistInvestor. Go to Solution.
Solved by _gile. Go to Solution.
Apologies. db_ObjectAppended is being triggered.
In db_ObjectAppended how can I determine the objectID of the array being added?
It looks like when an array is created the original entity is deleted, a new entity replaces it.
I need to transfer xdata from the old to the new.
@SRSDS wrote:I have entities with xdata and who's handles are stored in the NOD.
When using ARRAY what events occur to allow me to accommodate the command?
db_ObjectAppended & db_DeepCloneEnded don't seem to be triggered.
That depends on what "accommodate the command" means. You'll need to expand on that.
It also depends on whether you're making an associative array or a 'dumb' array.
I'm using the ARRAY command, which looks to produce an associative array (although I'm not entirely sure what a dumb array is).
I'll try to simplify this by saying I am arraying a single entity.
When AutoCAD creates this array it looks to delete the original entity and produce an associative array replacement.
I need to transfer the xdata from the original entity being deleted to it's replacement, but I'm not sure what the replacement is. Does the array have an objectID?
And when the array is exploded I'm thinking I need to transfer the xdata a new set of entities.
And when I explode the block
I can see that
The ARRAY command creates an "associative array", which is a special type of dynamic block.
This command first creates an anonymous block definition containing a deep clone of each selected object.
Then it creates a special type of dynamic block definition containing an array of block references of the newly created anonymous block.
Finally it inserted a block reference of the newly created dynamic block: the "associative array".
So, what you call "replacement" should be this block reference.
You should use some snoop tool to inspect the drawing database and entities such as MgdDbg or Inspector.
The ARRAY command can produce both associative and non-associative (e.g., 'dumb') arrays.
@_gile thoroughly described what an associative array is, although what I will add/emphasize, is that when you make an associative array, regardless of how many instances of the arrayed object(s) you see in the drawing, there is only a single copy of it/them created, and that copy is inserted into an anonymous block, and it is that anonymous block that is inserted and copied (into another container anonymous block).
A 'dumb' array is a non-associative array, which is just copies of the arrayed objects inserted directly into the drawing, and is how the ARRAY command worked before associative arrays were introduced.
When an object is copied/cloned, any XData it contains should also be copied. So, what is it that you want to do exactly, when an object with xdata is cloned? Do you want to modify the xdata in the cloned copy or something else?
Thank you both for the help again. Solved. Now I understand, and it was the first blockreference appended that I needed.
@ActivistInvestor You were right. The cloned entities within the dynamic block retain the XData but I needed to transfer that XData to the blockreference created by the array .
Can't find what you're looking for? Ask the community or share your knowledge.