I'm working on L-Shapes and I'm having a major glitch with the Thks list for the thicknesses. Once I get through this I'll be using the data from the manual of Steel Construction. The function has the main DataList which contains items for Leg1, Leg2, Thk, Kdim, & Weight. I included Weight because it might come in handy for calculating the weights in another program later on.
The program will use three lists for Leg1s, Leg2s & Thks. Leg1s will change Leg2s & Thks, and Leg2s will change the Thks list. Here is a run of the TestLshapes function to get it working. The last two lists Leg2Thks and Thks is where I'm having the glitch. They should be Leg2Thks = (list (2-1/2 1/4 3/8) (3 7/16 1/2)) and Thks = (list 7/16 1/2). I'd appreciate any help with figuring this one out.
Thanks,
Trevor
Trevor,
Your program is doing exactly what you put in the code, but not what you intended or you wanted. The functions like caaar, caadr, caar, cadar, cadddr, caddr, cadr, car, cdaar, cdadr, cdar, cddar, cdddr, cddr, and cdr can be very confusing sometimes especially if you're tired. If you can replace them with the nth function instead, you are much better off. In your program the cdr function is necessary to return a list starting with the second item in the list. But the car, cadr and caddr functions can be replaced with the easier to read nth function.
Here's a simple example of what I'm referring to.
(setq abc (list "a" "b" "c" "d"))
(cdr abc) = ("b" "c" "d");Needed
(car abc) & (nth 0 abc) = "a"
(cadr abc) & (nth 1 abc) = "b"
(caddr abc) & (nth 2 abc) = "c"
(cadddr abc) & (nth 3 abc) = "d"
Bennett,
Thanks for looking into my function and for the information on car, cadr, and caddr functions. You're right about using the nth function. It does make it easier to understand and debug.
Trevor
I finished writing the code for the L-shapes dialog for drawing angles. It went fairly smooth after figuring out how to change the thickness list. In the dialog I also added the option to mirror the L-shape instead of prompting on the command line. I was able to use the W-shapes dialog as a template. Please test it and let me know if you find any bugs in the code.
Thanks,
Trevor