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
from functools import wraps | |
def errors_swallower(errors_to_swallow=None): | |
"""Swallows provided types of errors. Or all, if nothing provided.""" | |
if errors_to_swallow is None: | |
errors_to_swallow = BaseException, | |
def decorator(func): | |
@wraps(func) |
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
#Copyright(c) 2016, Dimitar Venkov | |
# @5devene, dimitar.ven@gmail.com | |
import clr | |
import System | |
from System.Collections.Generic import * | |
from itertools import repeat | |
pf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) |
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
def is_p1_smaller_p2(p1, p2): | |
# type: (Point, Point) -> bool | |
"""Is p1 < p2? | |
use first method from here: | |
https://math.stackexchange.com/a/54657 | |
x1 < x2 | |
or | |
x1 = x2 and y1 < y2 | |
or | |
x1 = x2 and y1 = y2 and z1 < z2 |
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
import timeit | |
mysetup = """ | |
import clr | |
from random import randint | |
clr.AddReference("RevitNodes") | |
import Revit | |
clr.ImportExtensions(Revit.Elements) | |
clr.ImportExtensions(Revit.GeometryConversion) |
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
# Based on SelectLinkedFace and SelectFaces+ from Springs | |
# Copyright(c) 2017, Dimitar Venkov | |
# @5devene, dimitar.ven@gmail.com | |
# www.badmonkeys.net | |
import clr | |
clr.AddReference("RevitAPIUI") | |
from Autodesk.Revit.UI import * |