|
POST
|
One thing to add to list: I've learned that a significant con to attribute rules is: We can't develop scripts in a proper IDE -- and test them right there in the IDE. I've installed VS Code so that I can lint scripts -- using the JavaScript linter. And I've installed node.js so that I can run the scripts. But that's just barely useful, because there are quite a few differences between Arcade and node.js scripts. So I have to make lots of modifications to my Arcade to get it to run as node.JS. So it ends up being pretty horrible jumping back and forth between ArcGIS Pro and VS Code. Whereas we don't have that problem with SQL Triggers. We can develop in a IDE like Oracle SQL Developer, Toad, etc...and it all works as expected. That's not a total deal breaker. Lots of people use calculation attribute rules successfully -- even without an IDE. I just thought I'd add it to the list, since it's something that's causing me trouble at the moment.
... View more
03-04-2022
09:46 PM
|
0
|
0
|
8214
|
|
IDEA
|
Could Esri consider adding a segmentAlongLine() function to Arcade? segmentAlongLine (start_measure, end_measure, {use_percentage}) Returns a Polyline between start and end measures. That would be quite helpful. Otherwise, it takes a few pages of code to do that in Arcade.
... View more
03-04-2022
08:52 PM
|
4
|
0
|
444
|
|
IDEA
|
Idea: (edited using input from @jcarlson) The diagnostic logs in ArcMon are great, but it seems like an unnecessarily complicated way to view something that, in other contexts, is simply another window or tab in the expression builder. A simple window would be awesome. And maybe not just an "Arcade Console" window, but a tabbed "Logs" window. The different categories of logs appear as tabs as needed. Maybe we could get a logs tab that captures Arcade Console() messages as well as messages from Python and GeoProcessing. As it stands, if I'm looking for feedback on the things I'm doing in Pro, there are a number of disparate tabs / panels / popup windows to look for to see these. Old idea: When developing and testing attribute rules: Would it be possible to view log info when the rule gets executed? https://i.stack.imgur.com/KmGZP.png
... View more
03-04-2022
03:17 PM
|
1
|
6
|
2533
|
|
IDEA
|
Could Arcade or JS linting be added to the Expression section in the Expression builder?
... View more
03-04-2022
02:59 PM
|
1
|
0
|
591
|
|
IDEA
|
In the Attribute Rule pane: Could a button be added that would let us view the code in a full-screen window?
... View more
03-04-2022
02:51 PM
|
0
|
1
|
797
|
|
IDEA
|
In the Expression Builder window: It would help if we could vertically resize sections — so that the Expression section could be made bigger. Edit: It's handy that we can double-click the "Expression Builder" title to maximize the entire window. In addition to that, we want to make the Expression section bigger so that we can see more of our Arcade code. Thanks!
... View more
03-04-2022
02:36 PM
|
5
|
9
|
2609
|
|
IDEA
|
Related: Compare pre-edit geometry with edited geometry
... View more
03-04-2022
01:38 PM
|
0
|
0
|
6886
|
|
POST
|
Esri has a calculation attribute rule expression on GitHub called Set Ms to Index. The script loops through polyline vertices and updates the M-Values. var current_line_geo = Geometry($feature);
var line_geo = Dictionary(Text(current_line_geo));
var paths = line_geo['paths'];
for (var path_idx in paths){
for (var vert_idx in paths[path_idx]){ That script works, but I'm having trouble understanding all the prep work that's involved -- for converting the feature's geometry into an array: Feature —> Geometry —> Text —> Dictionary (type) —> Paths array (array is a key/value pair within dict) That seems like a lot of overhead just to get at the vertices. Would someone be able to explain why all of those steps are needed — or if it can be simplified? Thanks!
... View more
03-04-2022
01:35 PM
|
1
|
7
|
5002
|
|
POST
|
I'm attempting to use the JS from this post — in an Arcade calculation attribute rule: Code Review: Modify Polyline Vertices That script uses the following for loop: //This script works as standalone JS: https://jsfiddle.net/x4su7tna/ var paths = [[[0,5,null],[10,10, null],[30,0, null],[50,10, null],[60,10, null]]] for (var path of paths) { return } ERROR 002717: Invalid Arcade expression, Arcade error: Syntax error in for loop, Script line: 32760 I get that error when I try to save the attribute rule. I think the for loop is the culprit: for (var path of paths) { If I replace that for loop with for (var path_idx in paths) { , then I can successfully save: var paths = [[[0,5,null],[10,10, null],[30,0, null],[50,10, null],[60,10, null]]] for (var path_idx in paths) { return } Question: Why do I get an error when I use for (var path of paths) { ?
... View more
03-04-2022
08:18 AM
|
0
|
1
|
1035
|
|
POST
|
Yes! That worked! I used the folder option you mentioned. Thanks! Related: Idea: Arcade Extension for Visual Studio Code
... View more
03-03-2022
07:03 PM
|
0
|
0
|
3272
|
|
POST
|
When writing Arcade scripts, I think it would be helpful to do testing in an IDE beforehand, if the script doesn't use any Arcade-specific functions (or if it does, temporarily remove/fake out those parts). For example, define a polyline array manually... var paths = [[[0,5,null],[10,10, null],[30,0, null],[50,10, null],[60,10, null]]] ...loop through the vertices, do some stuff, and output results as text. So, I want to use VS code to do that testing...by running the Arcade expression as if it were JavaScript . I know Arcade isn't the same thing as JS, but I think it's close enough for the testing I want to do. Question: Has anyone had any success running basic JS scripts in VS Code? That might be a dumb question, but I really have no idea where to start. Unlike Python, it doesn't seem like you can just type some JS like console.log('Hello World'); and then run the code to output some text. I tried searching the web and I got a bunch of results about node.js -- which I have installed. Unfortunately, I still can't figure out how run a basic script, such as print "Hello World". Would someone be able to point me in the right direction? Thanks.
... View more
03-03-2022
10:29 AM
|
0
|
3
|
3305
|
|
POST
|
I found this post just now, which confirms what @JohannesLindner mentioned. Where do the Arcade Console messages go to?
... View more
03-03-2022
07:10 AM
|
0
|
0
|
4026
|
|
POST
|
In an Arcade attribute rule: Is there a way to compare a feature's geometry before the edit was made... vs. ...the edited geometry? Example: If the pre-edit geometry is different from the edited geometry, then do x to the geometry. Else, do nothing. Related: Attribute Rules: Update only on geometry change I was hoping I'd be able to use $feature.shape as to get the pre-edit geometry. But that failed. Which is weird, because I can use $feature.shape_length without issue.
... View more
03-03-2022
07:05 AM
|
0
|
2
|
1667
|
|
POST
|
Side question: In your post, it looks like you are sending an output to the console(). Out of curiosity, what are you doing there? Where are you displaying that value? Thanks.
... View more
03-03-2022
06:12 AM
|
0
|
4
|
4037
|
|
POST
|
Related: What is the hierarchical structure of the ArcPy Geometry class?
... View more
03-03-2022
05:14 AM
|
0
|
0
|
1240
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-20-2026 02:12 PM | |
| 1 | 03-19-2026 11:42 AM | |
| 1 | 06-03-2026 04:02 AM | |
| 1 | 03-18-2026 07:08 PM | |
| 2 | 2 weeks ago |