Effective Output


Emojis 🥳

You can easily print emojis to the output window using the :emoji-shorthand: convention. To see all the shorthand options, launch the Emoji tool under pyRevit slideout.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ca1ce2e2-22ca-40c4-9bad-1de4d0baa137/2019-08-29_23_29_49-.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/500bfabb-9590-46cb-87dc-a5ce23a15ee9/2019-08-29_23_30_13-Window.png

Use the codes printed on the output for each emoji. For example the code below prints 👌

print(':OK_hand:')

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0faa171b-60f0-41fb-adac-c98c1fa244e3/2019-08-29_23_31_50-Window.png

Emojis are a feature of the output window so they are supported from any language or script that prints to the output window

Console.WriteLine(":OK_hand:");

Creating Clickable Element Links

The link maker from the output object, can be used to create clickable links on the output window. See documentation here.

from pyrevit import script

output = script.get_output()

# assuming element is an instance of DB.Element
print(output.linkify(element.Id))

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4158f78b-bc12-4eca-9b50-a04a6d6c524f/2019-08-28_11_20_22-List_Selection_as_Clickable_Links.png

Printing Tables

The table maker from the output object, can be used to create tables on the output window. See documentation here.

from pyrevit import script

output = script.get_output()

data = [['结构', '结构', '结构结构', 80],
        ['结构', '结构', '结构', 45],
        ['row3', 'data', 'data', 45],
        ['结构结构', 'data', '结构', 45]]

# formats contains formatting strings for each column
# last_line_style contains css styling code for the last line
output.print_table(table_data=data,
                   title="Example Table",
                   columns=["Row Name", "Column 1", "Column 2", "Percentage"],
                   formats=['', '', '', '{}%'],
                   last_line_style='color:red;')

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b3dbe589-2d1d-4632-bd7c-5d10f1aca7e8/2019-08-28_11_23_54-Output_Tests.png