I would like to creat a dialog box with buttons or radio buttons to insert various blocks. something easy to start the dialogue, push the button desired and my block or lisp is inserted or run. I have the dcl part figured out. i'm not quite smart enough to get the lisp down. is there a generic lisp that can reference a lisp command that i can alter or edit and add to?
You may want to add few check boxes (toogles) one per
a desired lisp command
Pseudo-code:
{code}
_______________________________--
;;start lisp here
(defun C:CMD1(/ ...)
;; rest code
(princ)
)
(defun C:CMD2(/ ...)
;; rest code
(princ)
)
;;ETC
(defun C:main(/ ....)
(action_tile
"accept"
(strcat "(progn "
;; here is your other code for rest tiles
"(setq check1 (atoi (get_tile \"lisp1\")));<-- "lisp1" is toogle key
"(if (= 1 check1)"
"(setq load1 T)";<-- load1 is variable
"(setq load1 nil))"
"(if (= 1 check2)"
"(setq load2 T)";<-- load2 is variable
"(setq load2 nil))"
"(done_dialog 1))")
)
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
)
)
(unload_dialog dcl_id)
;; then after check variables:
(if load1
(progn
(C:CMD1);<--cmd1 is command to run first lisp
(princ "\nCommand #1 executed"))
(if load2
(progn
(C:CMD2);<--cmd1 is command to run first lisp
(princ "\nCommand #2 executed"))
;;ETC...
(princ)
)
;;end lisp here
_____________________________
{code}
~'J'~
A tool palette is the easiest way to do what you are after. Just highlight your blocks in Windows Explorer and select copy then right-click on your tool palette and select paste. Instant graphical block insert tool.
Ok so I'm not smart enough to figure this out. the ";;rest code" part, is that where i put my lisp routine? Also, the (\...) part, is that where I need to put something? I applogize for being ignorant, i really want to learn this and figure it out.
You are asking too much at one time!
Start by viewing the attached file on how to structure your program for the dialog.
It is somewhat incomplete (missing the defun), but ready to populate.
Where to place these 2 files (DCL and LSP)?
Create a folder to hold these files.
Command OPTIONS -> Files tab -> Support Path and add a path to this folder.
Next, if you do not have a file called ACAD.lsp or ACADdoc.lsp, create one and
place inside the above folder.
Inside either one of these files (whichever you wish to employ) declare your routines:
(defun c:USR () (load "USR") (c:USR)(princ)) ;add brief descriptive comment to end of this line
One defun per each line...
OK, the keystroke is declared. Next you want to add a line to the screen menu, pull-down,
or create a toolbar button. The macro to use is ^C^CUSR;
You can also store icons (toolbar button BMP) in the above folder as well.
Good Luck!
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.