본문 바로가기
AutoCAD/AutoLisp

OpenDCL 튜토리얼 첫번째

by Crony 2012. 2. 24.
(defun DCL_Load ()
    ; the following command will ensure the 
    ; appropriate OpenDCL ARX file is loaded.
    (dcl_project_import
'("YWt6AxoNAACCejQcBuKjKDMRMi9mANjYrd2thhZcpmtrPNmkLE0dX/x2pOSENiY2JE2t30QTbfT3"
"M5M2EtIShndAVI/vJndlCOhoAP76zG2Pr4/AmTCRx4n3CCRaa0nHieCZwJEHsQXgDeCJotub10xU"
"CYpmeA5gHfZ+BiN5UujJZOR5ziMyR9ru6gl/d5rv6Aj5ysh3oFRW/y38dbY0VVPT2oZprlchpdsx"
"KKQ3Ed7MODL0W1FgF8/Y2wE8kpOMsKT2Y6w1Obe09uMI6vxjrwWYm8U4EWliOyL9FLhsxvLrTm+q"
"3gz31whhOA9wvZwTINwPpCwPTzlaPJ5MnUjqw6A3Qg1lz3TylkaYeZ/1+mUjgWVkkVOnUfuOlGII"
"HuSLQMYqhe6/dnC2Q1boP9/dVrG1nBfgxm8SuPF2QViC7o5JtNY6Rmh3nZHwX3Ma0Nyw2SlnJEld"
"o7EvZZZ2jVSad82vG4g4EMXulC/RISQHXx2jvDwoZlawzupLToBaB2fdAFTgQ52Sg/QdzXIrNfpK"
"bh9tyvtgbh+Jt4Fgn8X6kW7Q2QZd3yJlBA5qMwzhz4do28Mp4NkfsISDQoQ5d3GFYjpAVTk9GlFs"
"AJRG5SoBIKC+qBEswudGIZ+S1WqJRIIyjwvkiR8ZIdiIV+nxm59dm0mXjZyLATGlk+3l0YuBnhEa"
"cUktgYtKgF/50VaQXB8LbZBfAu5OtR990w0+YG3Wtj1n9JXp41Jx3RvaWrscyXbOSnn3Et+fpHZ5"
"WorrWhqTf3fbas0y1Lcct0Ibv0wmMKWVIe879JgjM1hJFyBS5RW6PeiOD7yrGqg8pU4/5htGPgZt"
"s5F7nyUrGgLskhXUEp0oqYG1hrzof8WxfRue+px8s5kxtTzkhoLjTM82ZHOE2/u1OqKPBT/gHbyM"
"tmL0O/hoTwIgqBquK5PiIkWN0bDRLYwA/4imYeFi+LpZQRUvz4YBRxWZJUp83KHxzpaTEZZSGZVQ"
"UtLWhG9oK2WAvKf0NubhB/bWyYyAd+s43s0=")
    )
)
(defun c:Hello ()
    (command "_OPENDCL")
    ; Odcl Load.
    (DCL_Load)
    ; Dialog Box Show
    (dcl_Form_Show Test_Form1)
    (princ)
)

; 폼 초기화
(defun c:Test_Form1_OnInitialize (/)
    (dcl_Control_SetCaption Test_Form1_Label1 "Hello World")
    (dcl_Control_SetText Test_Form1_TextBox1 "입력")
)

;버턴실행
(defun c:Test_Form1_TextButton1_OnClicked (/)
    (setq FText (dcl_Control_GetText Test_Form1_TextBox1))
    (dcl_MessageBox  (strcat "오픈디시엘 세계에 오신 " FText " 님 환영합니다"))
    (dcl_Form_Close Test_Form1)
)