Esempio n. 1
0
    def __init__(self, elements):

        out = output.get_output()
        self.info = []

        for element in elements:

            dependents = []

            for dep in _(element).getDependent():
                depFamType = revitron.Parameter(
                    dep, 'Family and Type').getValueString()
                depInfo = '{} {}, {}'.format(out.linkify(dep.Id),
                                             _(dep).getCategoryName(),
                                             depFamType).strip(', ')
                depInfo = depInfo + '<br>'
                dependents.append(depInfo)

            self.info.append([
                out.linkify(element.Id),
                _(element).getClassName(),
                _(element).getCategoryName(),
                revitron.Parameter(element,
                                   'Family and Type').getValueString(),
                ''.join(dependents)
            ])
Esempio n. 2
0
def get_output():
    """Return object wrapping output window for current script.

    Returns:
        :obj:`pyrevit.output.PyRevitOutputWindow`: Output wrapper object
    """
    return output.get_output()
Esempio n. 3
0
    def show(self, title=''):

        out = output.get_output()
        out.print_table(
            self.info,
            title=title,
            columns=['ID', 'Class', 'Category', 'Family / Type', 'Dependent'])
Esempio n. 4
0
def _clear_running_engines():
    # clear the cached engines
    try:
        my_output = output.get_output()
        if my_output:
            my_output.close_others(all_open_outputs=True)

        EXEC_PARAMS.engine_mgr.ClearEngines()
    except AttributeError:
        return False
Esempio n. 5
0
def _clear_running_engines():
    # clear the cached engines
    try:
        my_output = output.get_output()
        if my_output:
            my_output.close_others(all_open_outputs=True)

        runtime_types.ScriptEngineManager.ClearEngines(
            excludeEngine=EXEC_PARAMS.engine_id)
    except AttributeError:
        return False
Esempio n. 6
0
from pyrevit import script
from pyrevit import output

now = datetime.datetime.now()
parent = os.path.dirname 
html = """<h1>Revitron</h1>
Library {} &mdash; UI {}

A Revit API wrapper for pyRevit written in Python.
Check out the <a href="https://revitron-ui.readthedocs.io/">user guide</a>, the <a href="https://revitron.readthedocs.io/">API reference</a>
and <a href="https://github.com/revitron">GitHub</a> for more infos.

<small>&copy; Copyright 2020-{}, Marc Anton Dahmen &mdash; MIT license
All icons except for the Revitron logo by <a href="https://icons8.com">Icons8</a></small>"""

svg = parent(parent(parent(parent(__file__)))) + '/svg/revitron-about.svg'

style = """
body {background-color: #2c3e50; color: #ffffff; text-align: center;}
a {color: inherit;}
img {max-width: 28rem;} 
span {display: block; text-align: center;}
small {display: block; color: #959ea7; padding-top: 2rem;}
"""
output.get_output().add_style(style)
output.get_output().set_width(500)
output.get_output().set_height(500)
out = script.get_output()
out.print_image(svg)
out.print_html(html.format(REVITRON_VERSION, REVITRON_UI_VERSION, now.year))
Esempio n. 7
0
 def setUp(self):
     self._output = get_output()
Esempio n. 8
0
 def __init__(self):
     self._output = get_output()
Esempio n. 9
0
import revitron
from pyrevit import script
from pyrevit import output

__context__ = 'zero-doc'

style = 'body {padding: 20px 40px; color: #121212;} img {max-width: 500px; padding-bottom: 20px} span {display: block; text-align: center;}'
output.get_output().add_style(style)
output.get_output().set_width(510)
output.get_output().set_height(510)
output.get_output().center()
out = script.get_output()
out.print_image(revitron.LIB_DIR + '/svg/revitron-readme.svg')
out.print_html('<h2>Revitron</h2>A Revit API wrapper written in Python.<br>' +\
 'Check out the <a href="https://revitron-ui.readthedocs.io/">documentation</a>, ' +\
    'the <a href="https://revitron.readthedocs.io/">API reference</a><br>' +\
    'and the repositories on <a href="https://github.com/revitron">GitHub</a> for more infos.<br><br>' +\
    '&copy; Copyright 2020, Marc Anton Dahmen &mdash; MIT license<br>' +\
    'All icons except for the Revitron logo by <a href="https://icons8.com">Icons8</a>')