wimal Posted February 5, 2013 Posted February 5, 2013 I have found several lisp files that creating and loading the dialog box; Without a seperate DCL file.Is there any lessons available to learn that method? Quote
MSasu Posted February 5, 2013 Posted February 5, 2013 To don't have to worry about supplying two files for a tool, one programmer may include the DCL definition as a string/list of strings into his/her AutoLISP code and at run-time deflate it into Temp folder (check TEMPREFIX system variable) and call it from there. Quote
BIGAL Posted February 6, 2013 Posted February 6, 2013 (edited) Here is an example you have to use pass the items eg (setq title "Please select an item") (setq title "Please enter dwg number") (setq width " edit_width = 12;") (setq limit " edit_limit = 9;") (ah:getval title width limit) (setq dwgname item) 2nd lisp ;; Input Dialog box with variable title ;; By Ah June 2012 adapted from original code by ;; Alan J. Thompson, 09.23.08 / 05.17.10 (rewrite) ;; code (ah:getval title) (defun AH:Getval (title width limit / fo) (setq fname "C://acadtemp//getval.dcl") (setq fo (open fname "w")) (write-line "ddgetval : dialog {" fo) (write-line " : row {" fo) (write-line ": edit_box {" fo) (write-line (strcat " key = " (chr 34) "sizze" (chr 34) ";") fo) (write-line (strcat " label = " (chr 34) title (chr 34) ";" ) fo) ; these can be replaced with shorter value etc ;(write-line " edit_width = 18;" fo) ;(write-line " edit_limit = 15;" fo) (write-line width fo) (write-line limit fo) (write-line " is_enabled = true;" fo) (write-line " }" fo) (write-line " }" fo) (write-line "ok_cancel;}" fo) (close fo) (setq dcl_id (load_dialog "c:\\acadtemp\\getval")) (if (not (new_dialog "ddgetval" dcl_id)) (exit)) (action_tile "sizze" "(setq item $value)(done_dialog)") (mode_tile "sizze" 3) (start_dialog) ; returns the value of item ) Another method posted a while ago (SETQ reply (ACET-UI-MESSAGE "Choose dude " "Russells Dialog" (+ Acet:YESNOCANCEL Acet:ICONWARNING) ) ) ;; Yes = 6 ;; No = 7 ;; Cancel = 2 (IF (= reply 6) (PROGN (ALERT "Yep") ;; ;; More Yes Mojo ) ;; else (PROGN (ALERT "Nope") ;; ;; More no mojo ) ) Edited February 8, 2013 by BIGAL Quote
wimal Posted February 6, 2013 Author Posted February 6, 2013 Thanks I will try to start studing these codes. Quote
johmmeke Posted February 8, 2013 Posted February 8, 2013 not a real tutorial, but great resource http://web2.airmail.net/terrycad/Tutorials/MyDialogs.htm Mvg John 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.