Snownut Posted November 26, 2010 Posted November 26, 2010 I would like to create a lisp function that has a DCL file as the data input window. This in itself is easy enough to do, however once specific edit_boxes have values inserted into them I would like to automatically update other edit_boxes in the same Dialog box immediately; for example (simple) if the 1st edit_box prompted for a number, and the 2nd edit_box prompted for another number, then the 3rd edit_box should display the sum of the two numbers and allow user input to change if required. It is my understanding that as long as the function does not include a "command" then this is possible, performing calculations only should be ok, however I am not having any luck in accomplishing this. Could someone post a simple lisp routine for this, just so I could see the structure and syntax involved. Unless something special needs to go in the DCL file there is no need to post the DCL code. Thank you. Hope everyone had a Great Turkey Day..... Quote
BIGAL Posted November 26, 2010 Posted November 26, 2010 The code is in the dcl not lisp this example takes the 3 values of a double skin wall you can slide you can enter a value and it updates the total display as you do it. Its cut out of a big DCL so hopefully it will still work. / dialog box cavity // ******************************************************************* // cavity edit box cavity : dialog { : boxed_column { typeface = "Arial"; pointsize = 8; label = "Cavity wall sizes:"; : edit_box { key = "cav1"; label = "Outside"; // width = 3; // fixed_width = true; value = 110; } : slider { key = "cav2"; min_value = 1; max_value = 250; value = 110; big_increment = 5; } : edit_box { // mnemonic = "Q"; key = "cav3"; label = "Cavity "; // width = 3; // fixed_width = true; value = 60; } : slider { key = "cav4"; min_value = 1; max_value = 250; value = 60; big_increment = 5; } : edit_box { // mnemonic = "Q"; key = "cav5"; label = "Inside "; width = 3; fixed_width = true; value = 100; } : slider { key = "cav6"; min_value = 1; max_value = 250; value = 100; big_increment = 5; } } : boxed_column { : row { label = "Total width"; : text { key = "cav7"; width = 3; fixed_width = true; value = "270"; } } } spacer_1; ok_cancel; } Quote
The Buzzard Posted November 26, 2010 Posted November 26, 2010 See post #39 of this thread: http://www.cadtutor.net/forum/showthread.php?47747-List-Box-How-Do-You-Highlight-The-Value/page4 Quote
LizaCotter Posted June 28, 2022 Posted June 28, 2022 Hi Snownut! Did you ever figure out how to do this? I'm trying to do something similar Thanks!! Quote
SLW210 Posted June 29, 2022 Posted June 29, 2022 Perhaps you could share the answer with the rest of us. Quote
LizaCotter Posted July 5, 2022 Posted July 5, 2022 What I was trying to do originally was offer the user of my dialog box two options for picking a point; either selecting the point onscreen, or typing the coordinates into two edit boxes. However, if the user chose the point onscreen, I wanted to update the edit boxes with the coordinates of the point they chose. I got that to work (yay!) and I used a very similar approach to solve this problem. I had to use one small cheat (in order to calculate the sum, you have to check a toggle box) but I don't think this would be too much trouble for your user. The most important thing I learned since my original post was how to use set_tile and how to use a while loop to "refresh" a dialog box for calculations. This tutorial was great for the latter! https://www.afralisp.net/dialog-control-language/tutorials/hiding-dialog-boxes-revisited-part-2.php Attached are the two .lsp files I wrote along with the dcl and a picture of the dialog box. I'm very beginner to autolisp and DCL, so this is undoubtedly not the most elegant solution, but I think it woks pretty well! testytesty.dcl testytesty.lsp check.lsp 1 Quote
BIGAL Posted July 6, 2022 Posted July 6, 2022 Did you look at what I posted 12 years ago, this has sliders as well for input. The Total is "text". 1 Quote
LizaCotter Posted July 6, 2022 Posted July 6, 2022 On 11/25/2010 at 8:09 PM, Snownut said: then the 3rd edit_box should display the sum of the two numbers and allow user input to change if required. I might be misinterpreting this, but I thought that this meant that the user should be able to change the sum after it was computed, if they wanted to. So that's why I thought it should be an edit box, not text. Totally could be misreading that though. Quote
BIGAL Posted July 7, 2022 Posted July 7, 2022 It can be text or a edit box its up to you I would have thought don't want people changing the sum. 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.