Skip to content

Commit 3c8a65c

Browse files
committed
v4.6.7
2 parents f07fb27 + c2e852a commit 3c8a65c

File tree

111 files changed

+613
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+613
-254
lines changed

.github/PULL_REQUEST_TEMPLATE.md

.github/issue_template.md

Lines changed: 9 additions & 0 deletions

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions

CONTRIBUTING.md

CREDITS.txt

Whitespace-only changes.

bin/NLog.dll

1.5 KB
Binary file not shown.

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.CommonWPF.dll

0 Bytes
Binary file not shown.

bin/pyRevitLabs.CommonWPF.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

512 Bytes
Binary file not shown.

bin/pyRevitLabs.TargetApps.Revit.pdb

0 Bytes
Binary file not shown.

bin/pyRevitUpdater.exe

26 KB
Binary file not shown.

bin/pyrevit.exe

0 Bytes
Binary file not shown.

bin/pyrevit.pdb

0 Bytes
Binary file not shown.

dev/WPFEdit/WPFEdit/WPFEdit.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@
172172
<Generator>MSBuild:Compile</Generator>
173173
<SubType>Designer</SubType>
174174
</Page>
175+
<Page Include="..\..\..\pyrevitlib\pyrevit\forms\ImageListContainerStyle.xaml">
176+
<Link>Forms\ImageListContainerStyle.xaml</Link>
177+
<Generator>MSBuild:Compile</Generator>
178+
<SubType>Designer</SubType>
179+
</Page>
180+
<Page Include="..\..\..\pyrevitlib\pyrevit\forms\ImageListPanelStyle.xaml">
181+
<Link>Forms\ImageListPanelStyle.xaml</Link>
182+
<Generator>MSBuild:Compile</Generator>
183+
<SubType>Designer</SubType>
184+
</Page>
175185
<Page Include="..\..\..\pyrevitlib\pyrevit\forms\ProgressBar.xaml">
176186
<Link>Forms\ProgressBar.xaml</Link>
177187
<Generator>MSBuild:Compile</Generator>
@@ -187,6 +197,11 @@
187197
<Generator>MSBuild:Compile</Generator>
188198
<SubType>Designer</SubType>
189199
</Page>
200+
<Page Include="..\..\..\pyrevitlib\pyrevit\forms\SwatchContainerStyle.xaml">
201+
<Link>Forms\SwatchContainerStyle.xaml</Link>
202+
<Generator>MSBuild:Compile</Generator>
203+
<SubType>Designer</SubType>
204+
</Page>
190205
<Page Include="..\..\..\pyrevitlib\pyrevit\forms\TemplatePromptBar.xaml">
191206
<Link>Forms\TemplatePromptBar.xaml</Link>
192207
<Generator>MSBuild:Compile</Generator>

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

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#pylint: disable=C0103,E0401,W0703
33
from collections import defaultdict
44

5+
from pyrevit import HOST_APP
56
from pyrevit.framework import List
67
from pyrevit import coreutils
78
from pyrevit import revit, DB, UI
@@ -244,8 +245,8 @@
244245
'AREA ID: {2} '
245246
'LEVEL: {3} '
246247
'AREA: {4}'
247-
.format(el.LookupParameter('Name').AsString().ljust(30),
248-
el.LookupParameter('Number').AsString().ljust(10),
248+
.format(el.Parameter[DB.BuiltInParameter.ROOM_NAME].AsString().ljust(30),
249+
el.Parameter[DB.BuiltInParameter.ROOM_NUMBER].AsString().ljust(10),
249250
el.Id,
250251
str(el.Level.Name).ljust(50),
251252
el.Area))
@@ -261,8 +262,8 @@
261262
print('ROOM NAME: {0} '
262263
'ROOM NUMBER: {1} '
263264
'ROOM ID: {2}'
264-
.format(el.LookupParameter('Name').AsString().ljust(30),
265-
el.LookupParameter('Number').AsString().ljust(20),
265+
.format(el.Parameter[DB.BuiltInParameter.ROOM_NAME].AsString().ljust(30),
266+
el.Parameter[DB.BuiltInParameter.ROOM_NUMBER].AsString().ljust(20),
266267
el.Id))
267268

268269
print('\n\nTOTAL ROOMS FOUND: {0}'.format(len(roomlist)))
@@ -302,8 +303,8 @@
302303
for s in sheets:
303304
print('NUMBER: {0} '
304305
'NAME:{1}'
305-
.format(s.LookupParameter('Sheet Number').AsString().rjust(10),
306-
s.LookupParameter('Sheet Name').AsString().ljust(50)))
306+
.format(s.Parameter[DB.BuiltInParameter.SHEET_NUMBER].AsString().rjust(10),
307+
s.Parameter[DB.BuiltInParameter.SHEET_NAME].AsString().ljust(50)))
307308

