Creating Views

Creating Views

Anonymous
Not applicable
218 Views
6 Replies
Message 1 of 7

Creating Views

Anonymous
Not applicable


According to J. Sutphin's AC2K VBA Prog Ref. (pg. 285)

"...the user must set the view they want on screen and then...create
a named view for that set up."

My question is then, how do you "set the view" programmatically? 
I have a lsp rotine which zoom-windows to 2 picked points.  It then
creates a view using the View-Window option and the 2 previuosly picked
points.  I can't find a way to Zoom-W using VBA.

Mark Sanchez

SPEC Services, Inc.

Fountain Valley CA USA

0 Likes
219 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
if you just want to zoom window then this code works

 

 

Dim Z1(0 to 2) as Double

Dim Z2(0 to 2) as Double

Z1(0) = lowerleftxpoint: Z1(1) =lowerleftypoint : Z1(2) =
0#
Z2(0) = upperleftxpoint: Z2(1) = upperleftypoint : Z2(2) =
0#
ZoomWindow Z1, Z2
0 Likes
Message 3 of 7

Anonymous
Not applicable
opps z2 should be you upper right points

 
0 Likes
Message 4 of 7

Anonymous
Not applicable


Thank for your help Jeremy!

Mark Sanchez

jeremy roman wrote:

 opps z2 should be you upper right
points
 

0 Likes
Message 5 of 7

Anonymous
Not applicable
According to Joe Sutphin's AC2K VBA Reference (pg. 285), " the user must
set the view they want on screen and then...create a named view for that
setup.

The challenge I am having involves capturing the correct AcadView
properties, particularly the .Height and .Width properties. My program
simply prompts the user for two points, zoom-windows using the selected
points, then attempts to create a view based on the ActiveViewport
settings.

As far as I can tell, the View created is using the Height & Width
properties of the previous view (the one displayed before the ZoomWindow
function). I've tried using the code:

ThisDrawing.Regen acActiveViewport

after the ZoomWindow function in an attempt to update the AcadView
properties, but still no success. When I Zoom-Window from the command
prompt, then run the code to create the view, the view is created
correctly. How do I get/set the correct (updated) property values into
my View?

Mark Sanchez
SPEC Services, Inc
0 Likes
Message 6 of 7

Anonymous
Not applicable
send me the code to create the view I will look at it
0 Likes
Message 7 of 7

Anonymous
Not applicable
Hello Jeremy,

Here is my code which attempts to create views inside AutoCAD 2000i.

The SetLimits macro starts things off by asking the user to pick two
opposite points.
Make sure that before running the macro, you draw a 34" long by 22" high
rectangle.
This will act as a proxy for my actual drawing border cut line.

There are other sub routines for different border sizes, but I was
trying to get the
34x22" example to work before proceeding. I have also included a copy
of the original
AutoLISP program that I am trying to emulate. This was written by a
former employee here.

Thanks a bunch

Mark Sanchez
SPEC Services, Inc.
Fountain Valley CA USA

jeremy roman wrote:

> send me the code to create the view I will look at it
0 Likes