Retrieving Magnification Factor When Using Dynamic Zoom

Discussion in 'AutoCAD' started by matt_1ca, Mar 24, 2005.

  1. matt_1ca

    matt_1ca Guest

    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
     
    matt_1ca, Mar 24, 2005
    #1
  2. matt_1ca

    juno Guest

    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
    ------
     
    juno, Mar 24, 2005
    #2
  3. matt_1ca

    juno Guest

    U can also use the SCREENSIZE varible to get the size of CAD window size.
     
    juno, Mar 24, 2005
    #3
  4. matt_1ca

    matt_1ca Guest

    Thanks Juno I will go and try it.

    Matt
     
    matt_1ca, Mar 24, 2005
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.