DWF Viewer

Reply
Contributor
11 Posts
0 Kudos
Registered: ‎04-10-2003
Post 1 of 4

Changing Views via VBA

105 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
11 Posts
0 Kudos
Registered: ‎04-10-2003
Post 2 of 4

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
11 Posts
0 Kudos
Registered: ‎04-10-2003
Post 3 of 4

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"

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