问题是tempblock.IsXRef试用于块对象而GetBoundingBox不试用块,因此即使tempblock.IsXRef成立也不能写成tempblock.GetBoundingBox()啊,代码如下:
For j:=0 to acadDoc.Blocks.Count -1 do begin tempBlock := acadDoc.Blocks.Item(j); msg:=msg+tempBlock.Name; if tempblock.isxref then begin [U]tempblock.GetBoundingBox(min_start,max_start) [/U]
end;
end;