Showing posts with label Programming in AutoLISP. Show all posts
Showing posts with label Programming in AutoLISP. Show all posts

Friday, January 17, 2014

My First AutoLISP Customer




Danny Sin was my fist AutoLISP customer. His company was building shutters for shops, steel doors and steel racks.


A Factory For Shutters


Danny had studied at a university in Taiwan. He came back to Malaysia. His father had a factory for shutters.


But his father's factory was a family business. Danny wanted to start his own business. And that is what he did.


Danny's business was doing very well. He was getting a lot of orders. But he felt he had a problem. With AutoCAD.


Problem With AutoCAD


I was like this. A prospect or customer came to him. Looking for a shutter. Danny made an offer and with the offer came a drawing.


The drawing was an AutoCAD drawing. It was a drawing of the shutter that was offered. But creating a drawing took a lot of time.


I had been writing e-mails to AutoCAD users. I told them how they could save a lot of time when they worked with an AutoLISP program.


Writing AutoLISP Programs


Danny was interested. He engaged me for writing AutoLISP programs for him. He was selling different types of shutters.


For each type of shutter a different AutoLISP program had to be written. I had to write five different AutoLISP programs.


I wrote the AutoLISP programs. And then I found out about the steel doors. For them also AutoCAD drawings had to be created.


I wrote an AutoLISP program for creating AutoLISP drawings of steel doors. Those drawings were created in no time too.


Saving A Lot Of Time


Before Danny had his AutoCAD programs, it took a whole day to create an AutoCAD drawing of a shutter or steel door.


The AutoLISP program worked with dialog boxes. So the AutoCAD drawing wasn't create right away. But still a lot of time was saved.


Each AutoCAD drawing was created within one minute. It was no longer a matter of waiting a whole day for a quotation.


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://www.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:


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


This article may be freely reprinted or distributed in its entirety in any Ezine, newsletter, blog, or website. As long as the following resource box is added:


-------------------------------------------------
This article is written by Jos van Doorn. He is an AutoLISP programmer who has helped engineering firms and architects to get their AutoCAD drawings fast, without waiting for hours.


You can find more valuable information about his
business and AutoLISP at his blog. It is here:


http://www.makeautocadfast.blogspot.com


If you want to contact him. Go to his blog and leave a comment.
-------------------------------------------------


Friday, January 10, 2014

Another AutoLISP And DCL Program 2


Introduction


Now I'm going to talk about the AutoLISP file and the DCL file. I will start with talking about the DCL file.


The DCL File


Here is the DCL file. It is not really complicated. See how the ALIGNMENT attributes and the SPACER attributes are used.


selpt : dialog
{
label = "Select Point";
: boxed_column
{
label = "Sample Point";
: spacer
{
height=1;
}
: button
{
label = "Pick Point <";
key = "hide";
width = 12;
fixed_width = true;
mnemonic = "P";
alignment = centered;
}
: spacer
{
height=1;
}
: edit_box
{
key = "px";
label = "&X:";
width = 8;
fixed_width = true;
alignment = centered;
}
: edit_box
{
key = "py";
label = "&Y:";
width = 8;
fixed_width = true;
alignment = centered;
}
: edit_box
{
key = "pz";
label = "&Z:";
width = 8;
fixed_width = true;
alignment = centered;
}
: spacer
{
height=1;
}
}
: spacer
{
height=1;
}
ok_cancel;
}


In the DCL file a button is specified and there are three edit boxes in the dialog box file. You see what text is displayed.


You can also see what the keys of the button and the text boxes are. The AutoLISP program makes a reference to them.


The AutoLISP Program


Here is the AutoLISP program. I did not follow what was given by AFRALISP. Their program has no functions. My version has.


