diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/bundle.yaml b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/bundle.yaml new file mode 100644 index 000000000..b5e6ae747 --- /dev/null +++ b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/bundle.yaml @@ -0,0 +1,30 @@ +title: + fr_fr: |- + Déplacer le Titre de la Fenêtre + en_us: |- + Move Viewport Label + de_de: |- + Verschieben des Fenstertitels + ru: |- + Переместить метку окна + +tooltip: + fr_fr: |- + Déplacer le Titre de la Fenêtre + https://discourse.pyrevitlabs.io/t/i-developed-a-tool-need-help-to-get-it-into-the-new-release-of-pyrevit/7639/3 + en_us: |- + Move Viewport Label + https://discourse.pyrevitlabs.io/t/i-developed-a-tool-need-help-to-get-it-into-the-new-release-of-pyrevit/7639/3 + de_de: |- + Verschieben des Fenstertitels + https://discourse.pyrevitlabs.io/t/i-developed-a-tool-need-help-to-get-it-into-the-new-release-of-pyrevit/7639/3 + ru: |- + Переместить метку окна + https://discourse.pyrevitlabs.io/t/i-developed-a-tool-need-help-to-get-it-into-the-new-release-of-pyrevit/7639/3 + +authors: + - Tim Hevel + - Jean-Marc Couffin (C# to python and refactor) + +min_revit_version: 2022 +context: active-sheet diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/icon.dark.png b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/icon.dark.png new file mode 100644 index 000000000..070a7b7b3 Binary files /dev/null and b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/icon.dark.png differ diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/icon.png b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/icon.png new file mode 100644 index 000000000..cb98964a0 Binary files /dev/null and b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/icon.png differ diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/script.py b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/script.py new file mode 100644 index 000000000..de2f7cd9a --- /dev/null +++ b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/Move Viewport Label.pushbutton/script.py @@ -0,0 +1,22 @@ +# encoding: utf-8 +# from https://discourse.pyrevitlabs.io/t/i-developed-a-tool-need-help-to-get-it-into-the-new-release-of-pyrevit/7639/3 + +from pyrevit import DB +from pyrevit.revit import pick_point, pick_element_by_category, Transaction +from pyrevit.forms import alert + + +def move_viewport_label(viewport, point): + viewminpoint = viewport.GetBoxOutline().MinimumPoint + new_label_location = point - viewminpoint + viewport.LabelOffset = new_label_location + + +if __name__ == '__main__': + selected_point = pick_point("Select a point") + selected_viewport = pick_element_by_category(DB.BuiltInCategory.OST_Viewports, "Select a viewport") + if selected_point is not None and selected_viewport is not None: + with Transaction("Move Label to Point"): + move_viewport_label(selected_viewport, selected_point) + else: + alert("Invalid selection. Please try again.") diff --git a/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/bundle.yaml b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/bundle.yaml index e1c529b47..b8347b357 100644 --- a/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/bundle.yaml +++ b/extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/views.stack/Views.pulldown/bundle.yaml @@ -21,6 +21,7 @@ layout: - Match Title on Sheet in Open Docs - Create Parallel Section - Add Views to Sheets + - Move Viewport Label - Remove Underlay From Selected Views - ----- - Set View Template Controlled Parameters