matngot Posted April 16, 2025 Posted April 16, 2025 (edited) Hello everyone! I have created a DCL dialog box for my lisp program and now I don't know how to fix my program's lisp so that the DCL dialog box works. I hope everyone can help me fix this lisp program. mc_dialog : dialog { label = "NHAP THONG SO MAT CAT DOC"; : edit_box { label = "Ty le ngang 1/?"; key = "hf"; } : edit_box { label = "Ty le dung 1/?"; key = "vf"; } : edit_box { label = "Cao do so sanh (m)"; key = "level"; } : edit_box { label = "Ly trinh diem dau (m)"; key = "st"; } : edit_box { label = "Chieu cao Text Title"; key = "th"; } : edit_box { label = "Chieu cao Text cao do"; key = "th1"; } : edit_box { label = "File du lieu TXT"; key = "file"; } : button { label = "Chon File..."; key = "chonfile"; } spacer; : row { : button { label = "Ve"; is_default = true; key = "accept"; } : button { label = "Thoat"; key = "cancel"; } } } mat doc tuyen.lsp Edited April 16, 2025 by SLW210 Added Code Tags!! Quote
SLW210 Posted April 16, 2025 Posted April 16, 2025 Please put your code in code tags! (<> in the editor toolbar) Quote
GLAVCVS Posted April 16, 2025 Posted April 16, 2025 Hi @matngot perhaps you should indicate what error AutoCAD is displaying. Primarily, it seems that the 'edit_box's' aren't sufficiently defined. Also, perhaps you should enclose them under a ': column {' Quote
Steven P Posted April 16, 2025 Posted April 16, 2025 I'd also suggest you look at action_tiles so that you can get the input to the edit box and use them, or modify the 'OK' button to do the same: Action tile might be something like this: (action_tile "hf" "(setq hf (read (get_tile \"hf\"))))" ) (a quick copy and paste example, not sure if you need the 'Read' in there) Quote
SLW210 Posted April 16, 2025 Posted April 16, 2025 Maybe work through these... Dialog Control Language (DCL) | AfraLISP Quote
BIGAL Posted April 16, 2025 Posted April 16, 2025 (edited) My $0.05, I would add a width to the edit boxes as they are all over the place. mc_dialog : dialog { label = "NHAP THONG SO MAT CAT DOC"; : column { : edit_box { label = "Ty le ngang 1/?"; key = "hf"; } : edit_box { label = "Ty le dung 1/?"; key = "vf"; } : edit_box { label = "Cao do so sanh (m)"; key = "level"; } : edit_box { label = "Ly trinh diem dau (m)"; key = "st"; } : edit_box { label = "Chieu cao Text Title"; key = "th"; } : edit_box { label = "Chieu cao Text cao do"; key = "th1"; } : edit_box { label = "File du lieu TXT"; key = "file"; } : button { label = "Chon File..."; key = "chonfile"; } } : row { : button { label = "Ve"; is_default = true; key = "accept"; } : button { label = "Thoat"; key = "cancel"; } } } Have a look at writing the dcl as part of the lisp code, you use write line and the (setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w")) to write a temporary file just delete the file at end of dcl use. Have a look at Multi getvals.lsp will write a dcl for you based on a list of edit boxes. Around 3 lines of code to make a dcl. You can set file name so can see the dcl code. Then use the rlx code to make lisp code. Convert dcl 2 lisp rlx.lspMulti GETVALS.lsp Edited April 16, 2025 by BIGAL 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.