merging references

I got a problem of merging refs...

the key-in command 'reference merge all' fails to merge some refs but it's just fine if I manually select those refs and choose the menu item 'merge into master', so I try to copy elements from ref through vba, again the problem of this approach is elements on levels turned off in ref are copied in. it seems like there is an un-documented MDL function 'mdlElmdscr_fromReference' can do the trick, will this func be supported in the future?

any comments & suggestions are welcome...

  • Your post is confusing. How do you plan to merge references …

    1. Using a keyin?
    2. Using VBA?
    3. Using MDL?

    Unknown said:
    there is an un-documented MDL function 'mdlElmdscr_fromReference

    How did you find that undocumented function? No matter: there is a documented function that serves the same purpose: mdlElmdscr_readToMaster

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • I'm using a MVBA to merge refs, and in the MVBA, I use MicroStaiton key-in 'reference merge'. as I said, it does not work for certain files, so I'm looking into alternatives, such as MDL functions

  • Scan, CopyElement, CopyContext

    VBA is pretty capable, and I doubt that you need any MDL functions. Rather than queuing a command (which is no different than keying-in that command), use the scanner to obtain an ElementEnumerator from your source model. Use the destination model's CopyElement method with a CopyContext object to perform the magic you want.

    1. Create an empty destination model
    2. Attach your source model as a reference
    3. Use source ModelReference.Scan to obtain an ElementEnumerator
    4. Create a CopyContext object
    5. For each Element in the enumerator, use destination ModelReference.CopyElement

    MicroStation VBA help documents the above methods, and provides some examples on how to use them.

    VBA Forum

    Prefer to post questions about VBA to the VBA Forum. The Programming Forum is haunted by MDL programmers and the like.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions