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
CPython Interface Implementation failed #686
Comments
Great find with the I'm going to add a class CategoriesFilter(UI.Selection.ISelectionFilter):
__namespace__ = __commanduniqueid__ + __timestamp__ Keep us posted on your findings please. |
Okay implemented timestamp and execid (unique id for each execution). The code can be simplified as from pyrevit import EXEC_PARAMS
class CategoriesFilter(UI.Selection.ISelectionFilter):
__namespace__ = EXEC_PARAMS.exec_id or less safer but with not from pyrevit import EXEC_PARAMS
class CategoriesFilter(UI.Selection.ISelectionFilter):
__namespace__ = __execid__ Will publish this soon with 4.7-beta3 |
I don't know much about underlying Python Engine of .NET. I just don't know if appending timestamp is proper way to do it, or it would polute the namespace or raise memory etc. Anyways, I attach markdown writeup below: |
Send me your info so I can add as part of Community |
I've emailed you my info. Thanks! |
@eirannejad I've read your commit above (0073bbc), I'd like to add that IronPython works fine without |
Describe the bug
I implemented an
ISelectionFilter
interface in my script and use it foruidoc.Selection.PickObjects
. Here is my script:Note that in order to run the script without exception, I had to append
time.time()
to my class'__namespace__
. If I didn't do that, I would get this exception:To Reproduce
Steps to reproduce the behavior:
__namespace__ = 'HTL'
uncommentedExpected behavior
Script run without exception. Is there any method to avoid recreation of classes (or to override them) if they already exist in certain namespace?
Desktop
The text was updated successfully, but these errors were encountered: