Skip to content

Commit

Permalink
Merge branch 'release/4.6.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Mar 17, 2019
2 parents 28d0db6 + 293ea28 commit a6f2ce8
Show file tree
Hide file tree
Showing 28 changed files with 242 additions and 78 deletions.
4 changes: 2 additions & 2 deletions README_CLI.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# pyRevit Command Line Tool Help

##### Version 0.9.6.0
##### Version 0.9.7.0

`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.

- [pyRevit Command Line Tool Help](#pyrevit-command-line-tool-help)
- [Version 0.9.6.0](#version-0960)
- [Version 0.9.7.0](#version-0970)
- [Getting Help](#getting-help)
- [pyrevit CLI version](#pyrevit-cli-version)
- [pyRevit Online Resources](#pyrevit-online-resources)
Expand Down
Binary file modified bin/pyRevitLabs.Common.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Common.pdb
Binary file not shown.
Binary file modified bin/pyRevitLabs.CommonCLI.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.CommonCLI.pdb
Binary file not shown.
Binary file modified bin/pyRevitLabs.Language.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Language.pdb
Binary file not shown.
Binary file modified bin/pyRevitLabs.TargetApps.Revit.dll
Binary file not shown.
Binary file modified bin/pyRevitUpdater.exe
Binary file not shown.
Binary file modified bin/pyrevit.exe
Binary file not shown.
Binary file modified bin/pyrevit.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.7.0")]
[assembly: AssemblyFileVersion("0.8.7.0")]
[assembly: AssemblyVersion("0.8.8.0")]
[assembly: AssemblyFileVersion("0.8.8.0")]
70 changes: 42 additions & 28 deletions dev/pyRevitLabs/pyRevitLabs.TargetApps.Revit/RevitController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,47 +300,47 @@ public class RevitProduct {

// 2008
// https://www.revitforum.org/architecture-general-revit-questions/105-revit-builds-updates-product-support.html
{"20070607_1700", ("Unknown", "2008 Architecture Service Pack 2")},
{"20070810_1700", ("Unknown", "2008 Architecture Service Pack 2")},
{"20080101_2345", ("Unknown", "2008 Architecture Service Pack 3")}, // https://forums.autodesk.com/t5/revit-architecture-forum/sp3-build-20080101-2345/td-p/2152807
{"20070607_1700", ("0.0.0.0", "2008 Architecture Service Pack 2")},
{"20070810_1700", ("0.0.0.0", "2008 Architecture Service Pack 2")},
{"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

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

// 2010
// https://www.revitforum.org/architecture-general-revit-questions/105-revit-builds-updates-product-support.html
{"20090612_2115", ("Unknown", "2010 Architecture Service Pack 1")}, // https://forums.autodesk.com/t5/revit-architecture-forum/sp3-build-20080101-2345/td-p/2152807
{"20090917_1515", ("Unknown", "2010 Architecture Service Pack 2")},
{"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
{"20090917_1515", ("0.0.0.0", "2010 Architecture Service Pack 2")},

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

// 2012
// 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
{"20110309_2315", ("Unknown", "2012 First Customer Ship")},
{"20110622_0930", ("Unknown", "2012 Update Release 1")},
{"20110916_2132", ("Unknown", "2012 Update Release 2")},
{"20110309_2315", ("0.0.0.0", "2012 First Customer Ship")},
{"20110622_0930", ("0.0.0.0", "2012 Update Release 1")},
{"20110916_2132", ("0.0.0.0", "2012 Update Release 2")},

// 2013
// 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
{"20120221_2030", ("12.02.21203", "2013 First Customer Ship")},
{"20120716_1115", ("Unknown", "2013 Update Release 1")},
{"20121003_2115", ("Unknown", "2013 Update Release 2")},
{"20130531_2115", ("Unknown", "2013 Update Release 3")},
{"20120821_1330", ("Unknown", "2013 LT First Customer Ship")},
{"20130531_0300", ("Unknown", "2013 LT Update Release 1")},
{"20120716_1115", ("0.0.0.0", "2013 Update Release 1")},
{"20121003_2115", ("0.0.0.0", "2013 Update Release 2")},
{"20130531_2115", ("0.0.0.0", "2013 Update Release 3")},
{"20120821_1330", ("0.0.0.0", "2013 LT First Customer Ship")},
{"20130531_0300", ("0.0.0.0", "2013 LT Update Release 1")},

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

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

public Version Version {
get {
if (_revitBuildNumberLookupTable.ContainsKey(BuildNumber))
return new Version(_revitBuildNumberLookupTable[BuildNumber].Item1);
else if (RegisteredVersion != null || RegisteredVersion != string.Empty)
return new Version(RegisteredVersion);
else
return null;
// build version from build-number lookup
if (_revitBuildNumberLookupTable.ContainsKey(BuildNumber)) {
try {
return new Version(_revitBuildNumberLookupTable[BuildNumber].Item1);
}
catch {
}
}

// otherwise build version from registry info if available
if (RegisteredVersion != null || RegisteredVersion != string.Empty) {
try {
return new Version(RegisteredVersion);
}
catch {
}
}

// return none
return null;
}
}

Expand Down
4 changes: 2 additions & 2 deletions dev/pyRevitLabs/pyRevitManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.6.0")]
[assembly: AssemblyFileVersion("0.9.6.0")]
[assembly: AssemblyVersion("0.9.7.0")]
[assembly: AssemblyFileVersion("0.9.7.0")]
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
"""List all currently loaded assemblies"""

#pylint: disable=import-error,invalid-name,broad-except
from pyrevit.compat import safe_strtype
from pyrevit import framework

from pyrevit import script

__context__ = 'zerodoc'


userScriptsAssemblies = []
output = script.get_output()

output.freeze()

userscript_assms = []
for loadedAssembly in framework.AppDomain.CurrentDomain.GetAssemblies():
loc = ''
if 'pyrevit' in unicode(loadedAssembly.FullName).lower():
userScriptsAssemblies.append(loadedAssembly)
if 'pyrevit' in safe_strtype(loadedAssembly.FullName).lower():
userscript_assms.append(loadedAssembly)
continue
try:
loc = loadedAssembly.Location
Expand All @@ -35,7 +40,7 @@
pass

print('\n\nPYREVIT ASSEMBLIES:')
for loadedAssembly in userScriptsAssemblies:
for loadedAssembly in userscript_assms:
loc = ''
try:
loc = loadedAssembly.Location
Expand All @@ -52,3 +57,5 @@
print('\n')
except Exception:
pass

output.unfreeze()
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
print('\t{} {}'.format(output.linkify(et.Id),
revit.query.get_name(et)))


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

elif selected_switch == 'Data Schema Entities':
allElements = \
list(DB.FilteredElementCollector(revit.doc)
.WherePasses(
DB.LogicalOrFilter(DB.ElementIsElementTypeFilter(False),
DB.ElementIsElementTypeFilter(True))))

guids = {sc.GUID.ToString(): sc.SchemaName
for sc in DB.ExtensibleStorage.Schema.ListSchemas()}

for el in allElements:
schemaGUIDs = el.GetEntitySchemaGuids()
for guid in schemaGUIDs:
if guid.ToString() in guids.keys():
print('ELEMENT ID: {0}\t\t'
'SCHEMA NAME: {1}'
.format(el.Id.IntegerValue,
guids[guid.ToString()]))

print('Iteration completed over {0} elements.'.format(len(allElements)))
schemas = {x.GUID.ToString(): x
for x in revit.query.get_all_schemas()}

for el in revit.query.get_all_elements(doc=revit.doc):
schema_guids = el.GetEntitySchemaGuids()
for guid_obj in schema_guids:
guid = guid_obj.ToString()
if guid in schemas:
schema = schemas[guid]
print(
'{}{}'.format(
'{} ({})'.format(
output.linkify(el.Id),
el.Category.Name
).ljust(40),
schema.SchemaName
)
)
for fname, fval in \
revit.query.get_schema_field_values(el, schema).items():
print('\t%s: %s' %(fname, fval))

elif selected_switch == 'Fill Grids':
selection = revit.get_selection()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def postable_keynote_command(self):

@property
def postcmd_options(self):
return [self.userknote_rb, self.elementknote_rb, self.materialknote_rb]
return [self.userknote_rb, self.materialknote_rb, self.elementknote_rb]

@property
def postcmd_idx(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
if dest_docs:
for ddoc in dest_docs:
with revit.Transaction('Copy Revisions', doc=ddoc):
revit.create.copy_revisions(src_doc=revit.doc,
dest_doc=ddoc,
revisions=selected_revisions)
revit.create.copy_revisions(
selected_revisions,
src_doc=revit.doc,
dest_doc=ddoc
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Copy selected view templates to other open models."""
#pylint: disable=import-error,invalid-name
from pyrevit import revit
from pyrevit import forms


selected_viewtemplates = forms.select_viewtemplates(doc=revit.doc)
if selected_viewtemplates:
dest_docs = forms.select_open_docs(title='Select Destination Documents')
if dest_docs:
for ddoc in dest_docs:
with revit.Transaction('Copy View Templates', doc=ddoc):
revit.create.copy_viewtemplates(
selected_viewtemplates,
src_doc=revit.doc,
dest_doc=ddoc
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Rename Selected Views
Duplicate Selected Views
Create Print Set From Selected Views
Find Used View Templates Filters
Copy View Templates to Open Documents
Toggle All Grid Bubbles in Current View
Match Title on Sheet in Open Docs
Add Views to Sheets
Expand Down
49 changes: 49 additions & 0 deletions pyrevitlib/pyrevit/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ def select_revisions(title='Select Revision',
... [<Autodesk.Revit.DB.Revision object>,
... <Autodesk.Revit.DB.Revision object>]
"""
doc = doc or HOST_APP.doc
revisions = sorted(revit.query.get_revisions(doc=doc),
key=lambda x: x.SequenceNumber)

Expand Down Expand Up @@ -1537,6 +1538,7 @@ def select_views(title='Select Views',
... [<Autodesk.Revit.DB.View object>,
... <Autodesk.Revit.DB.View object>]
"""
doc = doc or HOST_APP.doc
all_graphviews = revit.query.get_all_views(doc=doc)

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


def select_viewtemplates(title='Select View Templates',
button_name='Select',
width=DEFAULT_INPUTWINDOW_WIDTH,
multiple=True,
filterfunc=None,
doc=None):
"""Standard form for selecting view templates.
Args:
title (str, optional): list window title
button_name (str, optional): list window button caption
width (int, optional): width of list window
multiselect (bool, optional):
allow multi-selection (uses check boxes). defaults to True
filterfunc (function):
filter function to be applied to context items.
doc (DB.Document, optional):
source document for views; defaults to active document
Returns:
list[DB.View]: list of selected view templates
Example:
>>> from pyrevit import forms
>>> forms.select_viewtemplates()
... [<Autodesk.Revit.DB.View object>,
... <Autodesk.Revit.DB.View object>]
"""
doc = doc or HOST_APP.doc
all_viewtemplates = revit.query.get_all_view_templates(doc=doc)

if filterfunc:
all_viewtemplates = filter(filterfunc, all_viewtemplates)

selected_viewtemplates = SelectFromList.show(
sorted([ViewOption(x) for x in all_viewtemplates],
key=lambda x: x.name),
title=title,
button_name=button_name,
width=width,
multiselect=multiple,
checked_only=True
)

return selected_viewtemplates


def select_open_docs(title='Select Open Documents',
button_name='OK',
width=DEFAULT_INPUTWINDOW_WIDTH, #pylint: disable=W0613
Expand Down
1 change: 1 addition & 0 deletions pyrevitlib/pyrevit/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from System.Text import Encoding
from System.Collections import IEnumerator, IEnumerable
from System.Collections.Generic import List, Dictionary
from System.Collections.Generic import IList, IDictionary
from System import DateTime, DateTimeOffset

from System import Diagnostics
Expand Down
4 changes: 2 additions & 2 deletions pyrevitlib/pyrevit/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ def unlock_size(self):
self.window.UnlockSize()

def freeze(self):
"""Freeze output contetn update."""
"""Freeze output content update."""
if self.window:
self.window.Freeze()

def unfreeze(self):
"""Unfreeze output contetn update."""
"""Unfreeze output content update."""
if self.window:
self.window.Unfreeze()

Expand Down
Loading

0 comments on commit a6f2ce8

Please sign in to comment.