Scale Area and Viewports

Discussion in 'AutoCAD' started by mihai, Sep 16, 2003.

  1. mihai

    mihai Guest

    When we define a scale area and make with it a viewport in paper space (in a
    layout) any change made in model space automatically reflects in that
    layout. It is posibly to control this link?

    Let say that I have a lot of scale areas in my model space, which are also
    placed in different layouts, and I want to make a routine that automatically
    zoom to model space if I am in layout... and viceversa.
    Is there a posibility to obtain the coordinates from model space refered by
    such a viewport?
     
    mihai, Sep 16, 2003
    #1
  2. mihai

    Kevin Terry Guest

    While this is not a ready-made solution for you, I think it might have what
    you need to accomplish this. Just substitute ZoomWindow for ZoomExtents in
    the code, and plug your coordinates in:

    Dim aPView As AcadPViewport
    Dim aLayout As AcadLayout
    Dim i As Long

    On Error Resume Next
    ThisDrawing.MSpace = False

    For Each aLayout In ThisDrawing.Layouts
    ThisDrawing.ActiveLayout = aLayout
    If aLayout.Name <> "Model" Then
    For i = 0 To ThisDrawing.PaperSpace.Count - 1
    If TypeOf ThisDrawing.PaperSpace.item(i) Is AcadPViewport
    Then
    Set aPView = ThisDrawing.PaperSpace.item(i)
    aPView.Display True
    ThisDrawing.MSpace = True
    ZoomExtents
    ThisDrawing.MSpace = False
    End If
    Next
    End If
    Next


    Kevin
     
    Kevin Terry, Sep 17, 2003
    #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.