Private Sub Form_Load()
CAdViewer1.SourcePath = "C:/tmp.dwf"
End Sub
Private Sub Command1_Click()
Dim pv as IAdPageViewer
Set pv = CAdViewer.Viewer
pv.SetView 0, 0, 10, 10 'Set a zoom window
Dim cpv as CAdPageView
Set cpv = pv.View
'Extract the current display coordinates.
Debug.Print cpv.Bottom &"," &cpv.Left &","
&cpv.Right &"," &cpv.Top
End Sub
cheers,
-Thilak
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <In
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.-1@WebX.maYIadrTaRb">news:f15b81f.-1@WebX.maYIadrTaRb...
whip and volo, I could set the current view rectangle (SetAndDrawView) via
javascript. In Express, I can get from the AdViewer object to an AdPageViewer
object(via .Viewer - [aside - didn't see it mentioned in the doc, just using
ole viewer]) but it gives me an IAdReaderViewer interface. I was hoping for an
IAdPageViewer interface where I could try .SetView().
Is there a way in javascript with Express to set the current view/zoom
rectangle?
thanks
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <But,
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.1@WebX.maYIadrTaRb">news:f15b81f.1@WebX.maYIadrTaRb...
in JavaScript, you cannot select a different interface, and the default
interface returned by .Viewer is IAdReaderViewer.
Are you saying that this cannot be done from javascript?
thanks,
The parameters are left, bottom,
right, top and they are in paper units (in or mm), not drawing units.
You can also set the view using
the named view collection. I have included some samples below.
size=2>
size=2>function InitialView ()
{
size=2> AdView.Viewer.WaitForPageLoaded();
AdView.Viewer.View =
AdView.Viewer.NamedViews.Item ("INITIAL");
}
function ViewTour
()
{
size=2> AdView.Viewer.WaitForPageLoaded();
size=2> for (i = 1; i <= AdView.Viewer.NamedViews.Count; i++
)
{
view =
AdView.Viewer.NamedViews.Item(i);
AdView.Viewer.View
=
view
alert(view.name);
}
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <I
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.3@WebX.maYIadrTaRb">news:f15b81f.3@WebX.maYIadrTaRb...
don't see this in the api documentation.
What units are in the SetView call and in what order? I changed my
SetView(left, right, bottom, top) from whip/volo to SetView( left, bottom,
right, top) like oleview says for express. But when I give the corners
specified in, for example, my "INITIAL" view in the dwf file I end up lost in
space. Seemed like my corners of(Left:-13000, Bottom:-8000, Right:13000,
Top:8000) seemed off by a factor of 1000 (plus some offset) for the SetView
call. I need a call of somewhere around SetView( 0, 0, 10, 10 ) to get my
(-13000, -8000, 13000, 8000) corners.
In a future release the EV API
may be able to transform a point from drawing units to paper units.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <And,
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.6@WebX.maYIadrTaRb">news:f15b81f.6@WebX.maYIadrTaRb...
by configuration, I apparently mean conversion to paper
units.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <I
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.8@WebX.maYIadrTaRb">news:f15b81f.8@WebX.maYIadrTaRb...
don't mind doing the conversion to EV's paper units. I just don't have enough
information to go from the information in the dwf, like drawing units, to
whatever EV's 'paper units' represent. Can you provide any information about
how paper units are calculated so I can convert my coordinates to paper
units?
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <So,
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.10@WebX.maYIadrTaRb">news:f15b81f.10@WebX.maYIadrTaRb...
essentially this is a useless external api function because it relies on
internal units that cannot be known to the external api
caller?
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <You
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.12@WebX.maYIadrTaRb">news:f15b81f.12@WebX.maYIadrTaRb...
mean the non-existent tranform point api?
Paper units are, millimeters or
inches. You can ask the page what its units are (I provided an example below).
If you produced the dwf then you
know the scale. If the drawing is in feet and the layout scale is 2:1 you know
that 6 inches in paper space (or page units) is equal to 1 foot. I hope
this will work for you.
At the same time we understand
the need for a more programmatic solution and it is on the way.
size=2>
size=2>function ShowPageUnits()
{
AdView.Viewer.WaitForPageLoaded();
if ( AdView.Viewer.Page.Paper.Units
== 1 )
alert("Inches");
else
if ( AdView.Viewer.Page.Paper.Units == 2 )
alert("Millimeters");
size=2>
size=2> else if ( AdView.Viewer.Page.Paper.Units == 0
)
alert("Unknown");
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Jeffrey Klug (Autodesk)" <jeffrey dot klug at autodesk dot com>
wrote in message
href="news:ED68917E8F7A019375F9D89FD6EBFAAF@in.WebX.maYIadrTaRb">news:ED68917E8F7A019375F9D89FD6E......
Um, yeah.
It's implemented in the next service pack, due
very soon.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <You
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote
in message
href="news:f15b81f.12@WebX.maYIadrTaRb">news:f15b81f.12@WebX.maYIadrTaRb...
mean the non-existent tranform point
api?
Paper units are, millimeters or
inches. You can ask the page what its units are (I provided an example below).
If you produced the dwf then you
know the scale. If the drawing is in feet and the layout scale is 2:1 you know
that 6 inches in paper space (or page units) is equal to 1 foot. I hope
this will work for you.
At the same time we understand
the need for a more programmatic solution and it is on the way.
size=2>
size=2>function ShowPageUnits()
{
AdView.Viewer.WaitForPageLoaded();
if ( AdView.Viewer.Page.Paper.Units
== 1 )
alert("Inches");
else
if ( AdView.Viewer.Page.Paper.Units == 2 )
alert("Millimeters");
size=2>
size=2> else if ( AdView.Viewer.Page.Paper.Units == 0
)
alert("Unknown");
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"hmp" <So,
href="mailto:mr.humphrey@verizon.net">mr.humphrey@verizon.net> wrote in
message
href="news:f15b81f.10@WebX.maYIadrTaRb">news:f15b81f.10@WebX.maYIadrTaRb...
essentially this is a useless external api function because it relies on
internal units that cannot be known to the external api
caller?