/// <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); }
public static void Add(List <double[]> points) { var acadDocument = DocumentLocator.GetAcadDocument(); points.ForEach ( pt => acadDocument.Database.ModelSpace.AddPoint(pt) ); }
public static void Add(List <double[]> points) { var acadDocument = DocumentLocator.GetAcadDocument(); acadDocument.Database.ModelSpace.AddPolyline(points.SelectMany(pt => pt).ToArray()); }