jw_cad 外部変形 - (1118) clispで点種を取得する(pn) -

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

 

clispで点種を取得する(pn)

:clispで点種を取得する(pn)
@echo off
for /f "delims=:" %%n in ('findstr /n "^#!" %0') do (
  more +%%n %0 | clisp -q > nul
)
goto:eof

REM #jww
REM #h4               データ選択をしない、読取可能データ全て書き出し
REM #e

#!この次の行からプログラムを書いてください
(setq pn nil)
( ;jwc_temp.txt から 入力
  with-open-file (f "jwc_temp.txt" :direction :input)
  (loop for line = (read-line f nil) while line do
    (setq a (regexp:regexp-split "\\s\\+" line))
    (if (regexp:match "^pn" line)
        (progn
          (setq ppn (subseq line 2))
          (if (equal pn nil) (setq pn ppn))
        )
    )
  )
)
( ;jwc_temp.txt へ 出力
  with-open-file (f "jwc_temp.txt" :direction :output)
    (format f "h#pn=~a~%" pn)
)