308309
elif selected_switch == 'System Categories':
309310
for cat in revit.doc.Settings.Categories:
@@ -337,22 +338,34 @@
337338
views.append(el)
338339

339340
for v in views:
340-
phasep = v.LookupParameter('Phase')
341-
underlayp = v.LookupParameter('Underlay')
342-
print('TYPE: {1}'
343-
'ID: {2}'
344-
'TEMPLATE: {3}'
345-
'PHASE:{4} '
346-
'UNDERLAY:{5} '
347-
'{0}'
348-
.format(v.ViewName,
349-
str(v.ViewType).ljust(20),
350-
str(v.Id).ljust(10),
351-
str(v.IsTemplate).ljust(10),
352-
phasep.AsValueString().ljust(25)
353-
if phasep else '---'.ljust(25),
354-
underlayp.AsValueString().ljust(25)
355-
if underlayp else '---'.ljust(25)))
341+
phasep = v.Parameter[DB.BuiltInParameter.VIEW_PHASE]
342+
if HOST_APP.is_older_than(2016):
343+
underlayp = v.Parameter[DB.BuiltInParameter.VIEW_UNDERLAY_ID]
344+
print('TYPE: {1} ID: {2} TEMPLATE: {3} PHASE:{4} UNDERLAY:{5} {0}'
345+
.format(v.ViewName,
346+
str(v.ViewType).ljust(20),
347+
str(v.Id).ljust(10),
348+
str(v.IsTemplate).ljust(10),
349+
phasep.AsValueString().ljust(25)
350+
if phasep else '---'.ljust(25),
351+
underlayp.AsValueString().ljust(25)
352+
if underlayp else '---'.ljust(25)))
353+
else:
354+
underlaytp = v.Parameter[DB.BuiltInParameter.VIEW_UNDERLAY_TOP_ID]
355+
underlaybp = \
356+
v.Parameter[DB.BuiltInParameter.VIEW_UNDERLAY_BOTTOM_ID]
357+
print('TYPE: {1} ID: {2} TEMPLATE: {3} PHASE:{4} '
358+
'UNDERLAY TOP:{5} UNDERLAY BOTTOM:{6} {0}'
359+
.format(v.ViewName,
360+
str(v.ViewType).ljust(20),
361+
str(v.Id).ljust(10),
362+
str(v.IsTemplate).ljust(10),
363+
phasep.AsValueString().ljust(25)
364+
if phasep else '---'.ljust(25),
365+
underlaytp.AsValueString().ljust(25)
366+
if underlaytp else '---'.ljust(25),
367+
underlaybp.AsValueString().ljust(25)
368+
if underlaybp else '---'.ljust(25)))
356369

357370
elif selected_switch == 'View Templates':
358371
cl_views = DB.FilteredElementCollector(revit.doc)
@@ -472,10 +485,8 @@ def isline(line):
472485

473486
elif selected_switch == 'Point Cloud Instances':
474487
for pc in revit.query.get_pointclouds(doc=revit.doc):
475-
print('Name: {}\tWorkset:{}'.format(
476-
pc.Name,
477-
pc.LookupParameter('Workset').AsValueString())
478-
)
488+
ws = revit.doc.GetElement(pc.WorksetId)
489+
print('Name: {}\tWorkset:{}'.format(pc.Name, ws.Name if ws else '---'))
479490

