Esempio n. 1
0
 /// <summary>
 /// 拖拽绘制
 /// </summary>
 /// <param name="point"></param>
 /// <param name="objectIds"></param>
 public static void DragAndCopyEntities(Point3d point, Dictionary <ObjectId, DBEntity> objectIds)
 {
     try
     {
         DCadApi.isInsertSymbol = true;
         DCadApi.isModifySymbol = true;
         var dragger    = new ManyEntityCopy();
         var objIds     = GetObjIds(objectIds);
         var dragResult = dragger.StartDrag(point, objIds);
         if (dragResult.Status == PromptStatus.OK)
         {
             CreateTransformedInsert(dragger.DisplacementMatrix, objectIds);
         }
         else
         {
             ObjectsErase(objectIds);
         }
     }
     catch (System.Exception ex)
     {
         LogManager.Instance.Error(ex);
     }
     finally
     {
         DCadApi.isInsertSymbol = false;
         DCadApi.isModifySymbol = false;
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 多实体复制
        /// </summary>
        public void DragAndCopyEntities(ObjectId[] objectIds)
        {
            try
            {
                if (objectIds.Any())
                {
                    var point   = new Point3d();
                    var dragger = new ManyEntityCopy();
                    if (PublicMethod.Instance.IsExistPointSymbol(objectIds, ref point))
                    {
                        DCadApi.isModifySymbol = true;
                        var dragResult = dragger.StartDrag(point, objectIds);

                        if (dragResult.Status == PromptStatus.OK)
                        {
                            CreateTransformedCopy(dragger.DisplacementMatrix, objectIds);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogManager.Instance.Error(ex);
            }
            finally
            {
                DCadApi.isModifySymbol = false;
            }
        }