From ba02fa336bcae905687307c0166fb61850b8b954 Mon Sep 17 00:00:00 2001 From: Kejun Luo Date: Mon, 2 Jan 2023 17:13:00 +0100 Subject: [PATCH 01/11] modified cls structure init room helper --- .../AreaHelper_script.py | 2 +- .../RoomHelper_script.py | 35 + .../RoomHelper.pushbutton/icon.png | Bin 0 -> 8683 bytes .../RoomHelper.pushbutton/ui.xaml | 197 ++++++ Revitron.tab/Qualitron.panel/bundle.yaml | 1 + lib/qualitron/__init__.py | 2 +- lib/qualitron/areas.py | 380 ----------- lib/qualitron/parameter.py | 9 +- lib/qualitron/rooms.py | 87 +++ lib/qualitron/spaces.py | 608 ++++++++++++++++++ lib/qualitron/ui.py | 203 +++++- 11 files changed, 1123 insertions(+), 401 deletions(-) create mode 100644 Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/RoomHelper_script.py create mode 100644 Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/icon.png create mode 100644 Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/ui.xaml delete mode 100644 lib/qualitron/areas.py create mode 100644 lib/qualitron/rooms.py create mode 100644 lib/qualitron/spaces.py diff --git a/Revitron.tab/Qualitron.panel/AreaHelper.pushbutton/AreaHelper_script.py b/Revitron.tab/Qualitron.panel/AreaHelper.pushbutton/AreaHelper_script.py index e528612..5c21685 100644 --- a/Revitron.tab/Qualitron.panel/AreaHelper.pushbutton/AreaHelper_script.py +++ b/Revitron.tab/Qualitron.panel/AreaHelper.pushbutton/AreaHelper_script.py @@ -13,7 +13,7 @@ # Select areas function if selection: - areaIds = AreaHelperManager.selectAreas(selection) + areaIds = AreaHelperManager.selectTargets(selection) if areaIds: count = str(len(areaIds)) decide = ui.TaskDialog.Show("AreaHelper","Select " + count + " area(s)?", diff --git a/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/RoomHelper_script.py b/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/RoomHelper_script.py new file mode 100644 index 0000000..e528612 --- /dev/null +++ b/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/RoomHelper_script.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +import revitron +import pyrevit +from qualitron import AreaHelperManager,AreaHelperWindow +import Autodesk.Revit.UI as ui + +if __name__ == "__main__": + + xamlfile = pyrevit.script.get_bundle_file("ui.xaml") + selection = revitron.Selection.get() + runWindow = True + + # Select areas function + if selection: + areaIds = AreaHelperManager.selectAreas(selection) + if areaIds: + count = str(len(areaIds)) + decide = ui.TaskDialog.Show("AreaHelper","Select " + count + " area(s)?", + ui.TaskDialogCommonButtons.Yes| + ui.TaskDialogCommonButtons.No + ) + if decide == ui.TaskDialogResult.Yes: + runWindow = False + revitron.Selection.set(areaIds) + + # If no selection, show window + if runWindow: + revitron.DOC.MassDisplayTemporaryOverride = revitron.DB\ + .MassDisplayTemporaryOverrideType\ + .ShowMassFormAndFloors + main = AreaHelperWindow(xamlfile, + AreaHelperManager()) + main.Show() + diff --git a/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/icon.png b/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1672154604645be22f5f18aafadb1b4435042c5a GIT binary patch literal 8683 zcmd6N2{@Gd+y9`lCoPr=V^TEHqr#X4H4A2BD^#|!bSy1G2$ePa8cGt` ziik?iA&n*JSW<}hq2-+4`=0YV=X&4wdjJ2q%skJ0zxQ+R_x-uQb2)Eu$WUBly9fvb z5;ry?S^`(+)wj?F;B)Az4-U8pdl->8Ake{))i=5ojY|gmG8rrm!B-2i#+LxxuP(zN;58EN2`z~3sz9*4nFUy% z?L`A?sAHfM1X=@(#j7JQC^R0w4~&E(a41km)W2~3Y4Y+0OdZUP(z^Cf%05bE$%lhz2Slpk~+-d>C~;ZzEY z#-K52EG`G2Mf{-kaAR}X95?n~u>P_AF9HD9nwkBO@u#{lnLk8uxCc%GW_)wVpHg$I z{XA$eOB#pm?M0y-I0>k^>$^1^t|jevfBu8V0rDRYbKU8G@$Bl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lMh9E1G+RVLI&W^){3VI!; z-f>?hO+UYU$bNkm@{1rPO5wvVR%(`yfC%PqEp-ctPJHtrT=#>b$Z=q1X}=J?e6-|g zwR@!Ek~TP+I7 z)S!;eBl~NhLKsNz)~I-7Rj-9!qTLR&z~ZI}u9U*Z+s|3VcHrj*Ac9}uAOf;wLz!~; zBF9lDWnqVc)dBrWHZTB})SK-2qkewb&U*0~!j-hWh-$jLolLo6dHfxoQbHLA4#V8* z*rsQp5$ruN)*NK+`u^&Ew*f{}e^+}oFYsB_*%bj9;rULXT*1cGf5$LBaEMr-=X~}* E01s4IZU6uP literal 0 HcmV?d00001 diff --git a/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/ui.xaml b/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/ui.xaml new file mode 100644 index 0000000..8eea0c3 --- /dev/null +++ b/Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/ui.xaml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +