When the code is written in the Editor, you can load it straight from there, or save it as a .lsp and load it manually using "appload" at the command line.
In this case, type vpmove to activate the command - see the tutorial link I posted.
As for selecting the viewport, I can make a code that will let you select it using coords, but imo, it would be better to do the whole operation using LISP, instead of a mixture of commands from Excel. :wink:
i work for a furniture manufacturing company called british thornton.
i know i have gone the long way around but what i need to do is have individual rooms on layout tabs. i have done this by drawing a rectangle around the room in mspace. then i give the rectangle a group name. i use a series of commands written in excel to select and copy the group, pull it through into layout 1 in pspace, then make it into a viewport then zoom and scale to the original group (therefore zooming to that room) i copy and paste it into the command line from and it does it in seconds. but because i used copyclip to copy the rectangle in the first place, and the pasting it at 0,0 on my layout, the viewport is not in the center.
i tried the lisp and once iv selected the viewport, it doesn't move.
Ok, I think that could all be done using LISP, but as you have got to this stage already, I think its best we carry on from here.
As for this, I tried the LISP on my machine, and the viewports is moved correctly. Is there any chance you could attach a sample drawing so that I could see whats wrong?
i figured out why the lisp didn't work. its because I'm using a viewport that is made from a polygon. i don't know if theres a way to do it with one of those.
I'm trying to do something similar with regards getting the center of the viewport:
I'm trying to modify the center of another viewport so that it has the same x co-ordinate as the other viewport. (And I'm also trying to do this is autolisp, not vlisp ).
I was looking at the viewport entity and I'm guessing the viewport's center is at dxf code 12, so based on that (and I know it's not the best code layout but) here's what I've got:
This doesn't work. It just doesn't change the dxf code 12.
Does anyone know what the problem is?
EDIT: on further investigation it appears DXF code 17 is the modelspace centerpoint I'm after. But changing from 12 to 17 still doesn't replace the x co-ordinate in the second viewport. Any help would be great thanks.