Esempio n. 1
0
 public void Delete(TEarthworkBlocking blocking, List <ElementId> elementIds)
 {
     foreach (var elementId in elementIds)
     {
         Delete(blocking, elementId);
     }
 }
Esempio n. 2
0
 public void Delete(TEarthworkBlocking blocking, ElementId elementId)
 {
     if (!ElementIds.Exists(p => p == elementId.IntegerValue))
     {
         return;
     }
     ElementIds.Remove(elementId.IntegerValue);
     CPSettings_Obj.DeapplySetting(blocking, new List <ElementId>()
     {
         elementId
     });
 }
Esempio n. 3
0
        /// <summary>
        /// 合并节点
        /// </summary>
        /// <param name="index1">所选节点Index1,从0开始</param>
        /// <param name="index2">所选节点Index2,从0开始</param>
        /// <returns></returns>
        public bool Combine(TEarthworkBlocking blocking, int index1, int index2)
        {
            if (index1 == index2 ||
                (index1 < 0 || index1 >= EarthworkBlocks.Count) ||
                (index2 < 0 || index2 >= EarthworkBlocks.Count))
            {
                return(false);
            }
            //合并处理
            var b1 = EarthworkBlocks[index1];
            var b2 = EarthworkBlocks[index2];

            b1.Add(blocking, b2.ElementIds.Select(c => new ElementId(c)).ToList());
            Delete(b2);
            return(true);
        }
Esempio n. 4
0
        public void Add(TEarthworkBlocking blocking, ElementId elementId)
        {
            var block = blocking.EarthworkBlocks.FirstOrDefault(c => c.ElementIds.Exists(p => p == elementId.IntegerValue));

            if (block != null)
            {
                if (block.Id == Id)
                {
                    return;
                }

                block.Delete(blocking, elementId);
            }
            ElementIds.Add(elementId.IntegerValue);
            CPSettings_Obj.ApplySetting(blocking, new List <ElementId>()
            {
                elementId
            });
        }