add command "xschem selected_text" to get list of selected text object indexes

This commit is contained in:
stefan schippers 2026-06-01 11:22:20 +02:00
parent b0d9da33f5
commit 25ac9d7e40
2 changed files with 18 additions and 0 deletions

View File

@ -1500,6 +1500,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
If what is not given or set to 'inst' return list of selected instance names
If what set to 'rect' return list of selected rectangles with their coordinates
If what set to 'text' return list of selected texts with their coordinates </pre>
<li><kbd> selected_text</kbd></li><pre>
Return list of selected texts </pre>
<li><kbd> selected_wire</kbd></li><pre>
Return list of selected nets </pre>
<li><kbd> send_to_viewer</kbd></li><pre>

View File

@ -5417,6 +5417,22 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
}
}
}
/* selected_text
* Return list of selected texts */
else if(!strcmp(argv[1], "selected_text"))
{
int n, i, first = 1;
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
rebuild_selected_array();
for(n=0; n < xctx->lastsel; ++n) {
if(xctx->sel_array[n].type == xTEXT) {
i = xctx->sel_array[n].n;
if(first == 0) Tcl_AppendResult(interp, " ", NULL);
Tcl_AppendResult(interp, my_itoa(i), NULL);
first = 0;
}
}
}
/* selected_wire
* Return list of selected nets */