Message 1 of 4
How can I determine the size of the drawing.
Not applicable
10-22-2004
08:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am currently iterating through all the items in the ModelSpace and
finding the largest and smallest; in essence finding the corners of the
drawing (see code).
For Each entry In ThisDrawing.ModelSpace
entry.GetBoundingBox pLeft, pRight
If pLeft(0) < lMinW Then lMinW = pLeft(0)
If pLeft(1) < lMinH Then lMinH = pLeft(1)
If pRight(0) > rMaxW Then rMaxW = pRight(0)
If pRight(1) > rMaxH Then rMaxH = pRight(1)
Next
However, this may not be the best nor most efficient way of going about
this, and I am open to suggestions. My problem is that my limits are
larger than the actual drawing. Are there some hidden elements in the
modelspace that can thow off my calculations?
I'm definitely thinking that I just want the smallest rectangle that the
drawing fits in, a la ZoomExtents. Does anyone have any ideas to help
me out?
Thanks,
Alex