view center !!!

Discussion in 'AutoCAD' started by elefebvre, Jun 17, 2004.

  1. elefebvre

    elefebvre Guest

    hi,

    i am very frustrated by now. at a certain point in my program i store a view. somewhat later, i want to restore that view, which works in most cases, but when my form is still active. it won't do it until i close it. So i thought i had found a way around it to get the target, center, width and height properties of this named view, calculated the corners and then zoomwindow...

    well, it seems like the target and the center properties do not mean the center of the actual view. I have checked several cases and every time, those 2 points are somwhere outside the view. What is the deal here?

    Can anybody please shed some light on this?

    Thanks in advance!

    Emmanuel
     
    elefebvre, Jun 17, 2004
    #1
  2. elefebvre

    Joe Sutphin Guest

    Application.Update

    view. somewhat later, i want to restore that view, which works in most
    cases, but when my form is still active. it won't do it until i close it. So
    i thought i had found a way around it to get the target, center, width and
    height properties of this named view, calculated the corners and then
    zoomwindow...
    center of the actual view. I have checked several cases and every time,
    those 2 points are somwhere outside the view. What is the deal here?
     
    Joe Sutphin, Jun 17, 2004
    #2
  3. elefebvre

    elefebvre Guest

    this is my code. it still won't change my view as long as the form is open. as soon as i close it it jumps to the saved view.

    ThisDrawing.SendCommand ("-view" & vbCr & "r" & vbCr & "LABELS_BBS" & vbCr)
    Application.Update


    Here below is the code that i wrote to try to get around this:

    p(0) = (vw.Target(0) + vw.center(0)) / 2: p(1) = (vw.Target(1) + vw.center(1)) / 2: p(2) = 0
    p1 = ThisDrawing.Utility.PolarPoint(p, 0, -vw.Width / 2)
    p1 = ThisDrawing.Utility.PolarPoint(p1, 1.57, -vw.height / 2)
    p2 = ThisDrawing.Utility.PolarPoint(p, 0, vw.Width / 2)
    p2 = ThisDrawing.Utility.PolarPoint(p2, 1.57, vw.height / 2)
    Zoomwindow p1, p2

    Target and Center end up to be somwhere outside my view and never consistent. Except for the Target which is always the same point.

    so i'm still in the dark...
     
    elefebvre, Jun 18, 2004
    #3
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.