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
Wish: Access Dynamo's Package Paths from Python #71
Comments
@mostaphaRoudsari - Great idea. In the meantime, have a look at how this was solved for BumbleBee package: ksobon/Bumblebee#15 |
Hello @mostaphaRoudsari, We don't currently have a stable way to access the Dynamo document to pull the Package Directories path (i.e part of the DynamoServices.dll) - but you can do so, at risk and unsupported, in the following way:
|
Hi @Amoursol, This is very helpful. Can you tell me what are the possible risks involved? Also do I need a specific minimum version of Dynamo for this to work? |
@mjkkirschner or @QilongTang would be better suited to answer this question 😊 |
@mostaphaRoudsari @Amoursol Traced back, it was added five years ago, so pretty much all major versions we are supporting right now, 1.3.x and 2.x.x |
Thank you @QilongTang. One follow up question. I assume this will not work in Dynamo-core (is this what you call it?). Or is there a similar call that I can use to get the packages in DynamoCore? The differences between DynamoRevit and DynamoCore has been an issue for us. |
What is risky is by accessing a property of the application during graph execution it's not guaranteed to be up to date - it's also not expected that these package directories would ever be modified during graph execution... Only on from the UI or from an extension etc. It will work for DynamoRevit only - the reason it works is becasue |
The better solution here is for us to add an API to dynamoServices which is safe to consume from a node - likely just the getter for the package directories, which would be accessible easily during graph execution from any node by referencing a static property in DynamoServices. |
Hi @mjkkirschner, I prefer to wait for the second solution which should work for both DynamoRevit and DynamoCore. @Amoursol if this is something that you can include in an upcoming release we will be happy to test it for you. This will also help us to do a new release of our Dynamo packages so at least they work as they are. |
Hello @mostaphaRoudsari - This has been added to our backlog. |
Please see related PR. |
@mjkkirschner, thanks. Do we know from which version of Dynamo this will be available? |
as of now, this code has been merged to trunk which is currently 2.8. |
Hello @mostaphaRoudsari - Have you had a chance to check this in a daily build? |
Hi, any updates on this? thanks |
Hello @mikkelvangsgaard - This is now part of |
Great! Thank you @Amoursol |
Following up from this discussion on the forum.
I'm looking for a call from inside python node to access package path(s)? It will save me an other developers who are loading the libraries from package folder a lot of duplicated code and also ensures that we can have access to the libraries even if the user installs them in a custom folder.
cc: @mjkkirschner
labels: wish, python
The text was updated successfully, but these errors were encountered: