Skip to content

Commit 403e9a0

Browse files
authored
Merge pull request #3373 from Wurschdhaud/fix2409
add optional reload parameter
2 parents 6e5beac + d28dae5 commit 403e9a0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

  • extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools.stack/Links.pulldown/Create Workset For Linked Element.pushbutton
  • pyrevitlib/pyrevit

extensions/pyRevitTools.extension/pyRevit.tab/Project.panel/ptools.stack/Links.pulldown/Create Workset For Linked Element.pushbutton/ws4links_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def main():
1919
"""Main function to create worksets for linked elements."""
20-
my_config = script.get_config()
20+
my_config = script.get_config(reload=True)
2121

2222
set_type_ws = my_config.get_option("set_type_ws", False)
2323
set_all = my_config.get_option("set_all", False)

pyrevitlib/pyrevit/script.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,13 @@ def get_output():
158158
return output.get_output()
159159

160160

161-
def get_config(section=None):
161+
def get_config(section=None, reload=False):
162162
"""Create and return config section parser object for current script.
163163
164164
Args:
165165
section (str, optional): config section name. If not provided,
166166
it will default to the command name plus the 'config' suffix.
167+
reload (bool, optional): forces a reload, in case changes were made.
167168
168169
Returns:
169170
(pyrevit.coreutils.configparser.PyRevitConfigSectionParser):
@@ -173,6 +174,8 @@ def get_config(section=None):
173174
if not section:
174175
script_cfg_postfix = '_config'
175176
section = EXEC_PARAMS.command_name + script_cfg_postfix
177+
if reload:
178+
user_config.reload()
176179

177180
try:
178181
return user_config.get_section(section)

0 commit comments

Comments
 (0)