(defun c:selp ()
(start)
(setq px "0.000"
py "0.000"
pz "0.000"
fl 4
)
(setq di (load_dialog "c:/make/selpt.dcl"))
(while (> fl 2)
(if (not (new_dialog "selpt" di))
(exit)
)
(sttle px py pz)
(action_tile "cancel" "(done_dialog 1)")
(action_tile "accept"
"(setq px (get_tile \"p1\"))
(setq py (get_tile \"p2\"))
(setq pz (get_tile \"p3\"))
(done_dialog 2)"
)
(action_tile "hide" "(done_dialog 4)")
(setq fl (start_dialog))
(if (= fl 4)
(progn
(setq ls (selpt)
px (nth 0 ls)
py (nth 1 ls)
pz (nth 2 ls)
)
)
)
)
(unload_dialog di)
(endpr)
)


(defun start (/ ss)
(setvar "cmdecho" 0)
(command "limits" (list 0 0)
(list 120 120)
)
(command "snap" 10)
(command "grid" 10)
(command "zoom" "all")
(command "zoom" "0.8x")
(setq ss (ssget "c" (list 0 0)
(list 120 120)
)
)
(if ss
(command "erase" "all" "")
)
(command "-style" ""
"Courier New"
0
1
0
"No"
"No"
)
)


(defun sttle (px py pz)
(set_tile "px" px)
(set_tile "py" py)
(set_tile "pz" pz)
)


(defun selpt ()
(setq selpoint (getpoint
"\nInsertion Point: "
)
)
(setq px (rtos (car selpoint) 2 4))
(setq py (rtos (cadr selpoint) 2 4))
(setq pz (rtos (caddr selpoint) 2 4))
(list px py pz)
)


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


(c:selp)


I have added the following functions to the program:


1. START
2. STTLE
3. SELPT
4. ENDPR


You already know about the first and the last function. So I don't have to give an explanation about them.


As the AutoLISP program starts, a call is made to the START function. You know what is done by the START function.


Next start values are given to the following three variables:


PX
PY
PZ


The variables get the value “0.000”.


The FL variable gets the value. That variable is used for the WHILE function, that comes next. If continues as long as the value is more than two.


Before the WHILE function is started the dialog box is loaded into the AutoLISP program. It isn't displayed yet.


In the WHILE function the dialog box is displayed. And the PX, PT, and PZ tile get the value that has been given to the variables.


That is done with the second function. It is done with the STTLE function. That function is used again and again.


Next ACTION_TILE functions are used. Those functions are used as there is clicked on one of the buttons.


There can be clicked on the CANCEL button, on the OK button, or on the PICK Point button. These are the keys of the buttons:


Button
Key




CANCEL
CANCEL
OK
ACCEPT
PICK POINT
HIDE


DONE_DIALOG is given a value. The value depends on the button that has been clicked. These are the values:


Button
Value




CANCEL
0
OK
1
PICK POINT
4


If there has been clicked on the PICK Point button, then a point is picked in the screen. And a new value for PX, PY, and PZ is found.


We come again to the STTLE function. And the new values are given to the PX, PY, and PZ tiles. And they are displayed in the dialog box.


After clicking on the PICK POINT button, the FL value is given the value 4. So we stay in the WHILE loop.


If there is clicked on the CANCEL button or the OK button, then the FL variable gets the value zero or one. There is jumped out of the WHILE loop.


When there is jumped out of the WHILE loop, then the AutoLISP program ends. No so if there is clicked on the PICK POINT button.


OK. This is the explanation of the AutoLISP program. Now you know how the AutoLISP program works. I hope it is clear.


But that is the most important part. Now you have seen how you can perform an AutoLISP action if a dialog box is displayed.


Telling Others


Do you like what you have read? Do you know other people, that also could be interested in what I'm saying? 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.


YouTube


I have added videos to YouTube. The videos give examples of my AutoLISP programming work. You could engage me if you want.


If you are thinking of engaging me. Listen. I work for free. I write an AutoLISP program for you. You only pay when you are satisfied.


That is important. When you come to me with an AutoLISP programming job, you are not spending any money.


On YouTube you can find my videos here:


http://youtu.be/zgTWKo7DpeM
http://youtu.be/sd-sbyM3-d8
http://youtu.be/2yhk7G5KlAs
http://youtu.be/mEA6lymElqI
http://youtu.be/eyOdOTHPH-o
http://youtu.be/O8Zy6n9zS8Q
http://youtu.be/5sMBtfnnizk
http://youtu.be/QrmbXvmFa2o
http://youtu.be/4Ol-YpDC2MY
http://youtu.be/DWFke-Nie0E


Saturday, November 30, 2013

AutoLISP And Finding A Direction 2

Introduction


In the previous post I promised you that here you'll get my AutoLISP program. Well. Here it is. With an explanation and how it works.


The AutoLISP program


(defun c:fnddr (/ dr e1 e2 e3 e4 e5 e6 ls p1 p2
p3
)
(start)
(setq p1 (getpoint "\nP1: ")
p2 (getpoint "\nP2: " p1)
)
(command "line" p1 p2 "")
(while (setq p3 (getpoint "\nP3: " p2))
(command "line" p2 p3 "")
(setq dr (fnddr p1 p2 p3))
(princ "\nDirection: ")
(princ dr)
(setq p1 p2
p2 p3
)
)
(endpr)
)


(defun start (/ ss)
(setvar "cmdecho" 0)
(textscr)
(command "limits" (list 0 0)
(list 420 297)
)
(command "snap" 10)
(command "grid" 10)
(setq ss (ssget "c" (list 0 0)
(list 420 297)
)
)
(if ss
(command "erase" "all" "")
)
(command "zoom" "all")
(command "zoom" "0.8x")
)


(defun fnddr (p1 p2 p3 / a1 a2 an dr)
(setq a1 (angle p1 p2)
a2 (angle p2 p3)
)
(if (> a1 pi)
(setq a2 (+ a2 (* pi 2)))
)
(princ "\nA1: ")
(princ (antdg a1))
(princ "\nA1 + pi: ")
(princ (antdg (+ a1 pi)))
(princ "\nA2: ")
(princ (antdg a2))
(if (and (< a1 a2)
(> (+ a1 pi) a2)
)
(setq dr "left")
(setq dr "right")
)
dr
)


(defun antdg (an)
(* (/ an pi) 180)
)


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


(c:fnddr)


What The Program Does


Copy the program to a text file, save it under the name FNDDR.LSP, and run the program in AutoCAD or any other suitable CAD program.


The program starts right away. There is asked to pick a point in the screen. That point is P1. Next there is asked to pick point P2.


A line is drawn from P1 to P2. And then there is asked to pick point P3. Again a line is drawn. This time from P2 to P3.


The angles of the line from P1 to P2 and the angle of the line from P2 to P3 is printed in the screen. Also the direction is given.


Again there is asked for point P3. If you want to stop with the program, then press the right mouse button or the ENTER key.


An Example Of The Program


See the picture. It gives an example of how the program works. Eight lines have been drawn. The angles and direction are given.


How The Program Works


The AutoLISP program start with the START function. You already know how that function works. No explanation.


There is asked for the points P1 and P2. And a line is drawn between these two points. And then a WHILE loop starts.



The WHILE loop continues as long as the point P3 is picked. In the WHILE loop a line is drawn and the direction is found.


The line is drawn from point P2 to point P3. And the direction is found in the function FNDDR. I talk about it later.


The direction is printed in the screen. After that the value of the points P1 and P2 are changed. P1 becomes P2 and P2 becomes P3.


The FNDDR Function


Here is the FNDDR function.


(defun fnddr (p1 p2 p3 / a1 a2 an dr)
(setq a1 (angle p1 p2)
a2 (angle p2 p3)
)
(if (> a1 pi)
(setq a2 (+ a2 (* pi 2)))
)
(princ "\nA1: ")
(princ (antdg a1))
(princ "\nA1 + pi: ")
(princ (antdg (+ a1 pi)))
(princ "\nA2: ")
(princ (antdg a2))
(if (and (< a1 a2)
(> (+ a1 pi) a2)
)
(setq dr "left")
(setq dr "right")
)
dr
)


(defun antdg (an)
(* (/ an pi) 180)
)


The angle between the points P1 and P2 is found and the angle between the points P2 and P3. Those angels are stored in the variables A1 and A2.


If the angle A1 is more than 180 degrees, then the value is increased with 360 degrees. That is done with the IF function.


The angles are written down and the direction of the second line is found. The area of the second angle is checked.


We also have the ANTDG function. That function is used to turn angels in radians into angels in degrees.


The Complete AutoLISP Program


Very good. Now you have got the complete AutoLISP program. With an explanation of it and an explanation of how it works.




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://www.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:


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


This article may be freely reprinted or distributed in its entirety in any Ezine, newsletter, blog, or website. As long as the following resource box is added:


-------------------------------------------------
This article is written by Jos van Doorn. He is an AutoLISP programmer who has helped engineering firms and architects to get their AutoCAD drawings fast, without waiting for hours.


You can find more valuable information about his
business and AutoLISP at his blog. It is here:


http://www.makeautocadfast.blogspot.com


If you want to contact him. Go to his blog and leave a comment.
-------------------------------------------------


Wednesday, November 27, 2013

The Inters Function Of AutoLISP 2

Introduction


You have seen the AutoLISP program for the INTERS function. You have seen the images that are produced and you have seen the listing.


Functions


Now I'm going to talk about the functions of the AutoLISP program. Here is a list of all the functions and what they do.


Function Task


START Starting the program
DRWLN Drawing lines
DRWDN Drawing the donut
ENDPR Ending the program


The START Function And The ENDPR Function


In previous posts I have been talking about those two functions. I have explained how they work. So I can skip talking about them.


The DRWLN Function


Here is the function:


(defun drwln (tx / p1 p2)
(setq p1 (getpoint (strcat tx " - point 1: "))
p2 (getpoint (strcat tx " - point 2: "))
)
(command "line" p1 p2 "")
(list (list p1) (list p2))
)


From the main progrma a call is made to the function. Two times. And a text is given to the function.


The first time the text is “First line” and the second time the text is “Second line”. The text comes in the GETPOINT function.


With the GETPOINT function two points are picked. The points are given back to the main program. An there they are given names.


The first time the two points are given the names P1 and P2. The second time the points are given the names P3 and P4.


In the DRWLN function not only two points are entered. There is also a line drawn between those two points.


The DRWDN Function


Here is the function:


(defun drwdn (p1 p2 p3 p4 / p5)
(setq p5 (inters p1 p2 p3 p4))
(if p5
(princ "\nThe lines cross")
(progn
(princ "\nThe lines don't cross")
(setq p5 (inters p1 p2 p3 p4 nil))
)
)
(command "donut" 0 0.5 p5 "")
)


The points P1, P2, P3, and P4 are given to the function. The ITERS function is used to find the point where the lines cross.


But maybe the lines do not cross. If so. The INTERS function gives back the variable P5. And then the variable has no value.


If the P5 variable has no value, we want to find the point where the extension of the lines cross. We use the INTERS function again.


But this time the four points are given to the function. And behind the four points is added NIL. Now is found where the extended lines cross.


Whatever. We have found P5. And a donut can be drawn in the place of P5. That is all that is done in this function.


The Whole AutoLISP Program


You have now had the whole AutoLISP program and an explanation of it. Now you have seen how the whole AutoLISP program is.




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://www.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:


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


This article may be freely reprinted or distributed in its entirety in any Ezine, newsletter, blog, or website. As long as the following resource box is added:


-------------------------------------------------
This article is written by Jos van Doorn. He is an AutoLISP programmer who has helped engineering firms and architects to get their AutoCAD drawings fast, without waiting for hours.


You can find more valuable information about his
business and AutoLISP at his blog. It is here:


http://www.makeautocadfast.blogspot.com


If you want to contact him. Go to his blog and leave a comment.
-------------------------------------------------


The Inters Function Of AutoLISP 1

Introduction


Now I'm going to talk about the INTERS function of AutoLISP. You know what the INTERS function does. It finds the point where two line cross.


I can also find the find where the extension of tow lines cross. But then the use is a little bit different.


What The AutoLISP Program Does


The AutoLISP starts. Id there is something in the screen, then it is deleted. We start with an empty screen.


The AutoLISP program asks us to pick two points for the first line and two points for the second line. The lines are drawn.


Now two things can happen:


1. The lines cross
2. The lines don't cross


If the lines cross, then see what you will get in the AutoCAD screen. A donut is drawn in the point where the lines cross.


If the lines do not cross, then a donut is drawn where the extended lines cross. Look at the picture that I have got.


That is clear. No matter if the lines cross or don't cross. A donut is drawn where the lines cross or the extended lines cross.



The AutoLISP Program


Here is the AutoLISP program:


(defun c:inter (/ ls p1 p2 p3 p4)
(start)
(setq ls (drwln "\nFirst line")
p1 (car (nth 0 ls))
p2 (car (nth 1 ls))
)
(setq ls (drwln "\nSecond line")
p3 (car (nth 0 ls))
p4 (car (nth 1 ls))
)
(drwdn p1 p2 p3 p4)
(endpr)
)


(defun start (/ p1 p2 ss)
(setvar "cmdecho" 0)
(command "zoom" "all")
(setq p1 (getvar "vsmin")
p2 (getvar "vsmax")
ss (ssget "c" p1 p2)
)
(if ss
(command "erase" "all" "")
)
)


(defun drwln (tx / p1 p2)
(setq p1 (getpoint (strcat tx " - point 1: "))
p2 (getpoint (strcat tx " - point 2: "))
)
(command "line" p1 p2 "")
(list (list p1) (list p2))
)


(defun drwdn (p1 p2 p3 p4 / p5)
(setq p5 (inters p1 p2 p3 p4))
(if p5
(princ "\nThe lines cross")
(progn
(princ "\nThe lines don't cross")
(setq p5 (inters p1 p2 p3 p4 nil))
)
)
(command "donut" 0 0.5 p5 "")
)


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


(c:inter)


Next Post


In the next post I'm going to talk about the functions of the AutoLISP program. I'm also going to explain how they work.




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://www.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:


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


This article may be freely reprinted or distributed in its entirety in any Ezine, newsletter, blog, or website. As long as the following resource box is added:


-------------------------------------------------
This article is written by Jos van Doorn. He is an AutoLISP programmer who has helped engineering firms and architects to get their AutoCAD drawings fast, without waiting for hours.


You can find more valuable information about his
business and AutoLISP at his blog. It is here:


http://www.makeautocadfast.blogspot.com


If you want to contact him. Go to his blog and leave a comment.
-------------------------------------------------


Sunday, November 24, 2013

AutoLISP Program For Lines and Circles

Introduction


This is a very simple AutoLISP program that I have got for you. With it six lines are drawn and three circles.


This is what you will get when the program has run. You will see the six lines and the three circles.


The AutoLISP Program


Let's get to business right away. You want to see the AutoLISP program that I have got. OK. No more waiting. Here it is.


(defun c:exerc (/ pt)
(start)
(setq ip (getip))
(drwln ip)
(drwcr ip)
(endpr)
)


(defun start ()
(setvar "cmdecho" 0)
(command "zoom" "all")
(setq p1 (getvar "vsmin")
p2 (getvar "vsmax")
ss (ssget "c" p1 p2)
)
(if ss
(command "erase" "all" "")
)
)


(defun getip ()
(setq ip (getpoint "\nInsertion point: "))
)


(defun drwln (ip)
( command "line" ip
(setq ip (polar ip
0
200
)
)
(setq ip (polar ip
(* pi 0.5)
200
)
)
(setq ip (polar ip
pi
100
)
)
(setq ip (polar ip
(* pi 1.5)
100
)
)
(setq ip (polar ip
pi
100
)
)
"c"
)
)


(defun drwcr (ip)
(command "circle" (setq ip (polar ip
(* pi 0.5)
50
)
ip (polar ip
0
50
)
)
25
)
(command "circle" (setq ip (polar ip
0
100
)
)
25
)
(command "circle" (setq ip (polar ip
(* pi 0.5)
100
)
)
25
)
)


(defun endpr ()
(command "zoom" "extents")
(command "zoom" "0.8x")
(setvar "cmdecho" 1)
(princ)
)


(c:exerc)


How The Program Works


You know how I do my AutoLISP programming. First I figure out what must be done by the program. And then I write functions for doing that.


What needs to be done The function


The program starts with a
clean screen START
An insertion point is
entered GETIP
Lines are drawn DRWLN
Circles are drawn DRWCR
The program ends ENDPR


Next Post


In my next post I'm going to talk about all the functions of this AutoLISP program. I'm going to tell you what they do.




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://www.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:


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


This article may be freely reprinted or distributed in its entirety in any Ezine, newsletter, blog, or website. As long as the following resource box is added:


-------------------------------------------------
This article is written by Jos van Doorn. He is an AutoLISP programmer who has helped engineering firms and architects to get their AutoCAD drawings fast, without waiting for hours.


You can find more valuable information about his
business and AutoLISP at his blog. It is here:


http://www.makeautocadfast.blogspot.com


If you want to contact him. Go to his blog and leave a comment.
-------------------------------------------------


Sunday, November 17, 2013

Who Else Wants An AutoLISP Training?

Training




After writing an AutoLISP program, I give the complete program to my customer. The listing of the program is not hidden.


I want my customer to see how the program was written. And I want him and his staff to understand how the program works.


To have an understanding of AutoLISP and to see how it works. It is important for my customer and his staff that they know AutoLISP.


I have an e-book. The e-book is an AutoLISP course. I give the e-book to my customers and his staff. So they learn AutoLISP.


That is what I also do. I show the AutoLISP program to my customer. If he likes it, then he gets it. But there is more.


I give an explanation of the AutoLISP program to my customer and his staff. I want my customer and his staff to know how it works.


Once the customer and his staff know how the AutoLISP program works, then they can make changes to it. If they want.


If there is asked for, then I also give an AutoLISP training to my customer and his staff. In person. I will answer all their questions.


Next Post


So you are thinking of engaging Make AutoCAD Fast for writing an AutoLISP program. But you are a first time customer. How is that?




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://www.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:


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