How to use this function?

I want to add this info panel, I check the doc, it writes:

  • info_panel ( bool , optional ) – show information panel and fill with .description property of item

but I dont know how to add it

This was built specifically for the preflight checks tool
It grabs the description of the check:

from pyrevit import forms
selection = forms.SelectFromList.show([1,2,3,4],info_panel = True)

infopanel

This will work up to a point → showing the info panel when one of the number is selected, but by design it will require that the list of elements passed contains a description

Like in one of the model checker check https://github.com/eirannejad/pyRevit/blob/4b84aa1bf6608d9a5f6c023d4446006a7a5dbcfd/extensions/pyRevitTools.extension/checks/modelchecker_check.py#L1212

I saw the code too, but I don’t know how to pass a description to those element :frowning:

I use it as is only for preflight checks. I cannot help much more. Sorry.

So the list of elements need to be Classes and the description is contained in the triple quote comment “”" description here “”"

Not sure if you’re able to wrap what’s in your list in a Class, but that seems to be the way to go.

@newshunhk pyRevit form will call getattr(item, 'description', '') on the items passed to the dialog to see if it has a description property and attempts to get its value. So simply, passing a set of tuples with description property would do the job