|
W.Hiroshiさん,
以下のようなものを作ってみました。お試しください。
では, (^^)/~
山紫水明)
SANSHISUIMEI
//----------------------------------------------------------------//
if( selecting ) {
rangeeditin;
#select = 1;
}
disabledraw;
setfloatmode 1;
if( result == 0 ) {
message "浮動小数点数版(統合版)を使ってください。";
endmacro;
}
setcompatiblemode 0x020c;
gofiletop;
while( 1 ) {
searchdown2 "X[0-9.-]+(?![0-9.Y])", regular;
if( result ) {
#px = foundendx;
#py = foundendy;
searchup "Y[0-9.-]+", regular;
$y = gettext( foundtopx, foundtopy, foundendx, foundendy );
moveto #px, #py;
insert $y;
} else break;
}
gofiletop;
while( 1 ) {
searchdown2 "^([^X]*)(Y[0-9.-]+)(?\\2)", regular;
if( result ) {
#px = foundtopx;
#py = foundtopy;
searchup "X[0-9.-]+", regular;
$x = gettext( foundtopx, foundtopy, foundendx, foundendy );
moveto #px, #py;
insert $x;
} else break;
}
loaddll "HideMath.dll";
#ime = imestate;
if( #ime ) imeswitch;
#angle = val(input("回転角( 反時計回り 単位:度 )"));
if( #angle == 0 ) endmacro;
#angle = #angle * dllfunc( "Pi" ) / 180;
gofiletop;
while( 1 ) {
searchdown2 "X.+Y.+", regular;
if( result == false ) break;
moveto foundtopx, foundtopy;
searchdown2 "(?<=X)[0-9.-]+", regular;
#x = val( gettext( foundtopx, foundtopy, foundendx, foundendy, 1 ) );
delete;
#p = x;
searchdown2 "(?<=Y)[0-9.-]+", regular;
#y = val( gettext( foundtopx, foundtopy, foundendx, foundendy,1 ) );
delete;
call Replace #x, #y;
insert $y2;
moveto #p, y;
insert $x2;
}
freedll;
if( #ime ) imeswitch;
gofiletop;
if( #select) rangeeditout;
endmacro;
Replace:
##x2 = ##1 * dllfunc( "Cos", #angle ) - ##2 * dllfunc( "Sin", #angle );
##y2 = ##1 * dllfunc( "Sin", #angle ) + ##2 * dllfunc( "Cos", #angle );
$x2 = dllfuncstr( "Format", "%.3lf", ##x2 );
call Reformat $x2;
$x2 = $$return;
$y2 = dllfuncstr( "Format", "%.3lf", ##y2 );
call Reformat $y2;
$y2 = $$return;
return;
Reformat:
if( rightstr($$1, 1) == "0" ) $$1 = leftstr($$1, strlen($$1) - 1);
if( rightstr($$1, 1) == "0" ) $$1 = leftstr($$1, strlen($$1) - 1);
return $$1;
//----------------------------------------------------------------//
|
|