Skip to content

Commit 7cde0e3

Browse files
author
EF
committed
Merge branch 'doorFlipState' of https://github.com/mangrove-art/pyRevit into doorFlipState
2 parents 6cbddde + fcd9ee8 commit 7cde0e3

File tree

9 files changed

+870
-677
lines changed

9 files changed

+870
-677
lines changed

bin/pyrevit-hosts.json

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,18 @@
18581858
"release": "2023.1.6",
18591859
"target": "x64",
18601860
"version": "23.1.60.36"
1861+
},
1862+
{
1863+
"build": "20250410_1515",
1864+
"meta": {
1865+
"schema": "1.0",
1866+
"source": "https://help.autodesk.com/view/RVT/2023/ENU/?guid=RevitReleaseNotes_2023updates_2023_1_7_html"
1867+
},
1868+
"notes": "https://help.autodesk.com/view/RVT/2023/ENU/?guid=RevitReleaseNotes_2023updates_2023_1_7_html",
1869+
"product": "Autodesk Revit",
1870+
"release": "2023.1.7",
1871+
"target": "x64",
1872+
"version": "23.1.70.22"
18611873
},
18621874
{
18631875
"build": "20230308_1635",
@@ -1991,6 +2003,18 @@
19912003
"target": "x64",
19922004
"version": "24.3.10.22"
19932005
},
2006+
{
2007+
"build": "20250402_1515",
2008+
"meta": {
2009+
"schema": "1.0",
2010+
"source": "https://help.autodesk.com/view/RVT/2024/ENU/?guid=RevitReleaseNotes_2024updates_2024_3_2_html"
2011+
},
2012+
"notes": "https://help.autodesk.com/view/RVT/2024/ENU/?guid=RevitReleaseNotes_2024updates_2024_3_2_html",
2013+
"product": "Autodesk Revit",
2014+
"release": "2024.3.2",
2015+
"target": "x64",
2016+
"version": "24.3.20.34"
2017+
},
19942018
{
19952019
"build": "20240307_1300",
19962020
"meta": {
@@ -2051,6 +2075,18 @@
20512075
"target": "x64",
20522076
"version": "25.4.0.32"
20532077
},
2078+
{
2079+
"build": "20250331_1515",
2080+
"meta": {
2081+
"schema": "1.0",
2082+
"source": "https://help.autodesk.com/view/RVT/2025/ENU/?guid=RevitReleaseNotes_2025updates_2025_4_1_html"
2083+
},
2084+
"notes": "https://help.autodesk.com/view/RVT/2025/ENU/?guid=RevitReleaseNotes_2025updates_2025_4_1_html",
2085+
"product": "Autodesk Revit",
2086+
"release": "2025.4.1",
2087+
"target": "x64",
2088+
"version": "25.4.10.45"
2089+
},
20542090
{
20552091
"build": "20250227_1515",
20562092
"meta": {
@@ -2062,5 +2098,17 @@
20622098
"release": "2026 First Customer Ship",
20632099
"target": "x64",
20642100
"version": "26.0.4.409"
2101+
},
2102+
{
2103+
"build": "20250328_1515",
2104+
"meta": {
2105+
"schema": "1.0",
2106+
"source": "https://help.autodesk.com/view/RVT/2026/ENU/?guid=RevitReleaseNotes_2026updates_2026_0_1_html"
2107+
},
2108+
"notes": "https://help.autodesk.com/view/RVT/2026/ENU/?guid=RevitReleaseNotes_2026updates_2026_0_1_html",
2109+
"product": "Autodesk Revit",
2110+
"release": "2026.0.1",
2111+
"target": "x64",
2112+
"version": "26.0.10.8"
20652113
}
2066-
]
2114+
]

dev/Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PyRevitExtDir>$(PyRevitRootDir)\extensions</PyRevitExtDir>
2121

2222
<RevitDevDir>$(PyRevitDevDir)\libs\Revit</RevitDevDir>
23-
<IronPythonStdLibDir>$(PyRevitDevDir)\libs\IronPython\</IronPythonStdLibDir>
23+
<IronPythonStdLibDir>$(PyRevitDevDir)\libs\IronPython</IronPythonStdLibDir>
2424
</PropertyGroup>
2525

