DWF Viewer

DWF Viewer

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

Cycling through each layer in a .dwf with VB

109 Views, 3 Replies
04-08-2003 06:11 AM
Can someone post sample code to cycle through each layer in a dwf using something like a For to Next statement in VB. I've been looking forever. I found sample code in this forum; "for each layer in AdView.Viewer.Layers" but it doesn't work. Thanks
Contributor
TimL
Posts: 11
Registered: ‎04-10-2003
Message 2 of 4 (109 Views)

Re: Cycling through each layer in a .dwf with VB

04-08-2003 11:15 AM in reply to: TimL
Playing with the code It seams if I use a msgbox statement between loading the source file and the code to cycle through each layer, the code that I said above doesn't work does. I remember reading about a waituntilpageload method in the api help file. When I look at the VBA sample though it doesn't list a call to this method, just some code to turn off the tool bar. I looked in the object browser but didn't find any reference to the waituntilpageload method there either. I tried using the sample code to turn off the toolbar, but that had no effect.

Am I missing something??
*Bob
Message 3 of 4 (109 Views)

Re: Cycling through each layer in a .dwf with VB

04-08-2003 09:13 PM in reply to: TimL
Dim viewer As IAdPageViewer
Dim layer As CLayer

CAdViewer1.SourcePath = "c:\????" 'Set to dwf

Set viewer = CAdViewer1.viewer
viewer.WaitForPageLoaded

For Each layer In viewer.Layers
Debug.Print layer.Name
Next



"TimL" wrote in message news:f156a11.-1@WebX.maYIadrTaRb...
> Can someone post sample code to cycle through each layer in a dwf using
something like a For to Next statement in VB. I've been looking forever. I
found sample code in this forum; "for each layer in AdView.Viewer.Layers"
but it doesn't work. Thanks
Contributor
TimL
Posts: 11
Registered: ‎04-10-2003
Message 4 of 4 (109 Views)

Re:

04-08-2003 11:33 PM in reply to: TimL
Thanks, I really appreciate your help, the API help file Autodesk supplies is terrible.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.