Scrip to paste values

2.16K viewsScripting

Anyone can share a simple script to paste a value in a given cell in the model?
I tried something like this:
def int Value=3
((CellSelection) |Matrix1::A1:B1|.getSelection(Value)).paste()
I wanted to copy Value into cell A1:B1 from Matrix1

Thanks a lot!!!!!

Asked question

Hi Juan Jose,
Could you be a little more specific?
Are you trying to obtain a value from a cell within the model?
Are you trying to write a script that will set the selected cell to a hard-coded value defined in the script?

If it is the latter, the following script set’s any number of selected cells to a pre-defined hard-coded value in the script. You can set this script to be run using a Hotkey for ease of use:

def int Value = 3
selectedCells.values = Value