Hello
I have to translate a vba macro to a .net application. One part of the program is to define the size of a titleblock (look for extents of titleblock)
In vba the code below was ok, and the extents point of the titleblock are calculatet. I need a codesection similar to thisone in vb.net
kx = 999999999
ky = 999999999
gx = -999999999
gy = -999999999
'Blockextents (TitleBlock)
For BlockObject = 0 To TitleBlock.Count - 1
If TitleBlock.Item(BlockObject).ObjectName = "AcDbLine" Or TitleBlock.Item(BlockObject).ObjectName = "AcDbPolyline" Or TitleBlock.Item(BlockObject).ObjectName = "AcDb2dPolyline" Or TitleBlock.Item(BlockObject).ObjectName = "AcDbBlockReference" Then
TitleBlock.Item(BlockObject).GetBoundingBox varMinExt, varMaxExt
'look for smalest and largest values
TitleBlock.Item(BlockObject).Highlight (True)
If kx > varMinExt(0) Then kx = varMinExt(0)
If ky > varMinExt(1) Then ky = varMinExt(1)
If gx < varMaxExt(0) Then gx = varMaxExt(0)
If gy < varMaxExt(1) Then gy = varMaxExt(1)
End If
Next BlockObject
the function [acadblockref.GetBoundingBox] shows the boundigbox of the blockreference, but if this block has some attributs which are overlapping the Block the boundigbox is not correct. This case you can find very often in titleblocks.
Is it possible to show an example how to interate thru the blockobjects with vb.net, thanks.
Best regards Bruno