[v8i VBA] Dropped elements of complex chain in attachment has wrong levels

Hi,

I'm using a VBA script to drop all elements of an active file and its attachments and copy them into another file. It has worked fine for years - until now.

Example:
I have an active dgn file with one attachment to it. Exporting elements from the active file is no problem at all, no matter what type.
Now the attachment: inside of it there is a complex chain with a few linestrings and arcs.
If I use Microstations property dialog it shows level "A" for complex chain header and also level "A" for child elements.
When I debug my script it shows level "A" for complex chain header and after dropping that and stepping through returned ElementEnumerator elements those elements have level "B".

It seems like Microstation is not able to get right level information when dropping complex elements that came from an attachment.

Did someone else stumbled across that behavior? What did you do? Any help would be greatly appreciated!

Regards
Stephan

Parents Reply Children
  • Hi Jan,

    copy context was the problem. Once again. I'm not sure but I think we had that topic before... The problem was that I took some complex chain/polygon element from attachments directly out of an element enumerator and dropped it to iterate through its child elements.

    The solution is to copy the complex element from the attachment into the active model (by using the copy context) before dropping it. Then after dropping it the child elements will have correct level settings and stuff.

    Thank you for your help!

    Regards
    Stephan