diff --git a/doc/xschem_man/developer_info.html b/doc/xschem_man/developer_info.html index d600ee07..e28391aa 100644 --- a/doc/xschem_man/developer_info.html +++ b/doc/xschem_man/developer_info.html @@ -853,7 +853,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns" return result of get_cell_w_ext function
  • get_fqdevice instname param modelparam
  •     get the full pathname of "instname" device
    -   modelparam: 
    +   modelparam:
          0: current, 1: modelparam, 2: modelvoltage
        param: device parameter, like ib, gm, vth
        set param to {} (empty str) for just branch current of 2 terminal device
    @@ -899,8 +899,9 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        Get attribute 'attr' of rectangle number 'num' on layer 'layer'
           
            getprop text num attr
    -   Get attribute 'attr' of text number 'num'
    -   if attribute is 'txt_ptr' return the text
    +   Get attribute 'attr' of text number 'num', 'num' can also be the name attribute 
    +   of the text object
    +   if 'attr' is 'txt_ptr' return the text string
           
            getprop wire num attr
        Get attribute 'attr' of wire number 'num'
    @@ -947,7 +948,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        Highlight instance 'inst'
            if '-fast' is specified do not redraw
        'inst' can be an instance name or number 
    -
  • hilight_netname [-fast] net
  • +   
  • hilight_netname [-fast] net
  •     Highlight net name 'net'
        if '-fast' is given do not redraw hilights after operation 
  • image [invert|white_transp|black_transp|transp_white|transp_black|write_back|
  • @@ -1140,7 +1141,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        will create the netlist in different places.
        netlisting directory is reset to previous setting after completing this command
        If -messages is given return the ERC messages instead of just a fail (1)
    -   or no fail (0) code. 
    +   or no fail (0) code.
        If -erc is given it means netlister is called from gui, enable show infowindow
        If -nohier is given netlist only current level
        If -keep_symbols is given no not purge symbols encountered traversing the
    @@ -1695,7 +1696,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        
  • unselect_all [draw]
  •     Unselect everything. If draw is given and set to '0' no drawing is done 
  • unselect_attached_floaters
  • -   Unselect objects (not symbol instances) attached to some instance with a 
    +   Unselect objects (not symbol instances) attached to some instance with a
        non empty name=... attribute 
  • update_all_sym_bboxes
  •     Update all symbol bounding boxes 
    diff --git a/src/scheduler.c b/src/scheduler.c index da524c4c..61386312 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -51,6 +51,22 @@ void statusmsg(char str[],int n) } } +static int get_text(const char *s) +{ + int i, found=0; + if(isonlydigit(s)) { + i=atoi(s); + found = 1; + } else for(i=0;itexts; ++i) { + if(!strcmp(get_tok_value(xctx->text[i].prop_ptr, "name", 0), s)) { + found=1; + break; + } + } + if(!found || i < 0 || i >= xctx->texts) return -1; + return i; +} + static int get_symbol(const char *s) { int i, found=0; @@ -1952,8 +1968,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg * Get attribute 'attr' of rectangle number 'num' on layer 'layer' * * getprop text num attr - * Get attribute 'attr' of text number 'num' - * if attribute is 'txt_ptr' return the text + * Get attribute 'attr' of text number 'num', 'num' can also be the name attribute + * of the text object + * if 'attr' is 'txt_ptr' return the text string * * getprop wire num attr * Get attribute 'attr' of wire number 'num' @@ -2073,7 +2090,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Tcl_SetResult(interp, "xschem getprop text needs ", TCL_STATIC); return TCL_ERROR; } else { - int n = atoi(argv[3]); + int n = get_text(argv[3]); + if(n < 0) { + Tcl_AppendResult(interp, "xschem getprop: text object not found:", argv[3], NULL); + return TCL_ERROR; + } if(!strcmp(argv[4], "txt_ptr")) Tcl_SetResult(interp, xctx->text[n].txt_ptr, TCL_VOLATILE); else