protected override bool IsIntersectQualified(ObjectId sourceId, List <Point3d> sourceVertices, ObjectId targetId, List <Point3d> targetVertices, List <Point3d> intersectPoints, Transaction transaction) { var duplicateWithSource = PolygonIncludeSearcher.AreDuplicateEntities(sourceVertices, intersectPoints); var duplicateWithTarget = PolygonIncludeSearcher.AreDuplicateEntities(targetVertices, intersectPoints); // 确保它们不是软件认为的孔洞 if (duplicateWithSource && !duplicateWithTarget && PolygonHoleHelper.IsHoleReferenced(transaction, sourceId) || !duplicateWithSource && duplicateWithTarget && PolygonHoleHelper.IsHoleReferenced(transaction, targetId)) { return(false); } return(true); }
protected override IEnumerable <CheckResult> CheckImpl(IEnumerable <ObjectId> selectedObjectIds) { var results = new List <FindIslandPolygonCheckResult>(); var editor = Document.Editor; var document = Application.DocumentManager.MdiActiveDocument; List <ObjectId> holeIds = PolygonHoleHelper.FindUnreferenceHoles(document); foreach (var holeId in holeIds) { var checkResult = new FindIslandPolygonCheckResult(holeId); results.Add(checkResult); } return(results); }