[C# CE]在不同model参考不同文件

请问怎么在同一个文件中的两个model中参考不同的dgn文件,我下面的测试代码在Default model中参考能成功,后面在 比较版本model中参考另一个文件时,就会报错,提示未找到缓存,这是什么原因啊

//版本对比
            //打开版本对比文件
            string path = DefaultPath.GetCompareVersionsPath();
            BMI.Utilities.ComApp.OpenDesignFile(path, false);
            //清空之前的参考文件
            var atts = BMI.Utilities.ComApp.ActiveModelReference.Attachments;
            var list = atts.GetEnumerator();
            while(list.MoveNext())
            {
                atts.Remove(list.Current);
            }
            //在不同的model中参考需要比较的两个文件
            atts.AddCoincident(@"C:\Users\liuzhanh\Desktop\999.dgn", "Default", "test", "test");
            //激活
            var models = BMI.Utilities.ComApp.ActiveDesignFile.Models.GetEnumerator();
            while (models.MoveNext())
            {
                if ((models.Current as ModelReference).Name == "比较版本")
                {
                    (models.Current as ModelReference).Activate();
                }
            }
            atts = BMI.Utilities.ComApp.ActiveModelReference.Attachments;
            atts.AddCoincident(@"C:\Users\liuzhanh\Desktop\123.dgn", "比较版本", "test", "test");

Parents Reply Children