Beispiel #1
0
        public void TestOverlayXRef()
        {
            using (var dwgFile = DwgExtractor.ExtractDwgFile("Drawing1.dwg"))
            {
                using (var db = AcadDatabase.Active())
                {
                    Assert.AreEqual(0, db.XRefs.Count());

                    var xRef = db.XRefs.Overlay(dwgFile.FileName, "XRefBlock");
                    Assert.AreEqual("XRefBlock", xRef.BlockName);
                    Assert.AreEqual(dwgFile.FileName, xRef.FilePath);
                    Assert.IsTrue(xRef.IsFromOverlayReference);
                }

                using (var db = AcadDatabase.Active())
                {
                    Assert.AreEqual(1, db.XRefs.Count());
                }
            }
        }
Beispiel #2
0
        public void TestDetachXRef()
        {
            using (var dwgFile = DwgExtractor.ExtractDwgFile("Drawing1.dwg"))
            {
                using (var db = AcadDatabase.Active())
                {
                    db.XRefs.Attach(dwgFile.FileName, "XRefBlock");
                }

                using (var db = AcadDatabase.Active())
                {
                    db.XRefs.First()
                    .Detach();
                }

                using (var db = AcadDatabase.Active())
                {
                    Assert.AreEqual(0, db.XRefs.Count());
                }
            }
        }