I create a hatch using the AutoCAD .NET, and here is my code:
{
};
var ptCol
= new Point2dCollection
(pts
); var doubleCol
= new DoubleCollection
();
var doc = Acap.DocumentManager.MdiActiveDocument;
using (var tran = doc.Database.TransactionManager.StartTransaction())
{
var table = tran.GetObject(doc.Database.BlockTableId, OpenMode.ForRead) as BlockTable;
var record = tran.GetObject(table[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
record.AppendEntity(hatch);
hatch.AppendLoop(HatchLoopTypes.Default, ptCol, doubleCol);
hatch.EvaluateHatch(true);
tran.AddNewlyCreatedDBObject(hatch, true);
tran.Commit();
}
The code works well, and I can see a hatch in the AutoCAD interface.
Now I want to draw a line, so I use "line" command, but I can't pick a point on the Hatch I created.
I hope to pick boundary points on Hatch, even if there is no Polyline around Hatch.
I have searched for some information, and I may need to customize an entity using C++ to realize the function. I hope to obtain a more concise solution.
Thanks a lot.