본문 바로가기
캐드리습

DLC 포함 리습 샘플

by good-life-story 2023. 2. 14.
728x90


(defun c:SAMPLE1()
(sample1_create_dialog)
    (setq dcl (strcat "SAMPLE1.DCL"))
    (setq dcl_id (load_dialog dcl))
             (if (not (new_dialog "sample1" dcl_id)) (exit))
                (action_tile "li" "(done_dialog 1)")
                (action_tile "ci" "(done_dialog 2)")
                (action_tile "pl" "(done_dialog 3)")
                (action_tile "in" "(done_dialog 4)")

                (setq wn (start_dialog))
   (unload_dialog dcl_id)
                    (cond
                    ( (= wn 1)(command "line"))
                    ( (= wn 2)(command "circle"))
                    ( (= wn 3)(command "pline"))
                    ( (= wn 4)(command "insert"))

                    );conf
  (princ)        
);defun c:SAMPLE1

;;<Create_dialog> ━━━━━━━━━━━━━━━━━━━━━━━━━
 (defun sample1_create_dialog( / fname fn dcl_id )
  (setq fn (open "Sample1.DCL" "w"))
  (write-line
"//
// Sample1 Dialog for test
// sampl1.lsp
//
sample1 : dialog {
        label = \"Command D.C.L \";
        :column{
         :row{
           :button{
     label=\"Line \"; 
     key=\"li\"; }
            :button{
             label=\"Circle\";
             key=\"ci\";
                 }
            }//row end
            :row {
            :button{
             label=\"Pline\";
             key=\"pl\";
                 }
            :button{
             label=\"Insert\";
             key=\"in\";
                 }

            } //row
         }  // column
    ok_cancel;
}"
  fn)
  (close fn)  
); defun

 
728x90