Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        public static void Add(List <double[]> points)
        {
            var acadDocument = DocumentLocator.GetAcadDocument();

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

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