I've create a program with dialog box,but it can not display,can someone's corrected where this program that wrong thanks a lot for your help Best regards Ade Suharna ;------------------------------ ; Design by Ade Suharna ; 8 June 2004 (defun c:adesu () (vl-load-com) (setq Nam Ade Um 45 Tan 31 Al Jl) (setq dcl_id (load_dialog "Adesu.dcl")) (if (not (new_dialog "Adesu" dcl_id)) (exit) ) (set_tile "Nam" Ade) (set_tile "Um" 45) (set_tile "Tan" 31) (set_tile "Al" Jl) (mode_tile "Nam" 2) (action_tile "cancel" "(done_dialog)(setq userclick nil)") (action_tile "accept" (strcat "(progn (setq Nam (get_tile \"Ade\"))" "(setq Um (get_tile \"Um\"))" "(setq Tan (get_tile \"Tan\"))" "(setq Al (get_tile \"Al\"))" "(done_dialog)(setq userclick T))" ) ) (start_dialog) (unload_dialog dcl_id) (princ) ) (princ) ;------------------------ Adesu : dialog { label = " Adesu Tea"; : edit_box { label = "&Nama Jelas"; key = "Nam"; edit_width = 25; allow_accept = true; } : edit_box { label = "&Umur"; key = "Um"; edit_width = 25; allow_accept = true; } : edit_box { label = "&Tanggal lahir"; key = "Tan"; edit_width = 25; allow_accept = true; } : edit_box { label = "Alamat"; key = "Al"; edit_width = 25; allow_accept = true; } ok_cancel; : text_part { label = " by Ade Suharna"; } }
Small problem, Set tile must be a string value. (set_tile "Nam" Ade) (set_tile "Um" "45") (set_tile "Tan" "31") (set_tile "Al" Jl) Ade & Jl must also be set to a string value. HTH Bill
(defun c:adesu (/ adesuLst userclick) (setq userclick 5) (setq adesuLst '(("Nam" . "Ade")("Um" . "45")("Tan" . "31")("Al" . "Jl"))) (setq dcl_id (load_dialog "Adesu.dcl")) (while (> userclick 1) (if (not (new_dialog "Adesu" dcl_id)) (exit) ) (foreach n adesuLst (set_tile (car n)(cdr n)) (action_tile (car n) "(setq adesuLst (subst (cons $key $value)(assoc $key adesuLst) adesuLst))") ) (mode_tile "Nam" 2) (action_tile "cancel""(done_dialog 0)") (action_tile "accept" "(done_dialog 1)") (setq userclick(start_dialog)) ) (alert (apply 'strcat (mapcar '(lambda(n)(strcat (cdr n)" ")) adesuLst))) (unload_dialog dcl_id) (princ) ) (princ)
Hi BillZ,you 're right and OK,but in the second dialog box "AutoCad Massage" it can't display,can you suggest to me.
Hi BillZ and others, can you suggest to me,how to interactive it,where I want to draw a box and circle (every corner a box),I mean how to put and location program to draw it,where put them in lsp file,thanks a lot for your help. Best regards Ade Suharna ;------------------------------------------------- #LSP FILE # (defun c:adesuh () (setq L (getreal)) (setq W (getreal)) (setq R (getreal)) (setq Ll (getreal)) (setq dcl_id (load_dialog "Adesu.dcl")) (if (not (new_dialog "Adesu" dcl_id)) (exit) ) (set_tile "Len" " ") (set_tile "Wid" " ") (set_tile "Rad" " ") (set_tile "Lenli" " ") (mode_tile "Len" 2) (action_tile "cancel" "(done_dialog)(setq userclick nil)" ) (action_tile "accept" (strcat "(progn (setq L (get_tile \"Len\"))" "(setq W (get_tile \"Wid\"))" "(setq R (get_tile \"Rad\"))" "(setq Ll (get_tile \"Lenli\"))" "(done_dialog)(setq userclick T))" ) ) (start_dialog) (unload_dialog dcl_id) (if userclick (alert (strcat "LENGTH OF BOX = " L "\n" "WIDTH OF BOX = " W "\n" "RADIUS OF CIRCLE = " R "\n" "LENGTH OF LINE = " Ll)) ) (princ) ) (princ) ;------------------------------------------------------ #DCL FILE# Adesu : dialog { label = "ADESU DIALOG BOX REFERENCY"; : edit_box { label = "&LENGTH OF BOX (mm)"; key = "Len"; edit_width = 5; allow_accept = true; } : edit_box { label = "&WIDTH OF BOX (mm) "; key = "Wid"; edit_width = 5; allow_accept = true; } : edit_box { label = "&RADIUS OF CIRCLE (mm)"; key = "Rad"; edit_width = 5; allow_accept = true; } : edit_box { label = "&LENGTH OF LINE (mm)"; key = "Lenli"; edit_width = 5; allow_accept = true; } : boxed_column { label = "BOX TETRAGONAL"; // still under construction } : boxed_column { label = "CIRCLE ELLIPSTIC"; // still under construction } : boxed_column { label = "LINE CONSTRUCTION"; // still under construction } ok_cancel ; : text_part { label = "Designed and Created"; } : text_part { label = "by Ade Suharna"; } }
try this (defun c:adesu (/ userclick) (setq userclick 1) (setq adesuLst '(("Len" . "100")("Wid" . "45")("Rad" . "31")("Lenli" . "??"))) (setq dcl_id (load_dialog "Adesu.dcl")) (while (> userclick 1) (if (not (new_dialog "Adesu" dcl_id)) (exit) ) (foreach n adesuLst (set_tile (car n)(cdr n)) (action_tile (car n) "(setq adesuLst (subst (cons $key $value)(assoc $key adesuLst) adesuLst))") ) (mode_tile "Len" 2) ;;;(action_tile "Draw""(done_dialog 2)") (action_tile "cancel""(done_dialog 0)") (action_tile "accept" "(done_dialog 1)") (setq userclick(start_dialog)) ; when more use then uncomment below and line actiontile "Draw" ;;;(cond ((= userclick 2) ;;;(setq ptUr (polar (polar pt 0 (atof (cdr (assoc "Len" adesuLst)))) ;;;(* 0.5 pi)(atof (cdr (assoc "Wid" adesuLst))))) ;;;(command "._circle" "none" pt (atof (cdr (assoc "Rad" adesuLst))) "")) ;; (unload_dialog dcl_id) (if (= userclick 1) (if (setq pt (getpoint "\nPick a point on the box: ")) (progn (setq ptUr (polar (polar pt 0 (atof (cdr (assoc "Len" adesuLst)))) (* 0.5 pi)(atof (cdr (assoc "Wid" adesuLst))))) ; command voor draw a circle with a radius "Rad" (command "._circle" "none" pt (atof (cdr (assoc "Rad" adesuLst))) "" "._circle" "none" ptUr (atof (cdr (assoc "Rad" adesuLst))) "" "._rectang" "none" pt "none" ptUr ) );end progn );end if pt );end if userclick (princ) ) (princ)