Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Tools: Set legend component orientation #1743

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue 3D
en_us: Set Legend Component to 3D orientation
tooltip:
fr_fr: Vue 3D du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component 3D view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -3
orientation = '3D view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue Arrière
en_us: Set Legend Component to Back orientation
tooltip:
fr_fr: Vue Arrière du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Back view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -6
orientation = 'Back View'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue de Dessous
en_us: Set Legend Component to Down orientation
tooltip:
fr_fr: Vue de Dessous du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Down view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -4
orientation = 'Bottom view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue Avant
en_us: Set Legend Component to Front orientation
tooltip:
fr_fr: Vue Avant du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Front view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -7
orientation = 'Front view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue de Gauche
en_us: Set Legend Component to Left orientation
tooltip:
fr_fr: Vue de Gauche du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Left view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -10
orientation = 'Left view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue de Droite
en_us: Set Legend Component to Right orientation
tooltip:
fr_fr: Vue de Droite du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Right view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -9
orientation = 'Right view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue de Coupe
en_us: Set Legend Component to Section orientation
tooltip:
fr_fr: Vue en Coupe du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Section view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -5
orientation = 'Section view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title:
fr_fr: Orienter le composant de légende sur la vue de Dessus
en_us: Set Legend Component to Top orientation
tooltip:
fr_fr: Vue de Dessus du composant de légende !!! Tous les composants de la légende ne supportent pas n'importe quel type d'orientation de vue !!!
en_us: Legend Component Top view !!! Not all legend components support any type of view orientation !!!
author: Jean-Marc Couffin
context: selection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pyrevit import revit, DB, script, forms

output = script.get_output()
output.close_others()

elements = revit.get_selection()

forms.alert_ifnot(len(elements) > 0, 'Please select at least one legend component.', title='Legend component orientation view setter', exitscript=True)

i = -8
orientation = 'Top view'

with revit.Transaction('Set Legend Component View to {}'.format(orientation), show_error_dialog=True):
for element in elements:
try:
element_param = element.get_Parameter(DB.BuiltInParameter.LEGEND_COMPONENT_VIEW)
element_param.Set(i)
except:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ layout:
- Convert Legend to Drafting
- -----
- List Legends on Sheets
- -----
- 3D
- Section
- Top
- Bottom
- Left
- Right
- Front
- Back