Utility fuctions to support smart modules.

pyrevit.coreutils.moduleutils.collect_marked(module_obj, prop_name)

Collect module objects that are marked with given property

pyrevit.coreutils.moduleutils.copy_func(func, func_name, doc_string=None, arg_list=None)

Copy a function object to create a new function.

This is used inside smart modules that auto-generate functions based on context.

  • func (object) – python source function object
  • func_name (str) – new function name
  • doc_string (str) – new function docstring
  • arg_list (list) – list of default values for function arguments

new python function objects

Return type:


pyrevit.coreutils.moduleutils.filter_kwargs(function_obj, kwargs)

Filter given arguments dict for function_obj arguments

pyrevit.coreutils.moduleutils.has_any_arguments(function_obj, arg_name_list)

Check if given function object has any of given arguments

pyrevit.coreutils.moduleutils.has_argument(function_obj, arg_name)

Check if given function object has argument matching arg_name


Decorator function to add a marker property to the given type