• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk DWF Viewer

    Reply
    Contributor
    Posts: 11
    Registered: ‎04-10-2003

    Cycling through each layer in a .dwf with VB

    100 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
    Please use plain text.
    Contributor
    Posts: 11
    Registered: ‎04-10-2003

    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??
    Please use plain text.
    *Bob

    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
    Please use plain text.
    Contributor
    Posts: 11
    Registered: ‎04-10-2003

    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.
    Please use plain text.