Writing command scripts
Instead of writing AutoCAD commands directly in a text file you type them into the right part of a spreadsheet, always starting in colum M.
Each row will become a line in the actual script file and will only be written to the file if the preceding value in column L is something else then FALSE.
Combining spreadsheet calculations
The left part of the scriptsheet is free to calculate values of your liking in practice mainly X and Y coördinates, angles or distances. Which of course are referenced in the cells where you write AutoCAD commands.
There is also a parameter-sheet in the workbook which is meant to specify input values.
The blackbord-sheet -in the midle of the parameter-sheet and one or more scriptsheets- is a sheet to make common calculations. Usefull when you have more than one scriptsheet in the workbook and don’t want to make the same calculations a second time.
Adding program flow
The Scriptsheets Add In will expose a new command in the Add-In tab of the Excel Ribbon.
This command walks down the active spreadsheet – one row at a time – and reads all text in the right part of the spreadsheet begining in column M.
When it finds the word START it will open an empty scriptfile and start processing what it reads until it finds the word STOP.
Other than just AutoCAD commands -which are directly written to the script file- rows can contain program flow statements like GOTO and RETURN forcing the Add In to make a jump and continue processing at an other row.
Also the statements FOR and NEXT can be used to forcing the group of rows between them to be processed more than once.