hexagon logo

Fetch assignments from file

The code below retrieves lines from a textfile and adds the contents of the lines read as assignments to your active partprogram.

Best way to use it would be to assign it to an icon on the PC-DMIS toolbar and have the cmds.txt in the active partprograms folder. Click the icon and the definitions in cmds.txt will be added to your active partprogram.

Format of cmds.txt:
[COLOR="Blue"]<VARIABLE_NAME>[/COLOR][COLOR="Red"]$[/COLOR][COLOR="SeaGreen"]<VARIABLE_VALUE>[/COLOR]

ie.

[COLOR="Blue"]V1[/COLOR][COLOR="Red"]$[/COLOR][COLOR="SeaGreen"]"I am a string"[/COLOR]
[COLOR="Blue"]V2[/COLOR][COLOR="Red"]$[/COLOR][COLOR="SeaGreen"]123.456[/COLOR]
[COLOR="Blue"]DIMEN10[/COLOR][COLOR="Red"]$[/COLOR][COLOR="SeaGreen"]DIM10.MEAS[/COLOR]


Should add this to your partprogram:

ASSIGN/V1="I am a string"
     ASSIGN/V2=123.456
     ASSIGN/DIMEN10=DIM10.MEAS


The script:

REMOVED


As always, feel free to tweak it to your own liking.

Enjoy!