Tuesday, November 26, 2013

Get Your AutoCAD Drawings Right Away And Save A Lot Of Money 1




That is the question most AutoCAD users have. I'm not sure if they did. But let's say they have heard about AutoLISP.


Maybe they know that you can write applications in AutoLISP. But they are not sure whether they should get an AutoLISP application.


That is the question most AutoCAD users have. Why should you get an AutoLISP application? What is the advantage of an AutoLISP application?


The Advantage Of An AutoLISP Application


Let me tell you what the advantage of an AutoLISP application is. You can use it for creating complete AutoCAD drawings.


And when an AutoLISP application is used for creating an AutoCAD drawing, it is done in no time. You don't have to wait for hours.


That is great. But how fast is an AutoLISP application with creating an AutoCAD drawing. How much time can you save?


An AutoLISP Application


I have created an AutoLISP application that demonstrates how fast an AutoLISP application is. It creates an AutoCAD drawing.


I could have added a dialog box to it for entering the sizes. But I did not do that. I wanted to show how fast an AutoLISP application is.


See the drawing that is created by the AutoLISP application. It took less than one second to create the AutoCAD drawing.




The Listing Of The AutoLISP Program


But you want the have the listing of the AutoLISP program. OK. You will get it. Copy it to a text file and save it under the name MKACF.LSP.


(defun c:mkacf ()
(start)
(setq sp (list 25 100))
(mklay)
(drfrv sp)
(drsdv sp)
(drtpv sp)
(stdmv)
(dmfrv sp)
(dmsdv sp)
(dmtpv sp)
(drwhd)
(drbrd)
(endpr)
)


(defun start (/ ss)
(setvar "cmdecho" 0)
(command "zoom" "extents")
(setq p1 (getvar "vsmin")
p2 (getvar "vsmax")
)
(setq ss (ssget "c" p1 p2))
(if ss
(command "erase" "all" "")
)
(command "-style" ""
"Courier New"
0
1
0
"No"
"No"
)
)


(defun mklay ()
(if (null (tblsearch "layer" "070"))
(command "layer" "m"
"070"
"c"
"cyan"
""
""
)
)
(if (null (tblsearch "layer" "050"))
(command "layer" "m"
"050"
"c"
"green"
""
""
)
)
(if (null (tblsearch "layer" "025"))
(command "layer" "m"
"025"
"c"
"red"
""
""
)
)
(if (null (tblsearch "layer" "center"))
(command "layer" "m"
"center"
"c"
"red"
""
"lt"
"center"
""
""
)
)
(if (null (tblsearch "layer" "dimensions"))
(command "layer" "m"
"dimensions"
"c"
"red"
""
""
)
)
(command "ltscale" 10)
)


(defun drfrv (sp)
(command "layer" "s" "center" "")
(command "line" (setq pt sp)
(polar pt 0 210)
""
)
(command "layer" "s" "050" "")
(command "line" (setq pt (polar sp 0 5)
pt (polar pt
(* pi 1.5)
37.5
)
)
(setq pt (polar pt 0 50))
""
)
(command "line" (setq pt (polar pt 0 25))
(setq pt (polar pt 0 125))
(setq pt (polar pt
(* pi 0.5)
75
)
)
(setq pt (polar pt pi 125))
""
)
(command "line" (setq pt (polar pt pi 25))
(setq pt (polar pt pi 50))
(setq pt (polar pt
(* pi 1.5)
75
)
)
""
)
(command "line" (setq pt (polar pt 0 50)
pt (polar pt
(* pi 1.5)
12.5
)
)
(setq pt (polar pt 0 25))
(setq pt (polar pt
(* pi 0.5)
100
)
)
(polar pt pi 25)
"c"
)
(command "line" pt
(setq pt (polar pt 0 125))
(polar pt (* pi 1.5) 12.5)
""
)
)
(defun drsdv (sp)
(command "layer" "s" "center" "")
(command "line" (setq pt (polar sp 0 220))
(polar pt 0 110)
""
)
(setq pt (polar pt 0 55))
(command "line" (polar pt (* pi 0.5) 55)
(polar pt (* pi 1.5) 55)
""
)
(command "layer" "s" "050" "")
(command "circle" pt 37.5)
(command "circle" pt 50)
(command "line" (setq pt (polar pt (* pi 0.5) 10)
pt (polar pt pi 5)
)
(polar pt (* pi 0.5) 60)
""
)
(setq et (entlast)
el (entget et)
p1 (cdr (assoc 10 el))
p2 (cdr (assoc 11 el))
)
(command "trim" "" p1 p2 "")
(command "line" (setq pt (polar pt 0 10))
(polar pt (* pi 0.5) 60)
""
)
(setq et (entlast)
el (entget et)
p1 (cdr (assoc 10 el))
p2 (cdr (assoc 11 el))
)
(command "trim" "" p1 p2 "")
)


