The Buzzard Posted April 11, 2009 Posted April 11, 2009 Just kiddin, I have done enough of this stuff in the last couple of years, But never to the extent that I put into this program. Lee Mac put out a super thread on DCL and although I had contributed to it, I got even more out of it and in many ways. I do not get any use out of my programs. I create them for the benefit of others. When I made this program, I tried to keep in mind that someone else would use it and it had to be flexible. The program creates 2D swing & leaf door blocks with or without attributes. Here are the features used in this program. 1. The program saves the user enviorment to variables and restores it at the programs end. 2. The program has error trapping. 3. The program has built-in block reference based on user selection. So you do not need to create the door blocks, Store the door blocks, and Search for the door blocks. 4. Slides are also built-in. 5. Program make Left, Right, swing doors and also Double doors. 6. You can also have 90 degree or 45 degree doors. 7. You can change the insertion point from inside to outside pivoting. 8. Door dimension selection lists change based on the door type selection. 9. Two choices of layers are available with a choice of colors. 10. Options include... Orthomode: On/Off, Object Snap: Program/User, Attributes: Yes/No. 11. A selection of fonts available. 12. A selection of text sizes available. 13. Some of the attributes are filled in based on selection. 14. A loop dialog is provided for fast multiple insertions. Give it a try. Here is a view of the dialog Main Menu. Thanks, The Buzzard IDS_V1.03.zip Quote
Tankman Posted April 11, 2009 Posted April 11, 2009 Thanks for the post. My son the carpenter and CAD user can certainly use this in his planning. Quote
Lee Mac Posted April 11, 2009 Posted April 11, 2009 Very nice Buzzard -- I thought I may be seeing this arrive sometime! Thanks for the mention - much appreciated, glad you could learn something from me I like the way you incorporated the images in the program without the need for extra .sld files - just using vector images - makes the program l o n g but professional I see you incorporated the colour change menu's - great idea with the textstyles as well Thanks Lee Quote
The Buzzard Posted April 11, 2009 Author Posted April 11, 2009 Thank you Tankman, I hope he puts alot of mileage on it. Let me know how it goes. Hey Lee, It my first program with Lee Mac Dialog technology inside! As far as the length is concerned, Its as I have been sayin. The realestate in notepad is for free. Use it. I was going to make a button controlled pdf help file with it, But I just want to wait and see how the responce to it is. No sense in wasting any more time on it if it does not go over well. Your thread was a very big asset in the effort I had put into this. So with respect to you, I hope you see how much I had learned from you. Thanks, The Buzzard Quote
Lee Mac Posted April 11, 2009 Posted April 11, 2009 Your thread was a very big asset in the effort I had put into this. So with respect to you, I hope you see how much I had learned from you. Thanks Buzzard, Its a shame I didn't use more comments on my code as you have done - it would probably have made things a bit easier for you to decipher... I just have a habit of not commenting anything - I just feel that the comments make the code look "ugly" imo... but thats just me Great work, I'm sure it'll be of great use to the community. Cheers Lee Quote
The Buzzard Posted April 11, 2009 Author Posted April 11, 2009 I prefer to put the comments off to the side. When comments are mingled within or on top of the code, It makes the code harder to read. You will also notice I do alot of aligning of text to make the code even more readable. As I say this is for the purpose of others to know what the code is doing at any given point. I indicated when a function goes to another function and back. Also the bordering of functions and the function map and function titles I believe are very important for others to understand the code as well. Sorry if I take this to a whole new level, But thats just my style. The important thing is the code functions without errors. Quote
The Buzzard Posted April 11, 2009 Author Posted April 11, 2009 Sorry had to correct an error for the double doors. Goto the first post for fixed copy Quote
Lee Mac Posted April 11, 2009 Posted April 11, 2009 I prefer to put the comments off to the side. When comments are mingled within or on top of the code, It makes the code harder to read. You will also notice I do alot of aligning of text to make the code even more readable. As I say this is for the purpose of others to know what the code is doing at any given point. I indicated when a function goes to another function and back. Also the bordering of functions and the function map and function titles I believe are very important for others to understand the code as well. Sorry if I take this to a whole new level, But thats just my style. The important thing is the code functions without errors. I must admit, I did like that "function map" that you used - it does make things quite explanatory Quote
The Buzzard Posted April 11, 2009 Author Posted April 11, 2009 Lee I could not help but notice the program work great if I do not declare the local variables. The button remember the last settings no problem. But when I declare them they remember there setting during a single use, But when you exit and return they are not at their last settings. Is there some kind of rule for declaring local variables. Quote
Lee Mac Posted April 11, 2009 Posted April 11, 2009 Lee I could not help but notice the program work great if I do not declare the local variables. The button remember the last settings no problem. But when I declare them they remember there setting during a single use, But when you exit and return they are not at their last settings. Is there some kind of rule for declaring local variables. Yes, When you declare a local variable - the value bound to the symbol will be discarded - and the symbol will become "unbounded", and so won't interfere with other programs (if the same symbol is used as a variable in another program for instance). Hence, when you localise the variables, they become nil when the program completes - thus why the program can't "remember". I used obscure symbols such as "elbow:def", and didn't localise these variable, hence they kept their values throughout the drawing session. Hope this helps! Lee Quote
The Buzzard Posted April 13, 2009 Author Posted April 13, 2009 Attention to all, See first post for revised code. Made changes to local variables. I would appreciate any input. Thanks, The Buzzard Quote
flowerrobot Posted May 7, 2009 Posted May 7, 2009 How did you work out the vector images, manly the arc of the door. Quote
The Buzzard Posted May 7, 2009 Author Posted May 7, 2009 Hey Flowerrobot, I was wondering when someone would ask me this. Here are the steps. 1. I just draw the door to a basic size. 2. Position the door in the screen center. 3. I run a program call mimage2.lsp (This program will make a dialog and lisp program with one image). 4. When the program is created, It is stored in a temp directory on C:. 5. I open the program and copy the list and paste it in my program. (I just format it accordingly). 6. I do this for each image. Because of the function size I show here the first and last image in the function. You can refer to the complete function in the code. ;;; F09 - Image Function - Update Door Image. ;Function Description (defun IDS_UDI (D:IMG) ;Define function, D:IMG ~ (Door Image) is the argument (setq D:IMG ;Set Door Image (strcat ;Concatenate string ""(eval D:SWG)""(eval D:ANG)""(eval D:IPT)"")) ;Evaluate D:SWG ~ (Door Swing) D:ANG ~ (Door Angle) D:IPT ~ (Door Insertion Point) (setq w (dimx_tile "imG1") ;Set width coordinate for imG1 h (dimy_tile "imG1")) ;Set height coordinate for imG1 (start_image "imG1") ;Start image imG1 (fill_image 0 0 w h -15) ;Fill image (cond ;If one of the following conditions apply ((= D:IMG "LEFT90OUT") ;D:IMG ~ (Door Image) = D:SWG ~ (LEFT) D:ANG ~ (90) D:IPT ~ (OUT) (mapcar 'vector_image ;Start mapcar (list 36 37 36 37 36 37 36 37 37 36 36 41 41 32 41 32 32 41 41 32 32 41 37 41 41 37 37 119 119 119 119 119 119 118 118 118 117 117 116 116 115 114 114 113 112 111 110 109 108 107 106 105 104 103 102 101 99 98 97 95 94 92 91 89 88 86 84 83 81 79 78 76 74 72 70 69 67 65 63 61 59 57 55 53 51 49 47 45 43 40 40 33 40 33 34 40 40 34 33 40 33 34 40 34 40 40 33 34 40 40 33) (list 95 95 86 95 86 86 95 95 86 86 95 91 90 91 90 91 90 91 90 90 91 91 8 8 91 91 8 91 89 87 85 83 81 79 77 75 73 71 69 67 65 63 61 59 58 56 54 52 50 49 47 45 44 42 40 39 37 36 34 33 31 30 29 27 26 25 24 23 21 20 19 18 17 17 16 15 14 13 13 12 12 11 11 10 10 9 9 9 9 94 94 88 94 88 87 94 94 87 88 94 94 94 87 94 87 88 94 94 88 87 94) (list 37 36 36 36 37 37 37 37 36 36 36 41 32 41 32 32 41 41 32 32 41 41 41 41 37 37 37 119 119 119 119 119 118 118 118 117 117 116 116 115 114 114 113 112 111 110 109 108 107 106 105 104 103 102 101 99 98 97 95 94 92 91 89 88 86 84 83 81 79 78 76 74 72 70 69 67 65 63 61 59 57 55 53 51 49 47 45 43 41 40 33 40 33 34 40 40 34 33 40 40 34 40 33 40 40 34 34 40 40 33 33) (list 95 86 95 86 86 95 95 86 86 95 95 90 91 91 91 90 90 90 90 91 91 91 8 91 91 8 8 89 87 85 83 81 79 77 75 73 71 69 67 65 63 61 59 58 56 54 52 50 49 47 45 44 42 40 39 37 36 34 33 31 30 29 27 26 25 24 23 21 20 19 18 17 17 16 15 14 13 13 12 12 11 11 10 10 9 9 9 9 9 94 88 94 88 87 94 94 87 88 94 94 94 87 94 87 88 94 94 88 87 94 94) (list 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1))) ((= D:IMG "LEFT-RIGHT45IN") ;D:IMG ~ (Door Image) = D:SWG ~ (LEFT-RIGHT) D:ANG ~ (45) D:IPT ~ (IN) (mapcar 'vector_image ;Start mapcar (list 78 78 78 78 78 77 77 77 76 76 76 75 74 74 73 72 72 71 70 69 68 67 66 65 64 63 62 61 99 96 147 150 99 96 95 94 93 92 91 90 89 88 87 86 85 84 83 83 82 81 81 80 80 80 79 79 79 78 78 78 78 8 9 8 9 8 9 8 9 9 8 8 13 13 5 13 5 5 13 13 5 5 13 57 60 9 6 57 11 12 6 12 6 6 11 12 6 6 11 6 6 11 6 11 12 6 6 12 11 6) (list 88 86 85 83 81 79 77 75 73 72 70 68 66 64 63 61 59 57 56 54 52 51 49 48 46 45 43 42 37 40 91 88 37 40 42 43 45 46 48 49 51 52 54 56 57 59 61 63 64 66 68 70 72 73 75 77 79 81 83 85 86 95 95 87 95 87 87 95 95 87 87 95 92 91 92 91 92 91 92 91 91 92 92 37 40 91 88 37 94 93 89 93 89 88 94 93 88 89 94 93 94 88 94 88 89 93 94 89 88 93) (list 78 78 78 78 77 77 77 76 76 76 75 74 74 73 72 72 71 70 69 68 67 66 65 64 63 62 61 60 96 147 150 99 99 95 94 93 92 91 90 89 88 87 86 85 84 83 83 82 81 81 80 80 80 79 79 79 78 78 78 78 78 9 8 8 8 9 9 9 9 8 8 8 13 5 13 5 5 13 13 5 5 13 13 60 9 6 57 57 12 6 11 6 6 12 12 6 6 11 11 6 11 6 11 12 6 6 12 11 6 6) (list 86 85 83 81 79 77 75 73 72 70 68 66 64 63 61 59 57 56 54 52 51 49 48 46 45 43 42 40 40 91 88 37 37 42 43 45 46 48 49 51 52 54 56 57 59 61 63 64 66 68 70 72 73 75 77 79 81 83 85 86 88 95 87 95 87 87 95 95 87 87 95 95 91 92 92 92 91 91 91 91 92 92 92 40 91 88 37 37 93 89 94 89 88 93 93 88 89 94 94 94 88 93 88 89 94 94 89 88 93 93) (list 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1)))) (end_image) ;End image ) ;End define function Any further questions, Just ask. Thanks, The Buzzard Quote
The Buzzard Posted May 7, 2009 Author Posted May 7, 2009 Here is the complete thread on the images. You can download the code from here, Just make sure you copy the most recent version. http://autolisp-exchange.com/Forums/Forum4/F4T18P1.htm The Buzzard Quote
The Buzzard Posted May 7, 2009 Author Posted May 7, 2009 To be more specific, I use several images for one type of door. A combination of selections changes these images. e.g. 1. Left Door Swing at 90 degrees with an Outside insertion point. 2. Left Door Swing at 90 degrees with an Inside insertion point. 3. Left Door Swing at 45 degrees with an Outside insertion point. 4. Left Door Swing at 45 degrees with an Inside insertion point. The attached code below is part of the main function that will cause the images to change. (IDS_UDI D:IMG) ;Goto IDS_UDI Image Function ~ D:IMG (Door Image) is the argument (action_tile "LEFT" ;When radio_button Single Door - Left is selected, KEY is LEFT "(IDS_UDI (setq D:SWG \"LEFT\"))") ;Goto IDS_UDI Image Function, Set variable D:SWG ~ (Door Swing) to LEFT (action_tile "RIGHT" ;When radio_button Single Door - Right is selected, KEY is RIGHT "(IDS_UDI (setq D:SWG \"RIGHT\"))") ;Goto IDS_UDI Image Function, Set variable D:SWG ~ (Door Swing) to RIGHT (action_tile "LEFT-RIGHT" ;When radio_button Double Door is selected, KEY is LEFT-RIGHT "(IDS_UDI (setq D:SWG \"LEFT-RIGHT\"))") ;Goto IDS_UDI Image Function, Set variable D:SWG ~ (Door Swing) to LEFT-RIGHT (action_tile "90" ;When radio_button 90° Angle is selected, KEY is 90 "(IDS_UDI (setq D:ANG \"90\"))") ;Goto IDS_UDI Image Function, Set variable D:ANG ~ (Door Angle) to 90 (action_tile "45" ;When radio_button 45° Angle is selected, KEY is 45 "(IDS_UDI (setq D:ANG \"45\"))") ;Goto IDS_UDI Image Function, Set variable D:ANG ~ (Door Angle) to 45 (action_tile "OUT" ;When radio_button Outside Pivot is selected, KEY is OUT "(IDS_UDI (setq D:IPT \"OUT\"))") ;Goto IDS_UDI Image Function, Set variable D:IPT ~ (Door Insertion Point) to OUT (action_tile "IN" ;When radio_button Inside Pivot is selected, KEY is IN "(IDS_UDI (setq D:IPT \"IN\"))") ;Goto IDS_UDI Image Function, Set variable D:IPT ~ (Door Insertion Point) to IN This part of the code combines the selections from the above keys. I create a variable called D:IMG used as the argument. It is set by combining the variables D:SWG, D:ANG & D:IPT. When any of these variable combinations are selected, I use a conditional to go to the specific image list that was created with the mimage2.lsp. (Refer to the post 13 for list example) ;;; F09 - Image Function - Update Door Image. ;Function Description (defun IDS_UDI (D:IMG) ;Define function, D:IMG ~ (Door Image) is the argument (setq D:IMG ;Set Door Image (strcat ;Concatenate string ""(eval D:SWG)""(eval D:ANG)""(eval D:IPT)"")) ;Evaluate D:SWG ~ (Door Swing) D:ANG ~ (Door Angle) D:IPT ~ (Door Insertion Point) (setq w (dimx_tile "imG1") ;Set width coordinate for imG1 h (dimy_tile "imG1")) ;Set height coordinate for imG1 (start_image "imG1") ;Start image imG1 (fill_image 0 0 w h -15) ;Fill image (cond ;If one of the following conditions apply ((= D:IMG "LEFT90OUT") ;D:IMG ~ (Door Image) = D:SWG ~ (LEFT) D:ANG ~ (90) D:IPT ~ (OUT) (mapcar 'vector_image ;Start mapcar Quote
flowerrobot Posted May 8, 2009 Posted May 8, 2009 Wow, thanks for that, that is so much better than a sld. and its so simple. Thanks for that Quote
The Buzzard Posted May 8, 2009 Author Posted May 8, 2009 Your welcome, Anything else, Just ask. Quote
flowerrobot Posted May 8, 2009 Posted May 8, 2009 *edit, fixed the error Is their any sort of thing, Image or alike that can be compliled into a vlx. as im trying to keep it all in a nice easy file. Hence why i thought vector image, Tho it is good, I would like to put a nice render of my images in 3d going of into the distance. below is the code i used. and its going to a tile_button. Quote
The Buzzard Posted May 8, 2009 Author Posted May 8, 2009 Flowerrobot, If you have the complete code, let me see it so I can let you know where the problem is. Quote
The Buzzard Posted May 9, 2009 Author Posted May 9, 2009 I believe it will work, However an image button works a bit differently. It may have to be written differently as well. The display I use works with popup lists. I will be happy to help you with this if you want. 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.