fc2ブログ

DefunSetenv.lsp:Setenvコマンドを定義

2021年12月15日
■AutoLISP サンプルコード公開Gallery
Setenv関数をAutoCAD(R)レギュラー版でも使用できるようにするためのAutoLISP
※ ARES CAD でも使用可能です。
AutoLISP
;*****************
(Defun C:Setenv (/ esvname esvval);Setenvコマンドを定義します
;*****************
  (setq esvname (getstring "\n変数名を入力:"))
    (if (= "" esvname);変数名が入力されずに空Enterされたら・・
      (princ);終了します
      (progn;そうでないときは・・
        ;---------------
        (if (Getenv esvname)
          (setq esvval (getstring (strcat "値 <" (Getenv esvname) ">:")))
          (setq esvval (getstring (strcat "値 < >:")))
        )
        ;---------------
        (if (= "" esvval)
          (Setenv esvname (Getenv esvname))
          (Setenv esvname esvval)
        )
        ;---------------
      );progn
    );if
  (princ);終了します
)



C:\MyCANAL\Supply\Lisp\DefunSetenv.lsp


関連記事
スポンサーサイト



Gallery担当:山野 ロザリア平久郎
Posted by Gallery担当:山野 ロザリア平久郎