-
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addition of Charts Core performance improvements Output window improvements (Removed 1023 cache limit)
- Loading branch information
Showing
25 changed files
with
233 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+142 Bytes
(100%)
...ns/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/About.pushbutton/keybase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed
BIN
+4.22 KB
...Revit.panel/About.pushbutton/keybasew.png → ...it.panel/About.pushbutton/keybase_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 0 additions & 69 deletions
69
extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/About.pushbutton/script.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...t.tab/pyRevit.panel/wip.stack3/Labs.pulldown/Test Engine Performance.pushbutton/script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import clr | ||
|
||
from pyrevit import PYTHON_LIB_DIR, MAIN_LIB_DIR | ||
from pyrevit.coreutils import Timer | ||
|
||
from scriptutils import this_script | ||
|
||
clr.AddReference('System') | ||
clr.AddReference('IronPython') | ||
# noinspection PyUnresolvedReferences | ||
from System.Collections.Generic import List | ||
# noinspection PyUnresolvedReferences | ||
import IronPython.Hosting | ||
import IronPython.Runtime | ||
|
||
|
||
TEST_UNIT = 100 | ||
MAX_TESTS = 5 * TEST_UNIT | ||
script = "import random; random.randint(1,10)" | ||
|
||
|
||
def run(engine, runtime): | ||
scope = runtime.CreateScope() | ||
co = engine.GetCompilerOptions(scope) | ||
# co.Module &= ~IronPython.Runtime.ModuleOptions.Optimized | ||
source = engine.CreateScriptSourceFromString(script) | ||
comped = source.Compile() | ||
comped.Execute(scope) | ||
|
||
|
||
def make_engine(): | ||
options = {"Frames": True, "FullFrames": True, "LightweightScopes": True} | ||
engine = IronPython.Hosting.Python.CreateEngine(options) | ||
engine.SetSearchPaths(List[str]([PYTHON_LIB_DIR, MAIN_LIB_DIR])) | ||
runtime = engine.Runtime | ||
return engine, runtime | ||
|
||
|
||
def shutdown(runtime): | ||
runtime.Shutdown() | ||
|
||
|
||
engine_times = [] | ||
output_times = [] | ||
|
||
for idx in range(1, MAX_TESTS): | ||
engine, runtime = make_engine() | ||
engine_timer = Timer() | ||
run(engine, runtime) | ||
eng_time = engine_timer.get_time() | ||
shutdown(runtime) | ||
engine_times.append(eng_time) | ||
|
||
output_timer = Timer() | ||
print('Engine {}: {}'.format(idx, eng_time)) | ||
output_times.append(output_timer.get_time()) | ||
|
||
|
||
chart = this_script.output.make_line_chart() | ||
# chart.options.scales = {'xAxes': [{'ticks': {'fixedStepSize': 5}, 'type': 'category', 'position': 'bottom'}], | ||
# 'yAxes': [{'ticks': {'fixedStepSize': 10}}]} | ||
|
||
chart.data.labels = [x for x in range(0, MAX_TESTS + 1)] | ||
|
||
engine_dataset = chart.data.new_dataset('engine_timer') | ||
engine_dataset.set_color(0xc3, 0x10, 0x10, 0.4) | ||
engine_dataset.data = engine_times | ||
|
||
output_dataset = chart.data.new_dataset('output_timer') | ||
output_dataset.set_color(0xf0, 0xa7, 0x19, 0.4) | ||
output_dataset.data = output_times | ||
|
||
chart.draw() |
35 changes: 35 additions & 0 deletions
35
...vit.tab/pyRevit.panel/wip.stack3/WIP Tools.pulldown/Graph Area Types.pushbutton/script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Display the total area of different area types in a graph.""" | ||
|
||
from scriptutils import this_script | ||
from revitutils import doc, selection | ||
|
||
# noinspection PyUnresolvedReferences | ||
from Autodesk.Revit.DB import FilteredElementCollector, ElementId, BuiltInCategory, Area | ||
|
||
|
||
areas = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Areas)\ | ||
.WhereElementIsNotElementType().ToElements() | ||
|
||
|
||
total = dict() | ||
for area in areas: | ||
try: | ||
area_type = area.LookupParameter('Area Type').AsValueString() | ||
if area_type.lower() != '(none)': | ||
if area_type in total: | ||
total[area_type] += area.Area | ||
else: | ||
total[area_type] = area.Area | ||
except: | ||
continue | ||
|
||
this_script.output.set_width(400) | ||
this_script.output.set_height(450) | ||
|
||
chart = this_script.output.make_pie_chart() | ||
chart.data.labels = total.keys() | ||
area_dataset = chart.data.new_dataset('area types') | ||
area_dataset.data = [round(v, 2) for v in total.values()] | ||
|
||
chart.randomize_colors() | ||
chart.draw() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+614 Bytes
...tion.panel/select.stack3/Select.pulldown/Add Group Elements.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+578 Bytes
...ion.panel/select.stack3/Select.pulldown/Add Tagged Elements.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+440 Bytes
(240%)
...tack3/Select.pulldown/Find And Select Entities Without Tags.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+686 Bytes
...ct.stack3/Select.pulldown/List Selection as Clickable Links.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.