json array

json array

sevenfive85
Advocate Advocate
571 Views
3 Replies
Message 1 of 4

json array

sevenfive85
Advocate
Advocate

Hi I am trying to pass some information in notes, can someone please help me correctly format this? Red is what i am trying to add to this array. Is this possible?

 

var machineVariables = { 
"x":135,
"y":136,
             if (tool.number == 999) {
               writeBlock("DO SOMETHING");
               } else {
               writeBlock("DO SOMETHING ELSE");
               }
"z":137
};

0 Likes
572 Views
3 Replies
Replies (3)
Message 2 of 4

boopathi.sivakumar
Autodesk
Autodesk

Hi @sevenfive85 

its not possible to add something like that in array, if you explain what you are trying to achieve then i may able to help you.

 


Boopathi Sivakumar
Principal Technology Consultant

0 Likes
Message 3 of 4

sevenfive85
Advocate
Advocate

Hi thank you for the reply. Can you tell me how I can pluck certain keys in this array? i would like it to look for  "y" and output "y" only do not output "x" or "z"

 

 

sevenfive85_0-1592934177071.png

 

0 Likes
Message 4 of 4

sevenfive85
Advocate
Advocate

can you please tell me how to delete array that return as undefined. thank you

0 Likes