My plugin creates copies of art within a document. It also creates references between art, by putting a reference to one art's UID as an UIDREFRef into another art's dictionary. When copying art, the complete dictionary, including the UIDREFRefs gets copied, too. The UIDREFRefs are also still valid and working well with the art copy.
This all works flawlessly well. Most of the time…
In a specific routine, the art's copy reproducibly receives broken UIDREFRefs. This basically means, that if I try to retrieve the referenced art via AIEntry::ToUIDRef (this part works) the following AIUID::GetName (which usually returns the art's XML id) gives me NULL, where in other routines I get the newly created art's XML id.
I couldn't find any more details in the SDK documentation as of when copying art could go wrong and when a UIDREFRef might get invalidated. Any hints would be highly appreciated! 🙂
I've been having this problem, too, but only when Illustrator is redrawing an effect, not when my plugin explicitly draws it from a user action like button or menu item. I figured Illustrator is just really fragile while doing background tasks like that.