Jamesclark64 Posted February 5, 2023 Posted February 5, 2023 Anyone know of any lisp routine that can give me a popup box with preset text in? As to save Time writing stuff over and over again. Quote
Steven P Posted February 5, 2023 Posted February 5, 2023 As always with a new user, I don't know your LISP abilities so will assume you can work it out from this... if not jus ask for more help Quote
Jamesclark64 Posted February 5, 2023 Author Posted February 5, 2023 10 hours ago, Steven P said: As always with a new user, I don't know your LISP abilities so will assume you can work it out from this... if not jus ask for more help I've spent a few hours on it but I'm ashamed to say I'm out of my depth. not sure what part is the dcl example and what part if any is the .lsp file. Not quite sure what I'm doing No idea what "!!*MUST BE STRING*!!" means. Quote
Steven P Posted February 5, 2023 Posted February 5, 2023 18 minutes ago, Jamesclark64 said: I've spent a few hours on it but I'm ashamed to say I'm out of my depth. not sure what part is the dcl example and what part if any is the .lsp file. Not quite sure what I'm doing No idea what "!!*MUST BE STRING*!!" means. That's no problem, people come to ask questions who are pretty good and are stuck, others come here whose boss tells them "get a LISP for that" and have to search what a LISP is... and everything in between. So assuming you can load and run a LISP program (or else see this: http://lee-mac.com/runlisp.html) save the code from alanjt to a file, call the file what you want with a '.l;sp' extension. In notepad for example in the save as use a file type *.* and call the file say DropDownBox.lsp. We're not going to modify what he suggested, it is a useful little function to use in the future (Which reminds me, I might come back to that later for something else for me) All that he wrote is a LISP, the way it works the LISP creates a temporary DCL file (on the fly) and refers to that, next time the LISP is run it will recreate that file (this is in the background, no need to worry about it), the benefit of this is that you don't need to worry about file locations for the DCL pop up.. it is just there. To run what he suggests use the line (sorry if you know all this.. start at the beginning) (AT:listselect mytitle mylabel myheight mywidth mymultiselect mylist) Each of these apart from mylist need to be a string. (You can have a list, a string or an integer, a string being text ( 'Hello World'), an integer is a number ('123') and a list is, well, a list ("Hello World" "123"). You might note here that the strings have quotes around them and the number 123 is a string You can also use variables in the command above. You might go for something like this then: (AT:listselect "Some Lists" "Select Text" "7" "25" "false" mylist) all strings. Except mylist. We can define that in a LISP. If we were using numbers it might be something like (AT:listselect "Some Lists" "Select Text" 7 25 "false" mylist), no quotes around the numbers and cause an error later on - for this code, others are different So put together you might run the code with something like: (defun c:DropDownList ( / mylist myresult) (setq mylist (list ; create a list "SP" "JC" (rtos (+ 5 7)) "Hello" "World" )) ; above list written on seperate lines for clarity, could be a single line with a space between list items) (setq myresult (AT:listselect "Some Lists" "Select Text" "7" "25" "false" mylist)) ; run another function, AT:listselect ;; Do your thing here (princ (nth 0 myresult)) ; (nth 0... or (car... to return a string of the first entity ;; (princ) ; exit silently - nothing shown in command line at exit ) ; end function Save that in your LSP file and see how it goes. Apologies if you know all of that 1 Quote
BIGAL Posted February 6, 2023 Posted February 6, 2023 Like this ?? Here at downloads get a copy of Multi radio buttons.lsp it is for any users code. 3 Quote
Jamesclark64 Posted February 8, 2023 Author Posted February 8, 2023 On 05/02/2023 at 21:44, Steven P said: That's no problem, people come to ask questions who are pretty good and are stuck, others come here whose boss tells them "get a LISP for that" and have to search what a LISP is... and everything in between. So assuming you can load and run a LISP program (or else see this: http://lee-mac.com/runlisp.html) save the code from alanjt to a file, call the file what you want with a '.l;sp' extension. In notepad for example in the save as use a file type *.* and call the file say DropDownBox.lsp. We're not going to modify what he suggested, it is a useful little function to use in the future (Which reminds me, I might come back to that later for something else for me) All that he wrote is a LISP, the way it works the LISP creates a temporary DCL file (on the fly) and refers to that, next time the LISP is run it will recreate that file (this is in the background, no need to worry about it), the benefit of this is that you don't need to worry about file locations for the DCL pop up.. it is just there. To run what he suggests use the line (sorry if you know all this.. start at the beginning) (AT:listselect mytitle mylabel myheight mywidth mymultiselect mylist) Each of these apart from mylist need to be a string. (You can have a list, a string or an integer, a string being text ( 'Hello World'), an integer is a number ('123') and a list is, well, a list ("Hello World" "123"). You might note here that the strings have quotes around them and the number 123 is a string You can also use variables in the command above. You might go for something like this then: (AT:listselect "Some Lists" "Select Text" "7" "25" "false" mylist) all strings. Except mylist. We can define that in a LISP. If we were using numbers it might be something like (AT:listselect "Some Lists" "Select Text" 7 25 "false" mylist), no quotes around the numbers and cause an error later on - for this code, others are different So put together you might run the code with something like: (defun c:DropDownList ( / mylist myresult) (setq mylist (list ; create a list "SP" "JC" (rtos (+ 5 7)) "Hello" "World" )) ; above list written on seperate lines for clarity, could be a single line with a space between list items) (setq myresult (AT:listselect "Some Lists" "Select Text" "7" "25" "false" mylist)) ; run another function, AT:listselect ;; Do your thing here (princ (nth 0 myresult)) ; (nth 0... or (car... to return a string of the first entity ;; (princ) ; exit silently - nothing shown in command line at exit ) ; end function Save that in your LSP file and see how it goes. Apologies if you know all of that Thank you for taking the time to gi through this. Works an absolute treat now. Very much appreciated. 1 Quote
ronjonp Posted February 8, 2023 Posted February 8, 2023 Try this: http://www.theswamp.org/index.php?topic=1392.0 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.