Maybe my original post from back in 2010 will help.. https://forums.autodesk.com/t5/autocad-forum/viewport-question/m-p/2652755#M265739
Is it possible to attach a viewport to a rectangle?
We have a campus map in model space and on one layout we have a viewport showing the entire map with another viewport zoomed in showing the project area. On the entire map portion I have a rectangle showing the area for the project and what I'm wondering is if it's possible to tie the zoomed project area viewport to the rectangle so that I can just slide the rectangle around and have the zoomed viewport follow suit or vice versa, pan the zoomed viewport and have the retangle slide around.
In that thread someone posted the following but I don't remember using it and at this point I'm unsure of how to even use it. I'm guessing I need to create a file that I can then execute from within ACAD but again I'm unsure of how to go about that.
[Z other]^P'_setvar;cvport;(progn(setq v(getvar "cvport")p1(getpoint
"1st pt:")p2(getcorner p1 "2nd pt:"))v);\\'_zoom;w;!p1;!p2;^P
For what it's worth I know this is possible as I used this idea for 2 years while at that job. I don't think I used that code but I KNOW the concept of what I was trying to do was accomplished and I could slide my box around and the zoomed in detail viewport would reflect whatever the box was over. I seem to remember it was a basic function within autocad but I'm at a loss.