Why can i not zoom after resize

Discussion in 'AutoCAD' started by backsix, Jun 7, 2004.

  1. backsix

    backsix Guest

    Hi All,

    Can anyone tell me why this doesn't work?

    Sub changesize()

    Debug.Print "thisdrawing " & ThisDrawing.Width & "x" & ThisDrawing.Height

    ThisDrawing.Height = ThisDrawing.Height * 0.5
    ThisDrawing.Width = ThisDrawing.Width * 0.5

    Update 'doesn't help zoom work
    ThisDrawing.Regen acAllViewports 'doesn't help zoom work

    Debug.Print "thisdrawing " & ThisDrawing.Width & "x" & ThisDrawing.Height
    ZoomExtents 'doesn't work
    ZoomAll 'doesn't work

    'after this procedure finishes zoom extents works fine from the command line.
    End Sub
     
    backsix, Jun 7, 2004
    #1
  2. I think what you want to do needs to be done via the activeviewport, not
    the active drawing. Altthough your code does work but it reizes the editing
    window, itself, not just the drawing.


    Option Explicit

    Sub changesize()
    With ThisDrawing.ActiveViewport
    Debug.Print "thisdrawing: " & .Width & "x" & .Height
    .Height = .Height * 0.5
    .Width = .Width * 0.5
    ZoomAll
    Debug.Print "thisdrawing: " & .Width & "x" & .Height
    End With
    End Sub


    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jun 7, 2004
    #2
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.