2626
<PropertyGroup Condition="$(UseDefaultBin) == 'true'">
@@ -31,4 +31,4 @@
3131
<RevitVersion Condition="'$(RevitVersion)' == '' and '$(TargetFramework)' == 'net48'">2017</RevitVersion>
3232
<RevitVersion Condition="'$(RevitVersion)' == '' and '$(TargetFramework)' == 'net8.0-windows'">2025</RevitVersion>
3333
</PropertyGroup>
34-
</Project>
34+
</Project>

dev/pyRevitTelemetryServer/go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ require (
1515
github.com/satori/go.uuid v1.2.0
1616
go.mongodb.org/mongo-driver v1.11.1
1717
pkg.re/essentialkaos/ek.v10 v12.32.0+incompatible
18-
)
1918

20-
require (
19+
// Indirect dependencies
2120
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
2221
github.com/golang/snappy v0.0.1 // indirect
2322
github.com/klauspost/compress v1.13.6 // indirect
@@ -27,9 +26,9 @@ require (
2726
github.com/xdg-go/scram v1.1.1 // indirect
2827
github.com/xdg-go/stringprep v1.0.3 // indirect
2928
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
30-
golang.org/x/crypto v0.31.0 // indirect
31-
golang.org/x/sync v0.10.0 // indirect
32-
golang.org/x/text v0.21.0 // indirect
29+
golang.org/x/crypto v0.35.0 // indirect
30+
golang.org/x/sync v0.11.0 // indirect
31+
golang.org/x/text v0.22.0 // indirect
3332
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
3433
pkg.re/essentialkaos/check.v1 v1.0.0 // indirect
3534
)

dev/pyRevitTelemetryServer/go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0
6464
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
6565
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
6666
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
67-
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
68-
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
67+
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
68+
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
6969
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
7070
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
7171
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
@@ -87,8 +87,8 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
8787
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
8888
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
8989
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
90-
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
91-
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
90+
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
91+
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
9292
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
9393
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
9494
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -100,7 +100,7 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
100100
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
101101
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
102102
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
103-
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
103+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
104104
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
105105
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
106106
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -109,7 +109,7 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
109109
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
110110
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
111111
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
112-
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
112+
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
113113
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
114114
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
115115
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -119,8 +119,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
119119
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
120120
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
121121
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
122-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
123-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
122+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
123+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
124124
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
125125
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
126126
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ def Execute(self, uiapp):
303303
old_all_ele = DB.FilteredElementCollector(
304304
new_doc, legends[0].Id
305305
).ToElements()
306+
ele_id_type = None
306307
for ele in old_all_ele:
307308
if ele.Id != new_legend.Id and ele.Category is not None:
308309
if isinstance(ele, DB.TextNote):
Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: UTF-8 -*-
22
"""Lists all linked and imported DWG instances with worksets and creator."""
3-
import clr
43
from collections import defaultdict
54

65
from pyrevit import revit, DB
@@ -9,19 +8,25 @@
98

109

1110
output = script.get_output()
11+
mlogger = script.get_logger()
1212

1313

1414
def listdwgs(current_view_only=False):
15-
dwgs = DB.FilteredElementCollector(revit.doc)\
16-
.OfClass(DB.ImportInstance)\
17-
.WhereElementIsNotElementType()\
18-
.ToElements()
15+
dwgs = (
16+
DB.FilteredElementCollector(revit.doc)
17+
.OfClass(DB.ImportInstance)
18+
.WhereElementIsNotElementType()
19+
.ToElements()
20+
)
1921

2022
dwgInst = defaultdict(list)
2123

2224
output.print_md("## LINKED AND IMPORTED DWG FILES:")
23-
output.print_md('By: [{}]({})'.format('Frederic Beaupere',
24-
'https://github.com/frederic-beaupere'))
25+
output.print_md(
26+
"By: [{}]({})".format(
27+
"Frederic Beaupere", "https://github.com/frederic-beaupere"
28+
)
29+
)
2530

2631
for dwg in dwgs:
2732
if dwg.IsLinked:
@@ -33,34 +38,56 @@ def listdwgs(current_view_only=False):
3338
output.print_md("####{}".format(link_mode))
3439
for dwg in dwgInst[link_mode]:
3540
dwg_id = dwg.Id
36-
dwg_name = \
37-
dwg.Parameter[DB.BuiltInParameter.IMPORT_SYMBOL_NAME].AsString()
41+
dwg_name = dwg.Parameter[DB.BuiltInParameter.IMPORT_SYMBOL_NAME].AsString()
3842
dwg_workset = revit.query.get_element_workset(dwg).Name
39-
dwg_instance_creator = \
40-
DB.WorksharingUtils.GetWorksharingTooltipInfo(revit.doc,
41-
dwg.Id).Creator
43+
dwg_instance_creator = DB.WorksharingUtils.GetWorksharingTooltipInfo(
44+
revit.doc, dwg.Id
45+
).Creator
4246

43-
if current_view_only \
44-
and revit.active_view.Id != dwg.OwnerViewId:
47+
if current_view_only and revit.active_view.Id != dwg.OwnerViewId:
4548
continue
4649

47-
print('\n\n')
48-
output.print_md("**DWG name:** {}\n\n"
49-
"- DWG created by:{}\n\n"
50-
"- DWG id: {}\n\n"
51-
"- DWG workset: {}\n\n"
52-
.format(dwg_name,
53-
dwg_instance_creator,
54-
output.linkify(dwg_id),
55-
dwg_workset))
56-
57-
58-
selected_option = \
59-
forms.CommandSwitchWindow.show(
60-
['In Current View',
61-
'In Model'],
62-
message='Select search option:'
63-
)
50+
# Get hosted level name
51+
level = revit.doc.GetElement(dwg.LevelId)
52+
level_name = level.Name if level else "N/A"
53+
54+
# Get offset using the Transform
55+
offset_z = "N/A"
56+
offset_z_m = "N/A"
57+
try:
58+
transform = dwg.GetTransform()
59+
if transform:
60+
offset_z = transform.Origin.Z # in feet
61+
offset_z_m = DB.UnitUtils.ConvertFromInternalUnits(
62+
offset_z, DB.UnitTypeId.Meters
63+
)
64+
except Exception as ex:
65+
mlogger.debug(
66+
"Failed to convert offset Z from internal units: {}".format(ex)
67+
)
68+
69+
print("\n\n")
70+
output.print_md(
71+
"**DWG name:** {}\n\n"
72+
"- DWG created by: {}\n\n"
73+
"- DWG id: {}\n\n"
74+
"- DWG workset: {}\n\n"
75+
"- Hosted level: {}\n\n"
76+
"- Offset from level (Z): {} ft ({} m)\n\n".format(
77+
dwg_name,
78+
dwg_instance_creator,
79+
output.linkify(dwg_id),
80+
dwg_workset,
81+
level_name,
82+
offset_z,
83+
offset_z_m,
84+
)
85+
)
86+
87+
88+
selected_option = forms.CommandSwitchWindow.show(
89+
["In Current View", "In Model"], message="Select search option:"
90+
)
6491

6592
if selected_option:
66-
listdwgs(current_view_only=selected_option == 'In Current View')
93+
listdwgs(current_view_only=selected_option == "In Current View")

pyrevitlib/pyrevit/forms/FamilyParameterItemStyle.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<Border x:Name="IsLabeled" Background="{DynamicResource pyRevitAccentBrush}" Height="16" Margin="5,0,0,0" Padding="8,0,8,0" Visibility="Collapsed" CornerRadius="4">
1111
<TextBlock Text="Used as Label" Foreground="White" FontSize="10"/>
1212
</Border>
13+
<Border x:Name="IsAssociated" Background="{DynamicResource pyRevitAccentBrush}" Height="16" Margin="5,0,0,0" Padding="8,0,8,0" Visibility="Collapsed" CornerRadius="4">
14+
<TextBlock Text="Associated to Others" Foreground="White" FontSize="10"/>
15+
</Border>
1316
</WrapPanel>
1417
<ControlTemplate.Triggers>
1518
<DataTrigger Binding="{Binding Path=istype}" Value="True">
@@ -21,5 +24,8 @@
2124
<DataTrigger Binding="{Binding Path=islabeled}" Value="True">
2225
<Setter TargetName="IsLabeled" Property="Visibility" Value="Visible"/>
2326
</DataTrigger>
27+
<DataTrigger Binding="{Binding Path=isassociated}" Value="True">
28+
<Setter TargetName="IsAssociated" Property="Visibility" Value="Visible"/>
29+
</DataTrigger>
2430
</ControlTemplate.Triggers>
2531
</ControlTemplate>

0 commit comments

Comments
 (0)