Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted (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 by BIGAL
Posted

Thanks I will try to start studing these codes.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...