DWF Viewer

Reply
Contributor
TimL
Posts: 11
Registered: ‎04-10-2003
Message 1 of 4 (97 Views)

Changing Views via VBA

97 Views, 3 Replies
04-02-2003 03:34 AM
I've created a form with the EV control. I'm able to load a drawing, toggle layers on and off, I stumped when it comes to switching views via code. I have named views that were created in AutoCAD r14, they appear when I click the layer button in the control, I just can't do it through VBA code. I've looked through the help files and found an example on how to cycle through each of the view names, but not how to change to a view.
Contributor
TimL
Posts: 11
Registered: ‎04-10-2003
Message 2 of 4 (97 Views)

Re: Changing Views via VBA

04-02-2003 04:35 AM in reply to: TimL
I found it, its not very obvious (at least not to me) based on the help files.


Dim Viewer As AdPageView.IAdPageViewer
Set Viewer = CAdViewer1.Viewer
Viewer.[_View] = "LAB1"
Contributor
TimL
Posts: 11
Registered: ‎04-10-2003
Message 3 of 4 (97 Views)

Re:

04-02-2003 04:41 AM in reply to: TimL
and of course none of the above post make sense because the HTTP interface. Let me try one more time;

Line1 Dim Viewer As AdPageView.IAdPageViewer
Line2 Set Viewer = CAdViewer1.Viewer
Line3 Viewer.[_View] = "PutNameHere"
*raot
Message 4 of 4 (97 Views)

Re:

04-02-2003 04:11 PM in reply to: TimL
Here is a sample code:

 

Private Sub Command1_Click()
   
Dim viewer As IAdPageViewer
    Set viewer =
CAdViewer1.viewer
    

    'Set the view
current.
    viewer.view = viewer.NamedViews("v1")
End
Sub

 

Private Sub Form_Load()
   
CAdViewer1.SourcePath = "C:/dwf.dwf"
End Sub

 

 

If you are embedding in an html page and wish to
pass it as a parameter then do as follows:

http://tmp.dwf?namedview="v1"

 

cheers,

thilak

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
and
of course none of the above post make sense because the HTTP interface. Let me
try one more time;

Line1 Dim Viewer As AdPageView.IAdPageViewer
Line2 Set Viewer =
CAdViewer1.Viewer
Line3 Viewer.[_View] =
"PutNameHere"

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.