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

[Bug] Python node: Specifically importing 'FilteredElementCollector' causes hang #8931

Closed
Amoursol opened this issue Jun 15, 2018 · 6 comments
Labels
1.x Issues related to 1.x versions of Dynamo. 2.x Issues related to 2.x versions of Dynamo. bug DidNotFix Issues that were closed based on a 1 year look back that may still be relevant to implement/fix.

Comments

@Amoursol
Copy link
Contributor

Amoursol commented Jun 15, 2018

If this issue is with Dynamo for Revit, please post your issue on the Dynamo for Revit Issues page.

If this issue is not a bug report or improvement request, please check the Dynamo forum, and start a thread there to discuss your issue.

Dynamo version

Tested in both Dynamo versions 1.3.3 and 2.0.1

Operating system

Windows 10

Reproducible issue

Tried to specifically import the FilteredElementCollector as follows with annotation:

import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import FilteredElementCollector

This works, but as soon as you use a period (dot) anywhere in the Python text editor if you have annotation, it causes hang-time anywhere from 5 seconds onwards (Has caused apparent crashes - but I got lazy and stopped waiting).

# Importing Reference Modules
import clr # CLR ( Common Language Runtime Module )
clr.AddReference("RevitServices") # Adding the RevitServices.dll special Dynamo module to deal with Revit
import RevitServices # Importing RevitServices
from RevitServices.Persistence import DocumentManager # From RevitServices import the Document Manager
clr.AddReference("RevitAPI") # Adding the RevitAPI.dll module to access the Revit API
import Autodesk # Here we import the Autodesk namespace
from Autodesk.Revit.DB import FilteredElementCollector, Wall # From the Autodesk namespace - derived down to the Revit Database, we imoprt only the Filtered Element Collector and Wall classes

# Here we give the Revit Document a nickname of 'doc' which allows us to simply call 'doc' later without having to type the long namespace name 
doc = DocumentManager.Instance.CurrentDBDocument

# To create a Filtered Element Collector, we simply type the PINK part of RevitAPIDocs ( FilteredElementCollector ), wrap it inside of Parenthesis and then call the ORANGE part of RevitAPIDocs ( Document ). If we don't specify a particular filter over this ( And we choose the 'OfClass' one here ) it will return an error as showcased in 01 - so we simply want to run our chosen filter with the Class of 'Wall' through it.
wallCollector = FilteredElementCollector( doc ).OfClass( Wall )

# To get our results back inside of Dynamo, we need to append a list to the OUT port
OUT = wallCollector

If I do not have the annotation on the same line as the import, it functions correctly. It also appears to only be the FilteredElementCollector, if I change to to an asterisk ( * ) to bring in everything we don't get the issue.

There is also no change if I import only the FilteredElementCollector, or have multiple classes called separated by a comma.

dynamo_python_hangissue

@Amoursol
Copy link
Contributor Author

Amoursol commented Jun 15, 2018

Any thoughts @Dewb @mjkkirschner @aparajit-pratap ?

@dimven
Copy link
Contributor

dimven commented Jun 18, 2018

This is exactly the behavior that I reported and am trying to solve with #8420

@johnpierson johnpierson added bug 1.x Issues related to 1.x versions of Dynamo. 2.x Issues related to 2.x versions of Dynamo. labels Sep 18, 2018
@johnpierson
Copy link
Member

#9402 related.

@johnpierson
Copy link
Member

Perhaps, @alfarok can confirm if this was resolved in PR #9402 ?

@alfarok
Copy link
Contributor

alfarok commented Apr 24, 2019

Hey @johnpierson, I looked into a similar issue reported by @jnealb regarding autocomplete hanging when the dot notation was initiated that was fixed by the PR you referenced. We would have to test this scenario as well but it's likely it may have been addressed.

@Amoursol
Copy link
Contributor Author

Thank you for the submission of this Issue above - We very much do appreciate your time taken to look to improve Dynamo and help it grow and evolve into the future.

In order to better serve the active Dynamo user base and the evolving nature of Dynamo, the Dynamo team has made the decision to close any issue that hasn't had activity since 1st January 2019. This doesn't mean that these issues will not be addressed, but just that they are not being actively worked on as they do not align with our current Dynamo Public Roadmap.

If this issue is still relevant to you and your workflows, please do re-submit in a new Github Issue and link to this closed issue for historical context.

Many thanks,
The Dynamo Team

@Amoursol Amoursol added the DidNotFix Issues that were closed based on a 1 year look back that may still be relevant to implement/fix. label May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x Issues related to 1.x versions of Dynamo. 2.x Issues related to 2.x versions of Dynamo. bug DidNotFix Issues that were closed based on a 1 year look back that may still be relevant to implement/fix.
Projects
None yet
Development

No branches or pull requests

4 participants