DWF Viewer (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Views via VBA

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
303 Views, 3 Replies

Changing Views via VBA

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.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

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"
Message 3 of 4
Anonymous
in reply to: Anonymous

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"
Message 4 of 4
Anonymous
in reply to: Anonymous

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"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report