Code:
/*c2s: vl.load_com();
$rr=nil,grids=nil,GridLayer="GRID";GridAttribute="MAPSHTNUM";
SourceLayout="001",
TitleBlockHeight=86,
KeyZoomFactor=0.5;
lpt=layoutlist();
if (lpt==nil) $rr=alert("error**eNoLayout_i607"),$rr=exit();
if (length(lpt)<1) $rr=alert("error**eEntityInInactiveLayout_i09"),$rr=exit();
ss=ssget("x",lISt(cons(0,"INSERT"),cons(8,GridLayer)));
if (ss==nil) $rr=alert("error**eNoLabelBlock_i603"),
$rr=str_princ(list("\nNo grid blocks on layer '",GridLayer,"' found.")),
$rr=exit();
if (sslength(ss)<1) $rr=alert("error**eNullBlockName_i17"),
$rr=exit();
$i=0;
princ("\nLayout.Old=(");
for(lbr=lpt;car(lbr);lbr=cdr(lbr))
nop=str_princ(list(itoa($i),"=\"",car(lbr),"\";")),
$i=$i+1;
princ(")");
id=dfn_getx_int("GiveMe IndexOf-layout:",0);
id=(id==nil)?0:abs(id),
id=(id>=length(lpt))?(length(lpt)-1):id,
SourceLayout=nth(id,lpt);
str_princ(list("SourceLayout=",SourceLayout));
$rr="Author Lanny Schiele(c)2020";
*/ |