Exemple #1
0
        public static bool IsHoleReferenced(Entity ent, Transaction tr)
        {
            if (ent is Polyline2d || ent is Polyline)
            {
                // 如果不是flag,没有被引用
                string cassFlag = CadUtils.GetCassFlag(ent);
                if (CassFlagIsland.ToLower() != cassFlag.ToLower())
                {
                    return(false);
                }

                var groupId = GroupUtils.FindEntityGroupId(tr, ent);
                if (!groupId.IsValid)
                {
                    return(false);
                }

                // 如果不是flag,没有被引用
                //ObjectId[] entityIds = GroupUtils.GetGroupedObjects(ent);
                //foreach (ObjectId entityId in entityIds)
                //{

                //}
                var realId = ParcelPolygon.FindParcelOfHole(tr, ent);
                if (realId.IsNull)
                {
                    return(false);
                }

                return(true);
            }

            return(false);
        }
Exemple #2
0
            static void AddHolesToEntityGroup(ObjectId parcelId, ObjectId[] holeIds)
            {
                // 看是否存在组,如果没有,直接新建一个
                var groupId = GroupUtils.FindEntityGroupId(parcelId);

                // 关联地块和孔洞
                AddHolesToParcel(parcelId, groupId, holeIds);
            }