BIGAL Posted September 17, 2016 Posted September 17, 2016 Slide library link http://adndevblog.typepad.com/autocad/2014/09/slide-library-manager-application.html Quote
Lee Mac Posted September 18, 2016 Posted September 18, 2016 Looks great, Lee! Thank you! You're welcome! Yes, I have a question, or two, about the section of code below. (mapcar 'mode_tile '("ed1""ed2""ed3""ed4""ed5""ed6""ed7") (cadr (assoc key '( ("sl1" (0 0 1 1 1 1 1)) ("sl2" (0 0 1 1 0 1 1)) ("sl3" (1 1 1 1 1 0 1)) ("sl4" (1 1 1 1 1 0 0)) ("sl5" (0 0 0 0 1 0 1)) ) ) ) ) I think I can see overall what is happening here, this what makes the edit boxes available or not available? Could you kindly explain the "1's" and the "0's", please? You are correct that this mapcar expression controls the enabling & disabling of the edit box tiles in the dialog, dependent upon which radio button is selected. Here, the argument 'key' represents the selected radio button tile; the value of this argument is queried against an association list in which each item contains the tile key and an accompanying list of integers. The mode_tile function controls whether a DCL tile is enabled or disabled: supplied with a DCL tile key and a second argument equal to 1 results in the tile being disabled; a second argument equal to 0 results in the tile being enabled. As described by my tutorial on the subject, the mapcar function will evaluate a supplied function with arguments sourced from one or more supplied lists. In this case, the mapcar function is supplied with the mode_tile function, a list of DCL tile keys, and a list of integers equal to 1 or 0, e.g. if the radio button "sl1" is selected: (mapcar 'mode_tile '("ed1""ed2""ed3""ed4""ed5""ed6""ed7") '(0 0 1 1 1 1 1) ) As described by my tutorial, this expression is equivalent to: (mode_tile "ed1" 0) (mode_tile "ed2" 0) (mode_tile "ed3" 1) (mode_tile "ed4" 1) (mode_tile "ed5" 1) (mode_tile "ed6" 1) (mode_tile "ed7" 1) Quote
drafter_joe Posted September 21, 2016 Author Posted September 21, 2016 (edited) Slide library link http://adndevblog.typepad.com/autocad/2014/09/slide-library-manager-application.html Thanks for the link BIGAL! It will certainly come in handy when I am working with slides. Edited September 21, 2016 by drafter_joe Quote
drafter_joe Posted September 21, 2016 Author Posted September 21, 2016 You're welcome! You are correct that this mapcar expression controls the enabling & disabling of the edit box tiles in the dialog, dependent upon which radio button is selected. Here, the argument 'key' represents the selected radio button tile; the value of this argument is queried against an association list in which each item contains the tile key and an accompanying list of integers. The mode_tile function controls whether a DCL tile is enabled or disabled: supplied with a DCL tile key and a second argument equal to 1 results in the tile being disabled; a second argument equal to 0 results in the tile being enabled. As described by my tutorial on the subject, the mapcar function will evaluate a supplied function with arguments sourced from one or more supplied lists. In this case, the mapcar function is supplied with the mode_tile function, a list of DCL tile keys, and a list of integers equal to 1 or 0, e.g. if the radio button "sl1" is selected: (mapcar 'mode_tile '("ed1""ed2""ed3""ed4""ed5""ed6""ed7") '(0 0 1 1 1 1 1) ) As described by my tutorial, this expression is equivalent to: (mode_tile "ed1" 0) (mode_tile "ed2" 0) (mode_tile "ed3" 1) (mode_tile "ed4" 1) (mode_tile "ed5" 1) (mode_tile "ed6" 1) (mode_tile "ed7" 1) Great job on the explanation, Lee! I'm sure I'll understand this better now when I more carefully read through the code. I'll be looking into your tutorial for sure, now that the 'mapcar' function is starting to make sense. I can see that I will be incorporating it more once I understand it better. I can bet as I continue on with this routine I'm building, I'll be in need of assistance along the way. I very much appreciate the help from you and BIGAL so far! On a curious note, how did you acquire your knowledge of LISP and such? Academic schooling or self taught through trial and error? Quote
Lee Mac Posted September 21, 2016 Posted September 21, 2016 Great job on the explanation, Lee! Thanks! On a curious note, how did you acquire your knowledge of LISP and such? Academic schooling or self taught through trial and error? I'm entirely self-taught. Quote
drafter_joe Posted September 21, 2016 Author Posted September 21, 2016 I'm entirely self-taught. That's quite an accomplishment, Lee! FYI: After a couple of days of experimenting with your code, I'm going to have a few questions. 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.