Тема: Создание штриховки
Добрый день!
Подскажите почему не получается заштриховать внутреннюю часть пересекаемых объектов?
[CommandMethod("testHatch", CommandFlags.UsePickSet)] static public void testHatch() { Document aDoc = AcAp.Application.DocumentManager.MdiActiveDocument; Database db = aDoc.Database; Editor ed = aDoc.Editor; using (DocumentLock acLckDoc = aDoc.LockDocument()) { using (Transaction tr = db.TransactionManager.StartTransaction()) { BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite); ObjectIdCollection lnIds = new ObjectIdCollection(); Circle crc = new Circle(); crc.Center = new Point3d(0, 0, 0); crc.Radius = 10; lnIds.Add(btr.AppendEntity(crc)); tr.AddNewlyCreatedDBObject(crc, true); { Line ln = new Line(); ln.StartPoint = new Point3d(0, 0, 0); ln.EndPoint = new Point3d(15, 0, 0); ln.TransformBy(Matrix3d.Rotation(Math.PI / 2, ed.CurrentUserCoordinateSystem.CoordinateSystem3d.Zaxis, new Point3d(0, 0, 0))); lnIds.Add(btr.AppendEntity(ln)); tr.AddNewlyCreatedDBObject(ln, true); } { Line ln = new Line(); ln.StartPoint = new Point3d(0, 0, 0); ln.EndPoint = new Point3d(15, 0, 0); ln.TransformBy(Matrix3d.Rotation(Math.PI, ed.CurrentUserCoordinateSystem.CoordinateSystem3d.Zaxis, new Point3d(0, 0, 0))); lnIds.Add(btr.AppendEntity(ln)); tr.AddNewlyCreatedDBObject(ln, true); } Hatch oHatch = new Hatch(); btr.AppendEntity(oHatch); tr.AddNewlyCreatedDBObject(oHatch, true); oHatch.SetHatchPattern(HatchPatternType.PreDefined, "SOLID"); oHatch.Associative = true; oHatch.AppendLoop(HatchLoopTypes.Default, lnIds); oHatch.EvaluateHatch(true); lnIds.Clear(); tr.Commit(); } } }
Выдает ошибку eInvalidInput
Спасибо