centering AcadPViewport
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
centering AcadPViewport

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
ygrigoryev@gmail.com
Guest





Posted: Tue Nov 01, 2005 9:10 pm    Post subject: centering AcadPViewport Reply with quote

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.

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB