该需求主要是:
为了对工程设计图纸尺寸进行编号,需要打印整个图纸,打印格式为JPG图片;另外就是将各个尺寸标注数据导出,涉及尺寸的文本、坐标、类型等。
部分代码
var btr = (BlockTableRecord)tr.GetObject(btrId, OpenMode.ForWrite);
var lo = (Layout)tr.GetObject(btr.LayoutId, OpenMode.ForWrite);
// Extmin and Extmax - Returns the extents of Model space.
// Pextmin and Pextmax - Returns the extents of the current Paper space layout.
var startPoint =new Point3d(lo.Limits.MinPoint.X,lo.Limits.MinPoint.Y,0);
var endPoint = new Point3d(lo.Limits.MaxPoint.X, lo.Limits.MaxPoint.Y, 0);
if ( endPoint.X < doc.Database.Pextmax.X ) {
startPoint = doc.Database.Pextmin;
endPoint = doc.Database.Pextmax;
}
else if (endPoint.X < doc.Database.Extmax.X)
{
startPoint = doc.Database.Extmin;
endPoint = doc.Dat