Skip to content

Commit a6f2ce8

Browse files
committed
Merge branch 'release/4.6.19'
2 parents 28d0db6 + 293ea28 commit a6f2ce8

File tree

28 files changed

+242
-78
lines changed

28 files changed

+242
-78
lines changed

README_CLI.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# pyRevit Command Line Tool Help
22

3-
##### Version 0.9.6.0
3+
##### Version 0.9.7.0
44

55
`pyrevit` is the command line tool, developed specifically to install and configure pyRevit in your production/development environment. Each section below showcases a specific set of functionality of the command line tool.
66

77
- [pyRevit Command Line Tool Help](#pyrevit-command-line-tool-help)
8-
- [Version 0.9.6.0](#version-0960)
8+
- [Version 0.9.7.0](#version-0970)
99
- [Getting Help](#getting-help)
1010
- [pyrevit CLI version](#pyrevit-cli-version)
1111
- [pyRevit Online Resources](#pyrevit-online-resources)

bin/pyRevitLabs.Common.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.Common.pdb

0 Bytes
Binary file not shown.

bin/pyRevitLabs.CommonCLI.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.CommonCLI.pdb

0 Bytes
Binary file not shown.

bin/pyRevitLabs.Language.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.Language.pdb

0 Bytes
Binary file not shown.

bin/pyRevitLabs.TargetApps.Revit.dll

0 Bytes
Binary file not shown.

bin/pyRevitUpdater.exe

512 Bytes
Binary file not shown.

bin/pyrevit.exe

0 Bytes
Binary file not shown.

bin/pyrevit.pdb

0 Bytes
Binary file not shown.

dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.8.7.0")]
36-
[assembly: AssemblyFileVersion("0.8.7.0")]
35+
[assembly: AssemblyVersion("0.8.8.0")]
36+
[assembly: AssemblyFileVersion("0.8.8.0")]

dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/RevitController.cs

+42-28
Original file line numberDiff line numberDiff line change
@@ -300,47 +300,47 @@ public class RevitProduct {
300300

301301
// 2008
302302
// https://www.revitforum.org/architecture-general-revit-questions/105-revit-builds-updates-product-support.html
303-
{"20070607_1700", ("Unknown", "2008 Architecture Service Pack 2")},
304-
{"20070810_1700", ("Unknown", "2008 Architecture Service Pack 2")},
305-
{"20080101_2345", ("Unknown", "2008 Architecture Service Pack 3")}, // https://forums.autodesk.com/t5/revit-architecture-forum/sp3-build-20080101-2345/td-p/2152807
303+
{"20070607_1700", ("0.0.0.0", "2008 Architecture Service Pack 2")},
304+
{"20070810_1700", ("0.0.0.0", "2008 Architecture Service Pack 2")},
305+
{"20080101_2345", ("0.0.0.0", "2008 Architecture Service Pack 3")}, // https://forums.autodesk.com/t5/revit-architecture-forum/sp3-build-20080101-2345/td-p/2152807
306306

307307
// 2009
308308
// https://www.revitforum.org/architecture-general-revit-questions/105-revit-builds-updates-product-support.html
309-
{"20080602_1900", ("Unknown", "2009 Architecture Service Pack 1")},
310-
{"20080915_2100", ("Unknown", "2009 Architecture Service Pack 2")},
311-
{"20081118_1045", ("Unknown", "2009 Architecture Service Pack 3")},
309+
{"20080602_1900", ("0.0.0.0", "2009 Architecture Service Pack 1")},
310+
{"20080915_2100", ("0.0.0.0", "2009 Architecture Service Pack 2")},
311+
{"20081118_1045", ("0.0.0.0", "2009 Architecture Service Pack 3")},
312312

313313
// 2010
314314
// https://www.revitforum.org/architecture-general-revit-questions/105-revit-builds-updates-product-support.html
315-
{"20090612_2115", ("Unknown", "2010 Architecture Service Pack 1")}, // https://forums.autodesk.com/t5/revit-architecture-forum/sp3-build-20080101-2345/td-p/2152807
316-
{"20090917_1515", ("Unknown", "2010 Architecture Service Pack 2")},
315+
{"20090612_2115", ("0.0.0.0", "2010 Architecture Service Pack 1")}, // https://forums.autodesk.com/t5/revit-architecture-forum/sp3-build-20080101-2345/td-p/2152807
316+
{"20090917_1515", ("0.0.0.0", "2010 Architecture Service Pack 2")},
317317

318318
// 2011
319-
{"20100326_1700", ("Unknown", "2011 Architecture")}, // http://forums.augi.com/showthread.php?138574-Revit-Architecture-Door-Centerline-not-selectable-during-dimensioning
320-
{"20100615_2115", ("Unknown", "2011 Architecture Service Pack 1")}, // http://revitclinic.typepad.com/my_weblog/2010/06/revit-2011-build-number-update-display.html
321-
{"20100903_2115", ("Unknown", "2011 Architecture Service Pack 2")}, // http://revitoped.blogspot.com/2010/09/revit-web-update-2-posted-subscription.html
319+
{"20100326_1700", ("0.0.0.0", "2011 Architecture")}, // http://forums.augi.com/showthread.php?138574-Revit-Architecture-Door-Centerline-not-selectable-during-dimensioning
320+
{"20100615_2115", ("0.0.0.0", "2011 Architecture Service Pack 1")}, // http://revitclinic.typepad.com/my_weblog/2010/06/revit-2011-build-number-update-display.html
321+
{"20100903_2115", ("0.0.0.0", "2011 Architecture Service Pack 2")}, // http://revitoped.blogspot.com/2010/09/revit-web-update-2-posted-subscription.html
322322

323323
// 2012
324324
// http://web.archive.org/web/20150123061214/https://knowledge.autodesk.com/support/revit-products/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-tie-the-Build-number-with-the-Revit-update.html
325-
{"20110309_2315", ("Unknown", "2012 First Customer Ship")},
326-
{"20110622_0930", ("Unknown", "2012 Update Release 1")},
327-
{"20110916_2132", ("Unknown", "2012 Update Release 2")},
325+
{"20110309_2315", ("0.0.0.0", "2012 First Customer Ship")},
326+
{"20110622_0930", ("0.0.0.0", "2012 Update Release 1")},
327+
{"20110916_2132", ("0.0.0.0", "2012 Update Release 2")},
328328

329329
// 2013
330330
// http://web.archive.org/web/20150123061214/https://knowledge.autodesk.com/support/revit-products/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-tie-the-Build-number-with-the-Revit-update.html
331331
{"20120221_2030", ("12.02.21203", "2013 First Customer Ship")},
332-
{"20120716_1115", ("Unknown", "2013 Update Release 1")},
333-
{"20121003_2115", ("Unknown", "2013 Update Release 2")},
334-
{"20130531_2115", ("Unknown", "2013 Update Release 3")},
335-
{"20120821_1330", ("Unknown", "2013 LT First Customer Ship")},
336-
{"20130531_0300", ("Unknown", "2013 LT Update Release 1")},
332+
{"20120716_1115", ("0.0.0.0", "2013 Update Release 1")},
333+
{"20121003_2115", ("0.0.0.0", "2013 Update Release 2")},
334+
{"20130531_2115", ("0.0.0.0", "2013 Update Release 3")},
335+
{"20120821_1330", ("0.0.0.0", "2013 LT First Customer Ship")},
336+
{"20130531_0300", ("0.0.0.0", "2013 LT Update Release 1")},
337337

338338
// 2014
339339
// tested on local machine
340340
{"20130308_1515", ("13.03.08151", "2014 First Customer Ship")},
341-
{"20130709_2115", ("Unknown", "2014 Update Release 1")},
342-
{"20131024_2115", ("Unknown", "2014 Update Release 2")},
343-
{"20140709_2115", ("Unknown", "2014 Update Release 3")},
341+
{"20130709_2115", ("0.0.0.0", "2014 Update Release 1")},
342+
{"20131024_2115", ("0.0.0.0", "2014 Update Release 2")},
343+
{"20140709_2115", ("13.11.00004", "2014 Update Release 3")}, //https://github.com/eirannejad/pyRevit/issues/543
344344

345345
// 2015
346346
{"20140223_1515", ("15.0.136.0", "2015 First Customer Ship")},
@@ -443,12 +443,26 @@ public override int GetHashCode() {
443443

444444
public Version Version {
445445
get {
446-
if (_revitBuildNumberLookupTable.ContainsKey(BuildNumber))
447-
return new Version(_revitBuildNumberLookupTable[BuildNumber].Item1);
448-
else if (RegisteredVersion != null || RegisteredVersion != string.Empty)
449-
return new Version(RegisteredVersion);
450-
else
451-
return null;
446+
// build version from build-number lookup
447+
if (_revitBuildNumberLookupTable.ContainsKey(BuildNumber)) {
448+
try {
449+
return new Version(_revitBuildNumberLookupTable[BuildNumber].Item1);
450+
}
451+
catch {
452+
}
453+
}
454+
455+
// otherwise build version from registry info if available
456+
if (RegisteredVersion != null || RegisteredVersion != string.Empty) {
457+
try {
458+
return new Version(RegisteredVersion);
459+
}
460+
catch {
461+
}
462+
}
463+
464+
// return none
465+
return null;
452466
}
453467
}
454468

dev/pyRevitLabs/pyRevitManager/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("0.9.6.0")]
55-
[assembly: AssemblyFileVersion("0.9.6.0")]
54+
[assembly: AssemblyVersion("0.9.7.0")]
55+
[assembly: AssemblyFileVersion("0.9.7.0")]

extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/tools.stack3/Spy.pulldown/Find All Loaded Assemblies.pushbutton/script.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
"""List all currently loaded assemblies"""
2-
2+
#pylint: disable=import-error,invalid-name,broad-except
3+
from pyrevit.compat import safe_strtype
34
from pyrevit import framework
4-
5+
from pyrevit import script
56

67
__context__ = 'zerodoc'
78

89

9-
userScriptsAssemblies = []
10+
output = script.get_output()
11+
12+
output.freeze()
13+
14+
userscript_assms = []
1015
for loadedAssembly in framework.AppDomain.CurrentDomain.GetAssemblies():
1116
loc = ''
12-
if 'pyrevit' in unicode(loadedAssembly.FullName).lower():
13-
userScriptsAssemblies.append(loadedAssembly)
17+
if 'pyrevit' in safe_strtype(loadedAssembly.FullName).lower():
18+
userscript_assms.append(loadedAssembly)
1419
continue
1520
try:
1621
loc = loadedAssembly.Location
@@ -35,7 +40,7 @@
3540
pass
3641

3742
print('\n\nPYREVIT ASSEMBLIES:')
38-
for loadedAssembly in userScriptsAssemblies:
43+
for loadedAssembly in userscript_assms:
3944
loc = ''
4045
try:
4146
loc = loadedAssembly.Location
@@ -52,3 +57,5 @@
5257
print('\n')
5358
except Exception:
5459
pass
60+
61+
output.unfreeze()

extensions/pyRevitCore.extension/pyRevit.tab/pyRevit.panel/tools.stack3/Spy.pulldown/List Elements.pushbutton/script.py

+21-20
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@
205205
print('\t{} {}'.format(output.linkify(et.Id),
206206
revit.query.get_name(et)))
207207

208-
209208
elif selected_switch == 'Family Symbols':
210209
cl = DB.FilteredElementCollector(revit.doc)
211210
eltype_list = cl.OfClass(DB.ElementType).ToElements()
@@ -437,25 +436,27 @@ def isline(line):
437436
print('Elemend with ID: {0} is a not a line.\n'.format(el.Id))
438437

439438
elif selected_switch == 'Data Schema Entities':
440-
allElements = \
441-
list(DB.FilteredElementCollector(revit.doc)
442-
.WherePasses(
443-
DB.LogicalOrFilter(DB.ElementIsElementTypeFilter(False),
444-
DB.ElementIsElementTypeFilter(True))))
445-
446-
guids = {sc.GUID.ToString(): sc.SchemaName
447-
for sc in DB.ExtensibleStorage.Schema.ListSchemas()}
448-
449-
for el in allElements:
450-
schemaGUIDs = el.GetEntitySchemaGuids()
451-
for guid in schemaGUIDs:
452-
if guid.ToString() in guids.keys():
453-
print('ELEMENT ID: {0}\t\t'
454-
'SCHEMA NAME: {1}'
455-
.format(el.Id.IntegerValue,
456-
guids[guid.ToString()]))
457-
458-
print('Iteration completed over {0} elements.'.format(len(allElements)))
439+
schemas = {x.GUID.ToString(): x
440+
for x in revit.query.get_all_schemas()}
441+
442+
for el in revit.query.get_all_elements(doc=revit.doc):
443+
schema_guids = el.GetEntitySchemaGuids()
444+
for guid_obj in schema_guids:
445+
guid = guid_obj.ToString()
446+
if guid in schemas:
447+
schema = schemas[guid]
448+
print(
449+
'{}{}'.format(
450+
'{} ({})'.format(
451+
output.linkify(el.Id),
452+
el.Category.Name
453+
).ljust(40),
454+
schema.SchemaName
455+
)
456+
)
457+
for fname, fval in \
458+
revit.query.get_schema_field_values(el, schema).items():
459+
print('\t%s: %s' %(fname, fval))
459460

460461
elif selected_switch == 'Fill Grids':
461462
selection = revit.get_selection()

extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Keynotes.pushbutton/script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def postable_keynote_command(self):
431431

432432
@property
433433
def postcmd_options(self):
434-
return [self.userknote_rb, self.elementknote_rb, self.materialknote_rb]
434+
return [self.userknote_rb, self.materialknote_rb, self.elementknote_rb]
435435

436436
@property
437437
def postcmd_idx(self):

extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Revision.pulldown/Copy Revisions to Open Documents.pushbutton/script.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
if dest_docs:
1616
for ddoc in dest_docs:
1717
with revit.Transaction('Copy Revisions', doc=ddoc):
18-
revit.create.copy_revisions(src_doc=revit.doc,
19-
dest_doc=ddoc,
20-
revisions=selected_revisions)
18+
revit.create.copy_revisions(
19+
selected_revisions,
20+
src_doc=revit.doc,
21+
dest_doc=ddoc
22+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Copy selected view templates to other open models."""
2+
#pylint: disable=import-error,invalid-name
3+
from pyrevit import revit
4+
from pyrevit import forms
5+
6+
7+
selected_viewtemplates = forms.select_viewtemplates(doc=revit.doc)
8+
if selected_viewtemplates:
9+
dest_docs = forms.select_open_docs(title='Select Destination Documents')
10+
if dest_docs:
11+
for ddoc in dest_docs:
12+
with revit.Transaction('Copy View Templates', doc=ddoc):
13+
revit.create.copy_viewtemplates(
14+
selected_viewtemplates,
15+
src_doc=revit.doc,
16+
dest_doc=ddoc
17+
)

extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack3/Views.pulldown/_layout

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Rename Selected Views
99
Duplicate Selected Views
1010
Create Print Set From Selected Views
1111
Find Used View Templates Filters
12+
Copy View Templates to Open Documents
1213
Toggle All Grid Bubbles in Current View
1314
Match Title on Sheet in Open Docs
1415
Add Views to Sheets

pyrevitlib/pyrevit/forms/__init__.py

+49
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@ def select_revisions(title='Select Revision',
14211421
... [<Autodesk.Revit.DB.Revision object>,
14221422
... <Autodesk.Revit.DB.Revision object>]
14231423
"""
1424+
doc = doc or HOST_APP.doc
14241425
revisions = sorted(revit.query.get_revisions(doc=doc),
14251426
key=lambda x: x.SequenceNumber)
14261427

@@ -1537,6 +1538,7 @@ def select_views(title='Select Views',
15371538
... [<Autodesk.Revit.DB.View object>,
15381539
... <Autodesk.Revit.DB.View object>]
15391540
"""
1541+
doc = doc or HOST_APP.doc
15401542
all_graphviews = revit.query.get_all_views(doc=doc)
15411543

15421544
if filterfunc:
@@ -1555,6 +1557,53 @@ def select_views(title='Select Views',
15551557
return selected_views
15561558

15571559

1560+
def select_viewtemplates(title='Select View Templates',
1561+
button_name='Select',
1562+
width=DEFAULT_INPUTWINDOW_WIDTH,
1563+
multiple=True,
1564+
filterfunc=None,
1565+
doc=None):
1566+
"""Standard form for selecting view templates.
1567+
1568+
Args:
1569+
title (str, optional): list window title
1570+
button_name (str, optional): list window button caption
1571+
width (int, optional): width of list window
1572+
multiselect (bool, optional):
1573+
allow multi-selection (uses check boxes). defaults to True
1574+
filterfunc (function):
1575+
filter function to be applied to context items.
1576+
doc (DB.Document, optional):
1577+
source document for views; defaults to active document
1578+
1579+
Returns:
1580+
list[DB.View]: list of selected view templates
1581+
1582+
Example:
1583+
>>> from pyrevit import forms
1584+
>>> forms.select_viewtemplates()
1585+
... [<Autodesk.Revit.DB.View object>,
1586+
... <Autodesk.Revit.DB.View object>]
1587+
"""
1588+
doc = doc or HOST_APP.doc
1589+
all_viewtemplates = revit.query.get_all_view_templates(doc=doc)
1590+
1591+
if filterfunc:
1592+
all_viewtemplates = filter(filterfunc, all_viewtemplates)
1593+
1594+
selected_viewtemplates = SelectFromList.show(
1595+
sorted([ViewOption(x) for x in all_viewtemplates],
1596+
key=lambda x: x.name),
1597+
title=title,
1598+
button_name=button_name,
1599+
width=width,
1600+
multiselect=multiple,
1601+
checked_only=True
1602+
)
1603+
1604+
return selected_viewtemplates
1605+
1606+
15581607
def select_open_docs(title='Select Open Documents',
15591608
button_name='OK',
15601609
width=DEFAULT_INPUTWINDOW_WIDTH, #pylint: disable=W0613

pyrevitlib/pyrevit/framework.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from System.Text import Encoding
3333
from System.Collections import IEnumerator, IEnumerable
3434
from System.Collections.Generic import List, Dictionary
35+
from System.Collections.Generic import IList, IDictionary
3536
from System import DateTime, DateTimeOffset
3637

3738
from System import Diagnostics

pyrevitlib/pyrevit/output/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ def unlock_size(self):
330330
self.window.UnlockSize()
331331

332332
def freeze(self):
333-
"""Freeze output contetn update."""
333+
"""Freeze output content update."""
334334
if self.window:
335335
self.window.Freeze()
336336

337337
def unfreeze(self):
338-
"""Unfreeze output contetn update."""
338+
"""Unfreeze output content update."""
339339
if self.window:
340340
self.window.Unfreeze()
341341

0 commit comments

Comments
 (0)