Friday, September 20, 2013

AutoLISP Program For Drawing A Cabinet 7

The Drawers


Before we draw the drawers. I must tell you about the drawers. I must tell you about the sizes of the drawers, related to the width.


See the picture. The height of each drawer is 100. And below and above each drawer is a distance of 25.


The width of the drawer. The distance between a drawer and the side of the cabinet is 125. So the width is 250 less than the width of the cabinet.




The Function For Drawing The Drawers


Here is the function for drawing the drawers.


(defun drcab (pt wd nr)
(command "layer"
"m"
"cabinet"
"c"
"green"
""
""
)
(command "line" pt
(setq pt (polar pt 0 wd))
(setq pt (polar pt
(* pi 0.5)
(+ (* nr
(+ 100 25))
25)
)
)
(setq pt (polar pt pi wd))
"c"
)
)


For starters we create the CABINET layer. The color of the layer is green. So what is drawn on it, gets the color green.


Next we can draw a rectangle. The rectangle starts in the base pointy. We have set the base point as being the point 0,0.


That is important. The height of the cabinet. It is like this. Each drawer has got a height of 100. And on each side is a length of 25.


For drawing the height of the cabinet we must make a calculation. The height is the number of drawers times 100 plus 25.


Above the drawers is an additional length of 25. So after the calculation is made 25 is added to the length that has been found.


The Next Post


We have drawn the drawers. Now we can draw the handles and the dimensions. I'm going to talk about it in the next posts.




Telling Others


Do you like what you have read? Do you know other people, that could be interested? Could you tell them about this blog?




Comment


In the mean time. If you have any questions. Or you want to tell me something. Feel free to add a comment to this blog.


I would love to hear from you. And when you come to me with a comment. I will give a reply to your question or remark.




Warning


Don't spend a lot of money on AutoCAD Light. It is only for creating 2D drawings and it doesn't support AutoLISP.


There is a very similar CAD program. And that is completely free. The name of the program? DraftSight.


How to get it? Do a search on Google for “download DraftSight”. And you will find where you can download the program.






Only Create Drawings


When your CAD operators don't create the borders of your drawings, a lot of time is saved. You get your drawings much faster.


I have created a program that does exactly that. An AutoCAD drawing has been created and the program draws a border around it.


If you want to see how the program works, go to YouTube. You'll find the working of the program here:


http://youtu.be/O8Zy6n9zS8Q


Now the AutoLISP program gives you the choice to select the size of your border. You can select A4, A3, A2, or A1.


Maybe you already know the size of the border of your drawing. Maybe all your drawings have the size A1. If so. Let me know.


That is important. The program finds the proper scale of your drawing. Or do you already know what the scale always is?


I can write the AutoLISP program that you want. The price? I will only charge you RM 600.-. That is less than US $ 200.-.






You are welcome to publish my article provided you include the resource box with links intact.




Resource Box


Jos van Doorn is an AutoLISP programmer and blogger. He is originally from Holland and now he lives in Malaysia.



He is the founder of the Make AutoCAD Fast business. Make AutoCAD Fast is writing AutoLISP programs for AutoCAD users.



Make AutoCAD Fast created an AutoLISP program for drawing a border around AutoCAD drawings. The program can be found on YouTube.



Jos is writing a blog. In it are AutoLISP programs with information and it is about Make AutoCAD Fast. You can find his blog here:


Make AutoCAD Fast


Maybe you have a question. Or want to tell me something. You can contact me on this e-mail address:


makeautocadfast@ymail.com


No comments:

Post a Comment