Merge References

That's all I have done and working, but if I want all the elements to be moved to a new empty blank project, I am an error, that the elements do not exist, how to be?

 private void MergeRefernces(object sender, EventArgs e)
{
            micro = new MicroStationDGN.Application();
           designFile = micro.ActiveDesignFile;
            MicroStationDGN.ElementScanCriteria scan = new MicroStationDGN.ElementScanCriteria();
scan.IncludeOnlyVisible();
MicroStationDGN.ElementEnumerator enumer =micro.ActiveDesignFile.DefaultModelReference.Attachments[1].Scan(scan);
while (enumer.MoveNext())
{
designFile.Models[1].Activate();
MicroStationDGN._Element sourceElem = enumer.Current;
designFile.DefaultModelReference.AddElement(sourceElem);
}
designFile.Views[1].Redraw();
designFile.DefaultModelReference.Attachments.Remove(1);

}


Parents Reply Children