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

Cycling through each layer in a .dwf with VB

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

Cycling through each layer in a .dwf with VB

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

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

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

Thanks, I really appreciate your help, the API help file Autodesk supplies is terrible.

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

Post to forums  

Autodesk Design & Make Report