(defun drtpv (sp)
(command "layer" "s" "center" "")
(command "line" (setq pt (polar sp
(* pi 0.5)
120
)
)
(polar pt 0 210)
""
)
(command "layer" "s" "050" "")
(command "line" (setq pt (polar pt 0 5)
pt (polar pt
(* pi 1.5)
37.5
)
)
(setq pt (polar pt 0 50))
""
)
(command "line" (setq pt (polar pt 0 25))
(setq pt (polar pt 0 125))
(setq pt (polar pt
(* pi 0.5)
75
)
)
(setq pt (polar pt pi 125))
""
)
(command "line" (setq pt (polar pt pi 25))
(setq pt (polar pt pi 50))
(setq pt (polar pt
(* pi 1.5)
75
)
)
""
)
(command "line" (setq pt (polar pt 0 50)
pt (polar pt
(* pi 1.5)
12.5
)
)
(setq pt (polar pt 0 25))
(setq pt (polar pt
(* pi 0.5)
100
)
)
(setq pt (polar pt pi 25))
"c"
)
(command "line" (setq pt (polar pt 0 25)
pt (polar pt
(* pi 1.5)
45
)
)
(polar pt 0 125)
""
)
(command "line" (setq pt (polar pt
(* pi 1.5)
10
)
)
(polar pt 0 125)
""
)
)


(defun stdmv ()
(command "layer" "s" "dimensions" "")
(command "-style"
"dimension"
"courier new"
0
1
0
"no"
"no"
)
(setvar "dimasz" 5)
(setvar "dimcen" 5)
(setvar "dimclrt" 2)
(setvar "dimdec" 0)
(setvar "dimdli" 1.25)
(setvar "dimexe" 1.25)
(setvar "dimexo" 1.25)
(setvar "dimgap" 1.25)
(setvar "dimtad" 1)
(setvar "dimtdec" 0)
(setvar "dimtih" 0)
(setvar "dimtoh" 0)
(setvar "dimtvp" 1.25)
(setvar "dimtxsty" "dimension")
(setvar "dimtxt" 5)
)


(defun dmfrv (sp)
(command "dimlinear"
(setq pt (polar sp 0 5)
pt (polar pt (* pi 1.5) 37.5)
)
(setq pt (polar pt 0 50)
pt (polar pt (* pi 1.5) 12.5)
)
(polar pt (* pi 1.5) 20)
)
(command "dimlinear"
pt
(setq pt (polar pt 0 25))
(polar pt (* pi 1.5) 20)
)
(command "dimlinear"
pt
(setq pt (polar pt 0 125)
pt (polar pt (* pi 0.5) 12.5)
)
(polar pt (* pi 1.5) 32.5)
)
)


(defun dmsdv (sp)
(command "dimlinear"
(setq pt (polar sp 0 275)
pt (polar pt (* pi 0.5) 37.5)
)
(polar pt (* pi 1.5) 75)
(polar pt 0 70)
)
(command "dimlinear"
(setq pt (polar pt (* pi 0.5) 12.5))
(polar pt (* pi 1.5) 100)
(polar pt 0 85)
)
)


(defun dmtpv (sp)
(command "dimlinear"
(setq pt (polar sp (* pi 0.5) 125)
pt (polar pt 0 205)
)
(polar pt (* pi 1.5) 10)
(polar pt 0 15)
)
)


(defun drwhd ()
(command "layer" "s" "070" "")
(command "text" "r"
(setq pt (polar (list 0 0)
0
407.5
)
pt (polar pt
(* pi 0.5)
12.5
)
)
7.5
0
"Make AutoCAD Fast"
)
(command "line" (setq pt (polar pt 0 2.5)
pt (polar pt
(* pi 0.5)
10
)
)
(setq pt (polar pt pi 143))
(polar pt (* pi 1.5) 12.5)
""
)
)


(defun drbrd ()
(command "layer" "s" "025" "")
(command "line" (list 0 0)
(list 420 0)
(list 420 297)
(list 0 297)
"c"
)
(command "layer" "s" "070" "")
(command "line" (list 10 10)
(list 410 10)
(list 410 287)
(list 10 287)
"c"
)
(command "zoom" "extents")
(command "zoom" "0.8x")
)


(defun endpr ()
(setvar "cmdecho" 1)
(princ)
)


(c:mkacf)


Next Post


In the next post I will give a full explanation of the AutoLISP program. I will tell how it was written.




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.
http://www.youtu.be/O8Zy6n9zS8Q



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
http://www.makeautocadfast.blogspot.com


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