ReferenceKeys of Occurrences/SubOccurrences are only unique inside the AssemblyDocument where they belong to.
You can get the same RefKey for leaf.par (Occurrence) relative to subsubasm and for otherLeaf.par (Occurrence) relative to top.asm. ReferenceKeys of Occurrences are only unique inside the parent assembly.
Suboccurrences are always relative to the top level assembly and therefore are always unique inside the whole assembly structure.
If you have a ReferenceKey of a SubOccurrence you can always bind back to this SubOccurrence object by using the AssemblyDocument::BindKeyToObject() method. The AssemblyDocument should be the top level assembly here.
If you call the BindKeyToObject method with a ReferenceKey of an Occurrence, you can only get the correct Occurrence, if you call the method on its parent assembly.
My advice is to not mix up ReferenceKeys of Occurrences and SubOccurrences, but use only the ones for SubOccurrences.
Posted by: Martin Bernhard Post date: 3/13/2008 3:08:46 AM