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 sys | |
if sys.version_info >= (3, 0): | |
sys.stdout.write("Sorry, requires Python 2.x, not Python 3.x\n") | |
sys.exit(1) |
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
# bash/zsh git prompt support | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
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
# bash/zsh git prompt support | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
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 tree(): | |
return defaultdict(tree) | |
Adding a simple subclass allows attribute like selection: | |
class mydefaultdict(defaultdict): | |
def __getattr__(self, attr): | |
return self[attr] | |
def __setattr__(self, attr, val): | |
self[attr] = val |
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
""" | |
SelectDoors | |
Selects All Door Instances | |
TESTED REVIT API: 2015 | 2016 | |
Gui Talarico | |
""" | |
from Autodesk.Revit.UI import TaskDialog | |
from Autodesk.Revit.DB import FilteredElementCollector | |
from Autodesk.Revit.DB import BuiltInCategory, ElementId |
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
''' Creates a Drafting View''' | |
from Autodesk.Revit.DB import Transaction, Element | |
from Autodesk.Revit.DB import FilteredElementCollector | |
# Drafting Views | |
from Autodesk.Revit.DB import ViewFamilyType, ViewDrafting, Element | |
from Autodesk.Revit.DB import ViewFamily | |
uidoc = __revit__.ActiveUIDocument | |
doc = __revit__.ActiveUIDocument.Document |
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 Gui Talarico | |
Base script taken from pyRevit Respository. | |
pyRevit Notice | |
################################################################# | |
See this link for a copy of the GNU General Public License protecting this package. | |
https://github.com/eirannejad/pyRevit/blob/master/LICENSE | |
""" |
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
""" | |
RemoveUnderlay | |
Removes Underlay From Selected Views. | |
TESTED REVIT API: 2015 | 2016 | |
Copyright (c) 2014-2016 Gui Talarico | |
This script is part of PyRevitPlus: Extensions for PyRevit | |
github.com/gtalarico |
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
''' Example of a Transaction Decorator function. | |
This allows you to create functions that make changes to the revit document | |
without having to repeat the code to start/commit transactions. | |
Just add the revit_transaction decorator and a transaction will be started before | |
your function is called, and then commit after the call.''' | |
from functools import wraps | |
from Autodesk.Revit.Exceptions import InvalidOperationException | |
def revit_transaction(transaction_name): |
OlderNewer