ygrigoryev@gmail.com
Guest
|
Posted:
Tue Nov 01, 2005 9:10 pm Post subject:
centering AcadPViewport |
|
|
hi all
i am new to AutoCAD and trying to come up with a function to properly
scale an ActivePViewport looking at block with a given insertion point
by applying custom scale that is a just function of a block's
dimensions (makes blocks of different dims fit in the ActivePViewport)
doc.ActivePViewport.StandardScale=AcViewportScale.acVpCustomScale;
doc.ActivePViewport.CustomScale = somescalefactor;
which works great. but it seems that unless the ActivePViewport is
perfectly centered and is looking at the center of the block, applying
a scale factor offsets the block towards the borders of the viewport,
potentially clipping the block.
i have no trouble finding the needed AcadPViewport, making it active
and working with its properties, but do not understand changing which
ones will achieve the centering I need. We have:
AcadPViewport.Center
AcadPViewport.Target
that reference arrays of three doubles, but I could find little
information which coordinate systems they work with and what they do
and how they work together (if). knowing insert point and dims of a
block can give us its center in mspace, but how can we center pviewport
over it?
my autocad terminology prob. sucks, but i'm hoping i communicated the
message.
i appreciate any help,
thanks.
|
|