How can I determine the size of the drawing.

How can I determine the size of the drawing.

Anonymous
Not applicable
399 Views
3 Replies
Message 1 of 4

How can I determine the size of the drawing.

Anonymous
Not applicable
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
0 Likes
400 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Alejandro wrote: > 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? Zoom extents then check the value of EXTMIN and EXTMAX. -- There are 10 kinds of people: those who understand binary and those who don't.
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks, that worked great. For those of you interested in how to do this: Dim coorR As Variant Dim coorL As Variant coorL = ThisDrawing.GetVariable("extmin") coorR = ThisDrawing.GetVariable("extmax") dwgHeight = Abs(coorR(1) - coorL(1)) dwgWidth = Abs(coorR(0) - coorL(0)) Thanks again for the tip. Alex Frank Oquendo wrote: > Alejandro wrote: > > >>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? > > > Zoom extents then check the value of EXTMIN and EXTMAX. >
0 Likes
Message 4 of 4

Anonymous
Not applicable
You need to perform a Zoom Extents to get updated coordinates. Without the zoom you cannot rely on the results. -- R. Robert Bell "Alejandro" wrote in message news:417de96c$1_3@newsprd01... Thanks, that worked great. For those of you interested in how to do this: Dim coorR As Variant Dim coorL As Variant coorL = ThisDrawing.GetVariable("extmin") coorR = ThisDrawing.GetVariable("extmax") dwgHeight = Abs(coorR(1) - coorL(1)) dwgWidth = Abs(coorR(0) - coorL(0)) Thanks again for the tip. Alex Frank Oquendo wrote: > Alejandro wrote: > > >>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? > > > Zoom extents then check the value of EXTMIN and EXTMAX. >
0 Likes