-
-
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.
After a week of cleaning up, decided to create a private rep and perform an initial commit.
- Loading branch information
1 parent
925c91b
commit bc8e6d7
Showing
190 changed files
with
3,117 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+709 Bytes
0000_pyRevit_PushButton_pyShell_RevitPythonShell_IronPythonConsoleCommand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# from Autodesk.Revit.DB import * | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
|
||
for el in uidoc.Selection.Elements: | ||
# print( el.GeometryCurve.EndPoint[0][2] ) | ||
# print( el.GeometryCurve.EndPoint[1][2] ) | ||
print( el.GeometryCurve.GetEndPoint(0) ) | ||
print( el.GeometryCurve.GetEndPoint(1) ) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# from Autodesk.Revit.DB import * | ||
# from Autodesk.Revit.DB.Architecture import * | ||
# from Autodesk.Revit.DB.Analysis import * | ||
# import Autodesk.Revit.UI | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
total = 0.0 | ||
for i in selection: | ||
total += i.Parameter['Area'].AsDouble() | ||
print("TOTAL AREA OF ALL SELECTED ELEMENTS IS: {0}".format(total)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from Autodesk.Revit.DB import CurveElement | ||
# from Autodesk.Revit.DB.Architecture import * | ||
# from Autodesk.Revit.DB.Analysis import * | ||
# import Autodesk.Revit.UI | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
def isline( line ): | ||
return isinstance( line, CurveElement ) | ||
|
||
total = 0.0 | ||
lines = [] | ||
|
||
print("PROCESSING TOTAL OF {0} OBJECTS:\n\n".format( len( selection ))) | ||
|
||
for i, el in enumerate(selection): | ||
if isline( el ): | ||
lines.append( el ) | ||
total += el.LookupParameter('Length').AsDouble() | ||
print("TOTAL LENGTH OF ALL SELECTED ELEMENTS IS: {0}\n\n\n".format( total )) | ||
|
||
#group lines per line style | ||
linestyles = {} | ||
for l in lines: | ||
if l.LineStyle.Name in linestyles: | ||
linestyles[ l.LineStyle.Name ].append( l ) | ||
else: | ||
linestyles[ l.LineStyle.Name ] = [ l ] | ||
|
||
for k in sorted( linestyles.keys() ): | ||
linestyletotal = 0.0 | ||
for l in linestyles[k]: | ||
linestyletotal += l.LookupParameter('Length').AsDouble() | ||
print("- LINES OF STYLE {0} -\nTOTAL LENGTH : {1}\n\n".format( k, linestyletotal )) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# from Autodesk.Revit.DB import * | ||
# from Autodesk.Revit.DB.Architecture import * | ||
# from Autodesk.Revit.DB.Analysis import * | ||
# import Autodesk.Revit.UI | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
total = 0.0 | ||
for i in selection: | ||
total += i.Parameter['Volume'].AsDouble() | ||
print("TOTAL VOLUME OF ALL SELECTED ELEMENTS IS: {0}".format(total)) |
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 @@ | ||
print('WIP') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from Autodesk.Revit.DB import ModelPathUtils | ||
doc = __revit__.ActiveUIDocument.Document | ||
|
||
if doc.GetWorksharingCentralModelPath(): | ||
print(ModelPathUtils.ConvertModelPathToUserVisiblePath(doc.GetWorksharingCentralModelPath())) | ||
else: | ||
print("Model is not work-shared.") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__window__.Close() | ||
import os | ||
os.system('start mailto:[email protected]?subject=BIM - ') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__window__.Close() | ||
import os | ||
os.system('start http://intranet.lrsarchitects.com/wiki/index.php/BIM_Family_Tools') |
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,3 @@ | ||
__window__.Close() | ||
import os | ||
os.system('start http://regexr.com/') |
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,31 @@ | ||
''' Gets a subfolder name on user desktop and removes the ! in filenames.''' | ||
import os, sys | ||
import os.path as op | ||
|
||
global globalVerbose | ||
sheetcount = 0 | ||
filecount = 0 | ||
|
||
if verbose: | ||
globalVerbose = True | ||
|
||
desktop = op.expandvars('%userprofile%\\desktop') | ||
basefolder = op.join(desktop, 'Cleanup') | ||
|
||
def cleanupFileName( file ): | ||
if '!' == file[0]: | ||
return file[1:] | ||
else: | ||
return False | ||
|
||
for dirname, dirnames, filenames in os.walk( basefolder ): | ||
for file in filenames: | ||
filecount += 1 | ||
newfile = cleanupFileName(file) | ||
if newfile: | ||
try: | ||
os.rename(op.join(dirname, file), op.join(dirname, newfile)) | ||
sheetcount+=1 | ||
except: | ||
print("Unexpected error:", sys.exc_info()[0]) | ||
print('{0} FILES PROCESSED - {1} FILES RENAMED.'.format( filecount, sheetcount)) |
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,19 @@ | ||
''' Gets a subfolder name on user desktop and moves all the files in its subdirectories to the roof directory (flattening).''' | ||
import os, sys, shutil | ||
import os.path as op | ||
|
||
sheetcount = 0 | ||
filecount = 0 | ||
|
||
desktop = op.expandvars('%userprofile%\\desktop') | ||
basefolder = op.join(desktop, 'Flatten') | ||
|
||
for dirname, dirnames, filenames in os.walk( basefolder ): | ||
for file in filenames: | ||
filecount += 1 | ||
try: | ||
shutil.move( op.join(dirname, file), op.join(basefolder, file)) | ||
sheetcount+=1 | ||
except: | ||
print("Unexpected error:", sys.exc_info()[0]) | ||
print('{0} FILES PROCESSED - {1} FILES RENAMED.'.format( filecount, sheetcount)) |
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,12 @@ | ||
import sys, os | ||
folder = os.path.dirname(__file__) | ||
print('Home directory of this script:\n{0}\n'.format( folder )) | ||
|
||
sys.path.append(folder) | ||
|
||
import pyRevit | ||
print('pyRevit import successful\n') | ||
|
||
print('Printing sys.path addresses:') | ||
for p in sys.path: | ||
print(p) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
''' Creates all base architectural folders for sheets per LRS Standard''' | ||
import os, sys | ||
import os.path as op | ||
|
||
basefolder = op.expandvars('%userprofile%\\desktop') | ||
|
||
archFolders = [ | ||
'A000 - CODE', | ||
'A100 - SITE', | ||
'A200 - PLANS', | ||
'A300 - ROOF', | ||
'A400 - RCP', | ||
'A500 - ELEVATIONS', | ||
'A600 - SECTIONS', | ||
'A700 - DOORS & WINDOWS', | ||
'A800 - INTERIOR', | ||
'A9000 - DET CODE', | ||
'A9100 - DET SITE', | ||
'A9200 - DET PLAN', | ||
'A9300 - DET ROOF', | ||
'A9400 - DET RCP', | ||
'A9500 - DET EXTERIOR', | ||
'A9600 - DET SECTIONS', | ||
'A9700 - DET DOORS & WINDOWS', | ||
'A9800 - DET INTERIOR', | ||
] | ||
|
||
for d in archFolders: | ||
os.mkdir(op.join(basefolder, d)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__window__.Close() | ||
import os | ||
os.system('start https://icons8.com/web-app/new-icons/color') |
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,28 @@ | ||
''' Rename Revit output PDFs on user desktop to remove the project name from file name.''' | ||
import os, sys | ||
import os.path as op | ||
|
||
basefolder = op.expandvars('%userprofile%\\desktop') | ||
sheetcount = 0 | ||
|
||
def renamePDF( file ): | ||
import re | ||
r = re.compile('(?<=Sheet - )(.+)') | ||
fname = r.findall(file)[0] | ||
r = re.compile('(.+)\s-\s(.+)') | ||
fnameList= r.findall(fname) | ||
return fnameList[0][0] + ' - ' + fnameList[0][1].upper() | ||
|
||
# for dirname, dirnames, filenames in os.walk( basefolder ): | ||
filenames = os.listdir( basefolder ) | ||
for file in filenames: | ||
ext = op.splitext(file)[1].upper() | ||
if ext == '.PDF' and ('Sheet' in file): | ||
newfile = renamePDF(file) | ||
try: | ||
os.rename( op.join( basefolder, file ), op.join( basefolder, newfile )) | ||
sheetcount+=1 | ||
except: | ||
print("Unexpected error:", sys.exc_info()[0]) | ||
|
||
print('{0} FILES RENAMED.'.format(sheetcount)) |
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,7 @@ | ||
from Autodesk.Revit.DB import DetailElementOrderUtils as eo | ||
|
||
with Transaction(doc,"Bring Selected To Front") as t: | ||
t.Start() | ||
for el in selection: | ||
eo.BringForward(doc, doc.ActiveView, el.Id) | ||
t.Commit() |
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,17 @@ | ||
from Autodesk.Revit.DB import * | ||
# from Autodesk.Revit.DB.Architecture import * | ||
# from Autodesk.Revit.DB.Analysis import * | ||
# import Autodesk.Revit.UI | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
# id = uidoc.Selection.PickObject(ObjectType.Element,"Select an element").ElementId | ||
with Transaction(doc,"Set Element Override") as t: | ||
t.Start() | ||
for el in selection: | ||
ogs = OverrideGraphicSettings() | ||
ogs.SetProjectionLineStyleId() | ||
doc.ActiveView.SetElementOverrides(el.Id, ogs); | ||
t.Commit() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
''' | ||
exportImage.py | ||
Export the currently visible view as a PNG image to a location specified by the user. | ||
''' | ||
|
||
import clr | ||
clr.AddReference('RevitAPI') | ||
clr.AddReference('RevitAPIUI') | ||
from Autodesk.Revit.DB import * | ||
|
||
doc = __revit__.ActiveUIDocument.Document | ||
|
||
# collect file location from user | ||
clr.AddReference('System.Windows.Forms') | ||
from System.Windows.Forms import DialogResult, SaveFileDialog | ||
dialog = SaveFileDialog() | ||
dialog.Title = 'Export current view as PNG' | ||
dialog.Filter = 'PNG files (*.PNG)|*.PNG' | ||
|
||
if dialog.ShowDialog() == DialogResult.OK: | ||
# set up the export options | ||
options = ImageExportOptions() | ||
options.ExportRange = ExportRange.VisibleRegionOfCurrentView | ||
options.FilePath = dialog.FileName | ||
options.HLRandWFViewsFileType = ImageFileType.PNG | ||
options.ImageResolution = ImageResolution.DPI_72 | ||
options.ZoomType = ZoomFitType.Zoom | ||
options.ShadowViewsFileType = ImageFileType.PNG | ||
|
||
doc.ExportImage(options) | ||
|
||
__window__.Close() |
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,20 @@ | ||
from Autodesk.Revit.DB import Transaction | ||
from Autodesk.Revit.DB import OverrideGraphicSettings | ||
from Autodesk.Revit.DB import Group | ||
|
||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
__window__.Close() | ||
|
||
with Transaction(doc,"Set Element Override") as t: | ||
t.Start() | ||
for el in selection: | ||
if isinstance(el, Group): | ||
for mem in el.GetMemberIds(): | ||
selection.append(doc.GetElement(mem)) | ||
ogs = OverrideGraphicSettings() | ||
ogs.SetHalftone(True) | ||
ogs.SetProjectionFillPatternVisible(False) | ||
doc.ActiveView.SetElementOverrides(el.Id, ogs); | ||
t.Commit() |
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,16 @@ | ||
__window__.Close() | ||
from Autodesk.Revit.DB import * | ||
# from Autodesk.Revit.DB.Architecture import * | ||
# from Autodesk.Revit.DB.Analysis import * | ||
# import Autodesk.Revit.UI | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
with Transaction(doc,"Set Element Override") as t: | ||
t.Start() | ||
for el in selection: | ||
ogs = OverrideGraphicSettings() | ||
doc.ActiveView.SetElementOverrides(el.Id, ogs) | ||
t.Commit() |
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,14 @@ | ||
from Autodesk.Revit.DB import Transaction | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
|
||
__window__.Close() | ||
|
||
t = Transaction(doc, 'EQ dimensions') | ||
t.Start() | ||
|
||
for el in uidoc.Selection.Elements: | ||
el.ValueOverride = 'EQ' | ||
|
||
t.Commit() |
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,17 @@ | ||
from Autodesk.Revit.DB import Transaction | ||
from Autodesk.Revit.DB import OverrideGraphicSettings | ||
from Autodesk.Revit.DB import LinePatternElement | ||
|
||
__window__.Close() | ||
|
||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
with Transaction(doc,"Set Element to Solid Projection Line Pattern") as t: | ||
t.Start() | ||
for el in selection: | ||
if el.ViewSpecific: | ||
ogs = OverrideGraphicSettings() | ||
ogs.SetProjectionLinePatternId( LinePatternElement.GetSolidPatternId() ) | ||
doc.ActiveView.SetElementOverrides(el.Id, ogs); | ||
t.Commit() |
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,22 @@ | ||
from Autodesk.Revit.DB import * | ||
# from Autodesk.Revit.DB.Architecture import * | ||
# from Autodesk.Revit.DB.Analysis import * | ||
# import Autodesk.Revit.UI | ||
|
||
uidoc = __revit__.ActiveUIDocument | ||
doc = __revit__.ActiveUIDocument.Document | ||
selection = list(__revit__.ActiveUIDocument.Selection.Elements) | ||
|
||
# id = uidoc.Selection.PickObject(ObjectType.Element,"Select an element").ElementId | ||
with Transaction(doc,"Set Element Override") as t: | ||
t.Start() | ||
for el in selection: | ||
if el.ViewSpecific: | ||
continue | ||
elif isinstance(el, Group): | ||
for mem in el.GetMemberIds(): | ||
selection.append(doc.GetElement(mem)) | ||
ogs = OverrideGraphicSettings() | ||
ogs.SetProjectionLineColor(Color(255,255,255)) | ||
doc.ActiveView.SetElementOverrides(el.Id, ogs); | ||
t.Commit() |
Oops, something went wrong.
Oops, something went wrong.