<@U01819B63HP> is there a limit in how long I can write a TCL command? When I run a big command it s...
b
@Stefan Schippers is there a limit in how long I can write a TCL command? When I run a big command it says it's missing brackets and the command lines are incomplete.
s
If there is any line length limit it is quite large. For long commands be careful to balance all the brackets and quoting characters.
b
It seems it's not large enough... 🤔. I wrote a 150 lines code to run on tcl_command and it only read about 120 lines
Btw, is there a way to automatically run a script when a schematic is open?
s
For big commands write a tcl procedure: create a file
script.tcl
, write the procedure in it:
Copy code
proc my_procedure {param1 param2} {
  puts "param1 is: $param1"
  puts "param2 is: $param2"
}

##optional: execute the procedure
my_procedure aaaa bbbb
Then at the xschem prompt source the file:
source script.tcl
If you want to source the script.tcl automatically when xschem is opened add this line in your xschemrc:
lappend tcl_files /path/to/your/script.tcl
You can also specify the script file on command line:
xschem --script script.tcl