Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change content of grid row via script (updated)

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
AstroRossD
529 Views, 3 Replies

Change content of grid row via script (updated)

I need some help with coding a script to clone the last row of a grid. I've been through the scripting reference and several posts on the forum but I can't get the script to work.

 

I can create the new row but I'm having trouble extracting the data from the previous row. I can extract the data from a specific row e.g. item.grid[1] but I need to do this with the most recent row.

 

Can anyone post up an example of how to do this? I've tried using item.grid.length but I get a Cannot read property "FIELD" from undefined error.

 

Thanks in advance,
Ross

Tags (2)
3 REPLIES 3
Message 2 of 4
AstroRossD
in reply to: AstroRossD

Well, I think I've done it:

 

var gridlength = item.grid.length;

item.grid[gridlength-1]

 

Next question, how do I change the content of a field in the previous row of the grid from "LIVE" to "SUPERSEDED"?

 

Thanks,

Ross

 

 

Message 3 of 4
tony.mandatori
in reply to: AstroRossD

For Editting, here is an example that works with out-of-the-box change orders

 

item.grid[0].QUANTITY_ON_HAND=10

 

Adding is little different.

 

To get the previous row, use length-2.

Message 4 of 4
AstroRossD
in reply to: tony.mandatori

I knew I wasn't far off!

 

Thanks Tony

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report