I’m needing some help with a script I created to map the XYZ coordinates from the survey point to Structural Foundations parameters. The process currently runs fine with no visible errors; however, after interogating the coordinate values, some are incorrect. I’m not sure why this would be and what i’ve done wrong.
Here is one example I found where i ran the script and it doesn’t show the correct numbers. It’s obviously quite important that every pile needs to be correct, since I can’t be checking 200 piles for accuracy.
Also btw to avoid confusion I would swap the eastings and northings in the label, eastings should be given first. And preferably change units to metres with 3 decimal places.
Revit API will report location values relative to the internal origin, not your survey point or project base point. This means the XYZ locations are not necessarily starting from the same calculation point (in fact they won’t be by default), nor will the orientation of the survey/project be taken into account (the north angle issue which @willyoungMF8K3 pointed out).
You can confirm if this is the issue by changing to a tag which uses the internal origin as a base point. If so, you’ll need to transform your coordinates accordingly.
That said, Element.Location+ might be attempting to account for these issues - I don’t know if that’s the case as I don’t use the node. Element.Location + the relative transforms should do the trick.
My apologies, the original screenshot was an older version, But the dyn file contained this. It has a conversion from the base internal origin which revit uses, into the survey point system. -but still didnt get all of them correct.
I will take a look at the rotation from north as per @willyoungMF8K3 comment. Also, we use mm for coordinates in our schedules here (not sure why, but its the standard).
I did have a play around with the selection of the elements, I swapped in a ‘Select Model Elements’ node and just highlighted all the piles. This seemed like it resolved it for now, I checked a bunch of piles. So i’m not sure if there is a problem with the category node.