jw_cad 外部変形 - (1352) mshtaでスケールを取得する(hs) -

外部変形は データのやり取りをテキストファイルで行うので プログラム言語は 自由に選ぶことができます。図形は機能的かつシンプルなため、数多くのユーザーに受け入れられています。

 

mshtaでスケールを取得する(hs)

:mshtaでスケールを取得する(hs)
@echo off
if exist jwc_temp.txt (
  copy jwc_temp.txt myfiles > nul
  mshta %~f0 < myfiles > jwc_temp.txt
)
goto:eof

REM #jww
REM #e

<script>
function hex(x) { return x < 10 ? x : x.toString(16) }

hs = []
lg = ""
with (new ActiveXObject("Scripting.FileSystemObject")) {
  f = GetStandardStream(0) //stdin
  g = GetStandardStream(1) //stdout
  while (! f.AtEndOfStream) {
    F = ($_ = f.ReadLine()).split(/\s+/)
    if (/^hs/i .test($_)) { //hs スケール
      for (i = 0; i < 16; i++) hs[hex(i)] = F[i+1] * 1.0;
    }
    if (/^lg[a-f0-9]/i .test($_)) { //lg レイヤグループ
      plg = $_.substr(2, 1).toLowerCase(); if (lg == "") lg = plg;
    }
  }
  f.close()
  g.WriteLine("h#S=1/" + hs[lg])
}
close()
</script>

 

 

スクリプト言語jscript を使用しています。