DWF Viewer

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

Changing Views via VBA

102 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 (102 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 (102 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 (102 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"

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!