jw_cad 外部変形 - (1295) luaで線色を取得する(lc) -

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

 

luaで線色を取得する(lc)

:luaで線色を取得する(lc)
@echo off
for /f "delims=:" %%n in ('findstr /n "^#!" %0') do (
  copy jwc_temp.txt myfiles > nul
  more +%%n %0 | lua - myfiles > jwc_temp.txt
)
goto:eof

REM #jww
REM #e

#!この次の行からプログラムを書いてください
for line in io.lines(arg[1]) do
  if line:match("^lc") then lc = line:sub(3) end
end
print( ("h#lc=%s"):format(lc))