translated by moderator. Original text below the line.
I have a problem with my dynamo script, I need to retrieve latitude and longitude from my project… It works well in the full Dynamo environment but returns me a null value in the dynamo player…
I do not know how to do
Original text below
J’ai un problème avec mon script dynamo, j’ai besoin de récupérer latitude et longitude de mon projet… Cela marche bien dans l’environnement Dynamo complet mais me renvoie une valeur nulle dans le player dynamo…
Je ne sais pas comment faire
Welcome to the forum @hugoracine1234!
Note that the forum language is English, and as such we need posts translated as I did above in the future. Unfortunately this is a requirement for search to work, annars skulle jag bara prata svenska (for practice anyway).
I can’t recreate this issue, perhaps because my Dynamo graph is different from yours or because I am in a different Revit version. Please post the dynamo graph and let us know which Revit version you’re using. This way someone can look into it for you.
Thank you for your answer, I attach the screenshots, I use the latest versions of revit and dynamo
and the screenshot of the player dynamo
Assuming this dynamo graph is the coordinates file, can you click on it in player? Or is that window non-responsive?
my script is called “test 2” it runs correctly but does not return my coordinates, it returns “null” as if the location of my project does not exist when launching it from the Dynamo player
I’ll try to reproduce again later today.
Hi @hugoracine1234 ,
Personally I have encountered that when I had my Excel-file opened before running the graph that it wouldn’t work.
By the way, is there any specific reason you are exporting it to Excel? You could also attach a (renamed) watch node and tag it as “Is Output” such that you can see it directly in the Dynamo Player.
My problem is not excel, the problem comes from the dynamo launcher which does not give me the latitude and longitude of the places to which the project is referenced. while DYNAMO gives me this data… even with a “WATCH” node it shows me null
This script is a small part that I used to illustrate my problem, in my script I need to retrieve latitude and longitude and export this data to EXCEL to use it later…
I can’t link my DYN file because I’m new to the forum…
No problem, I can recreate it quite easily from your post above.
What version of Revit (+ Hotfix i/a) are you using?
Hi @hugoracine1234 & @jacob.small ,
I am getting some really, really weird results. When I try to get the SiteLocation information in Revit 2023 through the Dynamo Player I am getting 0 for both latitude and longitude, even though they aren’t.
After I open the Dynamo graph and run the script through the player again I get correct results, see the gif below:
PS: Couldn’t reproduce this issue in Revit 2022
I’m glad to see it’s not just on my side
Does that mean it’s a revit 2023 bug…?
Yeah I think that is the case. I am currently trying to retrieve the data through API with Python to see if that works, give me a minute.
Ha! That seems to work
from Autodesk.DesignScript.Geometry import *
# Import DocumentManager and TransactionManager
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import RevitAPI
from Autodesk.Revit.DB import *
# Import python library
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
site = doc.SiteLocation
site = doc.SiteLocation
angleRatio = math.pi / 180;
OUT = site.Latitude / angleRatio, site.Longitude / angleRatio
Based on the following threads: Extract GIS Coordinate System - #3 by Andrew_Hannell & Get Time Zone - #2 by stillgotme
2023-04-03 Export Site Latitude and Longitude.dyn (14.0 KB)
@jacob.small where should we report this bug?
I put it in front of the dev team via internal channels; don’t think we have a Dynamo Player github to log to… (could be wrong but I am not seeing one at the moment). Feel free to submit a support case, but I think Lilli and Team are already aware of the issue, just trying to figure out what exactly the issue is…
We hear you! Will log this. Thanks much for bringing it to our attention.