示例#1
0
文件: Select.cs 项目: Sivolday/MT
        /// <summary> Выбор примитивов на экране </summary>
        /// <param name="autoCADPrimitivesName"> Имя приметива </param>
        /// <returns> Список приметивов </returns>
        public static List <AcadEntity> OnScreen(string autoCADPrimitivesName)
        {
            var acadDocument = DocumentLocator.GetAcadDocument();

            // Установка пространства модели
            acadDocument.ActiveSpace = AcActiveSpace.acModelSpace;

            AcadSelectionSet selectionSet = acadDocument.SelectionSets.Add(DateTime.Now.Millisecond.ToString());

            Int16[]  filterCode  = new Int16[] { 0 };
            object[] filterValue = new object[] { autoCADPrimitivesName };

            selectionSet.SelectOnScreen(filterCode, filterValue);
            var listOfEntities = new List <AcadEntity>();

            Debug.WriteLine($"Из AutoCADa заполучено ${selectionSet.Count} объектов");

            foreach (AcadEntity entity in selectionSet)
            {
                listOfEntities.Add(entity);
            }

            selectionSet.Delete();
            return(listOfEntities);
        }
示例#2
0
        public static void Add(List <double[]> points)
        {
            var acadDocument = DocumentLocator.GetAcadDocument();

            points.ForEach
            (
                pt => acadDocument.Database.ModelSpace.AddPoint(pt)
            );
        }
示例#3
0
        public static void Add(List <double[]> points)
        {
            var acadDocument = DocumentLocator.GetAcadDocument();

            acadDocument.Database.ModelSpace.AddPolyline(points.SelectMany(pt => pt).ToArray());
        }