Retrieving Magnification Factor When Using Dynamic Zoom
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
Retrieving Magnification Factor When Using Dynamic Zoom

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
matt_1ca
Guest





Posted: Thu Mar 24, 2005 9:43 pm    Post subject: Retrieving Magnification Factor When Using Dynamic Zoom Reply with quote

I am trying to write a program to change actual size properties of text depending on magnification of a dynamic zoom .

In the old days when AutoCAD was still DOS based people made use of zoom say .5x or .2x or whatever factor they have in mind to change how everything appears. And if this were the case the program I am asked to write would be simple to me.

But now with the advent of dynamic zoom and wheel mouse those .5x and .2x have seemed to have become obsolete.
And worse -- I have no idea how to extract them because the dynamic zoom does not show anything from the command line.

I imagine that the solution is pretty straight forward -- but I am stumped and in the middle of nowhere anyway because of it.

I would greatly appreciate all the kind help you can extend in this regard

Gratefully,
Matt

Back to top
juno
Guest





Posted: Thu Mar 24, 2005 10:38 pm    Post subject: Re: Retrieving Magnification Factor When Using Dynamic Zoom Reply with quote

You can use ViewSize variable

The following code will place a text at the center of your screen at 1/20 the side of the screen.

Hope this helps
------
Sub test()
Dim CentText As AcadText
Dim TextString As String
Dim WindowHight As Double
Dim WindowCenter() As Double
'get screen hight
WindowHight = ThisDrawing.GetVariable("viewsize")
'get center of screen for text insertion
WindowCenter = ThisDrawing.GetVariable("viewctr")
'insert text at 1/4 the screen size in the center
TextString = "I am " & WindowHight / 20 & " Tall"
Set CentText = ThisDrawing.ModelSpace.AddText(TextString, WindowCenter, WindowHight / 20)
End Sub
------
Back to top
juno
Guest





Posted: Thu Mar 24, 2005 11:03 pm    Post subject: Re: Retrieving Magnification Factor When Using Dynamic Zoom Reply with quote

U can also use the SCREENSIZE varible to get the size of CAD window size.

Back to top
matt_1ca
Guest





Posted: Fri Mar 25, 2005 3:33 am    Post subject: Re: Retrieving Magnification Factor When Using Dynamic Zoom Reply with quote

Thanks Juno I will go and try it.

Matt
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
Powered by phpBB