Workaround for Python's "DetailNames" method


#1

I’m in need of this method for one of my script conversions to Python, but I just noticed that it’s not implemented yet. Has anyone found an effective workaround for it?

Thanks,

Dan


#2

Hi Dan,

I had to play around with this a little to “discover” it, but this works:

import scriptcontext as sc

page_views=sc.doc.Views.GetPageViews()
for page_view in page_views:
    det_views=page_view.GetDetailViews()
    for det_view in det_views:
        det_view_name=det_view.Viewport.Name
        print page_view.PageName, det_view_name

You can of course clean it up and adapt it as you need…

Cheers, --Mitch


#3

Thanks Mitch. I will work with this.