480491
elif selected_switch == 'Sheets with Hidden Characters':
481492
for sheet in revit.query.get_sheets(doc=revit.doc):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"""Unit Tests for pyrevit.coreutils.appdata module."""
2+
#pylint: disable=E0401
3+
import re
4+
5+
import pyrevit
6+
from pyrevit.coreutils import appdata
7+
8+
9+
__context__ = 'zerodoc'
10+
11+
12+
TEST_STRINGS = ['pyRevit_some-randomename',
13+
'pyRevit_2018_some-randomename',
14+
'pyRevit_2018_14422_some-randomname',
15+
'pyRevit_eirannejad_some-randomename',
16+
'pyRevit_2018_eirannejad_some-randomename',
17+
'pyRevit_2018_eirannejad_14422_some-randomename']
18+
19+
for tstring in TEST_STRINGS:
20+
print('Testing: "{}"'.format(tstring))
21+
22+
# e.g. pyRevit_2018_eirannejad_14422_
23+
m = re.match(pyrevit.PYREVIT_FILE_PREFIX_STAMPED_USER_REGEX, tstring)
24+
if m:
25+
print('\tMatched: {}'.format(
26+
pyrevit.PYREVIT_FILE_PREFIX_STAMPED_USER_REGEX))
27+
print('\t' + str(m.groupdict()))
28+
29+
# e.g. pyRevit_2018_14422_
30+
m = re.match(pyrevit.PYREVIT_FILE_PREFIX_STAMPED_REGEX, tstring)
31+
if m:
32+
print('\tMatched: {}'.format(pyrevit.PYREVIT_FILE_PREFIX_STAMPED_REGEX))
33+
print('\t' + str(m.groupdict()))
34+
35+
# e.g. pyRevit_2018_eirannejad_
36+
m = re.match(pyrevit.PYREVIT_FILE_PREFIX_USER_REGEX, tstring)
37+
if m:
38+
print('\tMatched: {}'.format(pyrevit.PYREVIT_FILE_PREFIX_USER_REGEX))
39+
print('\t' + str(m.groupdict()))
40+
41+
# e.g. pyRevit_2018_
42+
m = re.match(pyrevit.PYREVIT_FILE_PREFIX_REGEX, tstring)
43+
if m:
44+
print('\tMatched: {}'.format(pyrevit.PYREVIT_FILE_PREFIX_REGEX))
45+
print('\t' + str(m.groupdict()))
46+
47+
# e.g. pyRevit_eirannejad_
48+
m = re.match(pyrevit.PYREVIT_FILE_PREFIX_UNIVERSAL_USER_REGEX, tstring)
49+
if m:
50+
print('\tMatched: {}'.format(
51+
pyrevit.PYREVIT_FILE_PREFIX_UNIVERSAL_USER_REGEX))
52+
print('\t' + str(m.groupdict()))
53+
54+
# e.g. pyRevit_
55+
m = re.match(pyrevit.PYREVIT_FILE_PREFIX_UNIVERSAL_REGEX, tstring)
56+
if m:
57+
print('\tMatched: {}'.format(
58+
pyrevit.PYREVIT_FILE_PREFIX_UNIVERSAL_REGEX))
59+
print('\t' + str(m.groupdict()))

extensions/pyRevitDevTools.extension/pyRevitDev.tab/Debug.panel/Unit Tests.pulldown/Forms Module Tests.pushbutton/script.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Unit Tests for pyrevit.forms module."""
2+
#pylint: disable=E0401
3+
from pyrevit import script
4+
from pyrevit import forms
25

36

47
__context__ = 'zerodoc'
58

69

7-
from pyrevit import forms
8-
9-
1010
def test_forms(forms_func, test_title, filterfuncstr='', *args, **kwargs):
1111
print('\n\n' + test_title)
1212
test_title += '({}):'
@@ -100,3 +100,8 @@ def test_forms(forms_func, test_title, filterfuncstr='', *args, **kwargs):
100100
group_selector_title='Select Integer Range:',
101101
multiselect=True
102102
))
103+
104+
105+
print(
106+
forms.select_image(script.get_bundle_files('images/'))
107+
)

extensions/pyRevitDevTools.extension/pyRevitDev.tab/Debug.panel/Unit Tests.pulldown/_layout

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Run All Tests
33
Engine Tests
44
pyRevitLabs Module Tests
55
Output Window Tests
6+
Appdata Module Tests
67
Forms Module Tests
78
Revit Module Tests
89
Script Module Tests

0 commit comments

Comments
 (0)