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

Sunday, March 16, 2014

Drawing A Polyline with AutoLISP 4

Now I'm going to talk about all the functions of the AutoLISP program. I already gave you a list of all the functions. Here it is again:


The Functions


Function Action


START Setting the limits, erasing everything in the screen, setting the snap and grid, zooming out of the screen


DRLNS Drawing four lines


FNDET Finding line or polyline entity


DELPL Delete polyline


DRWPL Draw polyline, no intersection with other line


DPLIP Draw polyline, intersection with other line


ENDPR Ending of the program


The START And The END Function


Earlier I talked about those two functions. You know how they work. I don't have to tell you once more.


The DRLNS Function


This function is used to draw the lines in the screen. It is a very simple function. The LINE command is used twice.


Here is the function.


(defun-drlns-()
---(command-"line"-(list-120-0)
-------------------(list-10-0)
-------------------(list-10-120)
-------------------(list-120-120)
-------------------""
---)
---(command-"line"-(list-10-60)
-------------------(list-120-60)
-------------------""
---)
)


The FNDET Function


Let's first talk about this function. Let me tell you what it does. Let me tell you what is happening through the function.


There is asked to make a selection. A selection could have bene made or there is no selection made. The right mouse button is clicked.


What ever is done. A selection has been made or no selection has been made. An entity and the selection point is given back.


If a selection has been made, then a polyline has been selected or a line. If a polyline has been selected, then the points of it are found.


After the points have been found, the polyline is deleted and the line under the polyline is found. The points are needed for doing that.


If a line has been selected, then the entity of the line can easily be found. And the selection point is known too.


If no selection has been made, then the entity and the selection point, that are given back to the main program, get the value of nil.


Here is the FNDET function.


(defun-fndet-(/-an-el-et-ls-p1-p2-pt-sl-sp-ss-tp)
---(setq-sl-(entsel-"\nSelect-line: "))
---(if-sl
------(progn
---------(setq-et-(car-sl)
---------------el-(entget-et)
---------------sp-(cadr-sl)
---------------sp-(osnap-sp-"nea")
---------------tp-(cdr-(assoc-0-el))
---------)
---------(setq-ls-nil)
---------(if-(=-tp-"LWPOLYLINE")
------------(progn
---------------(while-(setq-nr-(caar-el))
------------------(if-(=-nr-10)
---------------------(progn
------------------------(setq-pt-(cdar-el))
------------------------(if-ls
---------------------------(setq-ls-(append-
-------------------------------------(list-pt)
-------------------------------------ls
------------------------------------)
---------------------------)
---------------------------(setq-ls-(list-pt))
------------------------)
---------------------)
------------------)
------------------(setq-el-(cddr-el))
---------------)
---------------(setq-p1-(nth-1-ls)
---------------------p2-(nth-0-ls)
---------------------an-(angle-p1-p2)
---------------)
---------------(command-"erase"-et-"")
---------------(setq-ss-(ssget-"c"-(polar-p1-
------------------------------------------an-
------------------------------------------1
-----------------------------------)
-----------------------------------(polar-p2-
------------------------------------------(+-an
---------------------------------------------pi
------------------------------------------)
------------------------------------------1
-----------------------------------)
------------------------)
---------------)
---------------(setq-et-(ssname-ss-0))
------------)
---------)
------)
------(setq-et-nil
------------sp-nil
------)
---)
---(list-et-sp)
)


I have told you what the function does. And I have told you what is happening through the function. Lets now see how it done.


Asking to make a selection. It is done with this line. The ENTSEL function is used. That function gives back a list.


(setq sl (entsel "\nSelect-line: "))


This is an example of the list that is given back by the ENTSEL function.


(<Entity name: 37d85a0> (61.8922 59.7297 0.000000))


If a selection has been made, then we want to know the name of the entity and the selection popint. We use these lines.


(setq-et-(car-sl)
el-(entget-et)
sp-(cadr-sl)
sp-(osnap-sp-"nea")
tp-(cdr-(assoc-0-el))
)


First we find the name of the entity. It is the first element in the list from the ENTSEL function. We use the CAR function.


The second element of the list is the selection point. To find it we use the CADR function. And we use the OSNAP function.


The OSNAP function is used to have the point laying on the polyline or the line that has been selected.


We also want to know the type of the entity. The type can be LINE or LWPOLYLINE. A polyline has been selected if it is LWPOLYLINE.


We find the type of the entity with this line.


(setq-tp-(cdr-(assoc-0-el))


If a line has been selected, then we have the name of the entity and the selection point. But a polyline could have been selected.


If a polyline has been selected, we need to find the points of the polyline. This is how it is done:


(while (setq nr (caar el))
(if (= nr 10)
(progn
(setq pt (cdar el))
(if ls
(setq ls (append (list pt) ls))
(setq ls (list pt))
)
)
)
(setq el (cddr el))
)


I start with a WHILE loop. The WHILE loop continues as long as a number has been found. The number is in the sub list of the entity list.


The CAAR function is used. With that function the first sub list of the entity list is taken and the first element in it.


There is checked if that number is ten. If so, the point is found in the sub list with the CDAR function.


Next the first sub list of the entity list is removed from the entity list with the CDDR function. And we continue with the WHILE loop.


The points of the polyline are found in the sub lists that have the number ten. We create a list. The kist has two points.


After the points have been found, the polyline is deleted and the line under the polyline is found. The points are needed for doing that.


The polyline is deleted with this line:


(command-"erase"-et-"")


These are the lines that are used to find the line under the polyline. We use the points of the polkyline for doing that.


Here are the programming lines:


(setq-ss-(ssget-"c"-(polar-p1-an-1)
(polar-p2-(+-an-pi)-1)
)
)
(setq-et-(ssname-ss-0))


The angle between the point P1 and P2 is measured. And the points of the SSGET function are one from the points.


We do not want to find the lines that cross the line at the points P1 and P2. That is why we go to points 1 from the original points.


We find a selection set. I call it SS. The first entity in the selection set is the line that we are looking for. Here is the programming line.


(setq-et-(ssname-ss-0))


If a line has been selected, then the entity of the line can easily be found. And the selection point is known too.


If no selection has been made, then the entity and the selection point, that are given back to the main program, get the value of nil.


Very good. We have found the line and we have found the selection point. Those two are put in a list and given back to the main program.


We put these two in a list. This is how it is done:


(list-et-sp)


Next Post


I have talked about the FNDET function. You have got a lot of information. I hope I was clear enough. If not, let me know.


In my next post I'm going to talk about the DELPL function. That function is used to delete the polyline that has been drawn.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla



To Your Success


Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.



The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.

Saturday, March 15, 2014

Drawing Polylines with AutoLISP 3

Here is the complete AutoLISP program for drawing polylines. Run it in your CAD program and see how it works.


Oh. You see all the slashes. And now you are thinking. What is that? Let me tell you what it is. It is done to make things clear.


In a Blogger blog I cannot add a listing with spaces. The spaces are removed by Blogger. So you do not see spaces.


What I did. I have replaced all spaces with a slash. You can do the same after copyin gthe program. Replaced slashes with spaces.


(defun-c:drwpl-(/-ct-ls-et-sp)
---(start)
---(drlns)
---(setq-ct-T)
---(while-ct
------(setq-ls-(fndet)
------------et-(nth-0-ls)
------------sp-(nth-1-ls)
------)
------(if-(null-et)
---------(setq-ct-nil)
---------(progn
------------(delpl)
------------(drwpl-et-sp)
---------)
------)
---)
---(endpr)
)


(defun-start-(/-p1-p2-ss)
---(setvar-"cmdecho"-0)
---(setvar-"pickbox"-10)
---(graphscr)
---(command-"limits"-(list-0.0-0.0)
---------------------(list-120.0-120.0)
---)
---(command-"snap"-10)
---(command-"grid"-10)
---(command-"zoom"-"extents")
---(setq-p1-(getvar-"vsmin")
---------p2-(getvar-"vsmax")
---)
---(setq-ss-(ssget-"c"-p1-p2))
---(if-ss
------(command-"erase"-"all"-"")
---)
---(command-"zoom"-"all")
---(command-"zoom"-"0.8x")
)


(defun-drlns-()
---(command-"line"-(list-120-0)
-------------------(list-10-0)
-------------------(list-10-120)
-------------------(list-120-120)
-------------------""
---)
---(command-"line"-(list-10-60)
-------------------(list-120-60)
-------------------""
---)
)


(defun-fndet-(/-an-el-et-ls-p1-p2-pt-sl-sp-ss-tp)
---(setq-sl-(entsel-"\nSelect-line"-))
---(if-sl
------(progn
---------(setq-et-(car-sl)
---------------el-(entget-et)
---------------sp-(cadr-sl)
---------------sp-(osnap-sp-"nea")
---------------tp-(cdr-(assoc-0-el))
---------)
---------(setq-ls-nil)
---------(if-(=-tp-"LWPOLYLINE")
------------(progn
---------------(while-(setq-nr-(caar-el))
------------------(if-(=-nr-10)
---------------------(progn
------------------------(setq-pt-(cdar-el))
------------------------(if-ls
---------------------------(setq-ls-(append-
-------------------------------------(list-pt)
-------------------------------------ls
------------------------------------)
---------------------------)
---------------------------(setq-ls-(list-pt))
------------------------)
---------------------)
------------------)
------------------(setq-el-(cddr-el))
---------------)
---------------(setq-p1-(nth-1-ls)
---------------------p2-(nth-0-ls)
---------------------an-(angle-p1-p2)
---------------)
---------------(command-"erase"-et-"")
---------------(setq-ss-(ssget-"c"-(polar-p1-an-1)
-----------------------------------(polar-p2-(+-an-pi)
-----------------------------------1)
------------------------)
---------------)
---------------(setq-et-(ssname-ss-0))
------------)
---------)
------)
------(setq-et-nil
------------sp-nil
------)
---)
---(list-et-sp)
)


(defun-delpl-(/-et-el-tp)
---(setq-et-(entlast)
---------el-(entget-et)
---------tp-(cdr-(assoc-0-el))
---)
---(if-(=-tp-"LWPOLYLINE")
------(command-"erase"-(entlast)-"")
---)
)


(defun-drwpl-(et-sp-/-el-p1-p2-an-ss)
---(setq-el-(entget-et)
---------p1-(cdr-(assoc-10-el))
---------p2-(cdr-(assoc-11-el))
---------an-(angle-p1-p2)
---------ss-(ssget-"c"-(polar-p1-an-1)
-----------------------(polar-p2-(+-an-pi)-1)
------------)
---)
---(if-(=-(sslength-ss)-1)
------(command-"pline"-p1
-----------------------"w"
-----------------------2.5
-----------------------2.5
-----------------------p2
-----------------------""
------)
------(dplip-et-sp-ss)
---)
)


(defun-dplip-(et-sp-ss-/-e1-el-ip-p1-p2-p3-p4)
---(setq-el-(entget-et)
---------p1-(cdr-(assoc-10-el))
---------p2-(cdr-(assoc-11-el))
---)
---(setq-e1-(ssname-ss-0))
---(if-(equal-et-e1)
------(setq-e1-(ssname-ss-1))
---)
---(setq-el-(entget-e1)
---------p3-(cdr-(assoc-10-el))
---------p4-(cdr-(assoc-11-el))
---)
---(if-(or-(=-(angle-p1-p2)(angle-p1-p3))-
-----------(=-(angle-p1-p2)-(angle-p2-p3))
-------)
------(setq-ip-p3)
------(setq-ip-p4)
---)
---(if-(=-(+-(distance-p1-sp)
-------------(distance-sp-ip)
----------)
----------(distance-p1-ip)
-------)
------(command-"pline"-p1
-----------------------"w"
-----------------------2.5
-----------------------2.5
-----------------------ip
-----------------------""
------)
------(command-"pline"-p2
-----------------------"w"
-----------------------2.5
-----------------------2.5
-----------------------ip
-----------------------""
------)
---)---
)


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


(c:drwpl)


Next Posts


In the next posts I'm going to talk about all the functions of the AutoLISP program. I already have told what they are.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla



To Your Success


Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.



The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.

Friday, March 14, 2014

Drawing Polylines with AutoLISP 2

Drawing Polylines with AutoLISP 2


In my last post I told you that I'm going to talk about the AutoLISP program. That is what I'm going to do now.


But I want to do it in a different way than what you possibly are expecting. I will tell you what needs to be done by the program.


What Needs To Be Done


You know how the program works:


- At the start a screen with four line is drawn
- The user selects a line.
- After the selection of a line the polyline is erased, if it is in the drawing.
- A polyline is drawn over the line.
- Even if a polyline has been selected, a polyline is drawn over it.
- When no more line or polyline is selected, the AutoLISP program terminates.


Now you know what needs to be done by the AutoLISP program. And it is done by separate functions of the AutoLISP program.


The Functions


These are the functions that can be found in the AutoLISP program:


Function Action


START Setting the limits, erasing everything in the screen, setting the snap and grid, zooming out of the screen


DRLNS Drawing four lines


FNDET Finding line or polyline entity


DELPL Delete polyline


DRWPL Draw polyline, no intersection with other line


DPLIP Draw polyline, intersection with other line


ENDPR Ending of the program


Writing An AutoLISP Program


Knowing what must be done by the AutoLISP program, that is very important if you want to write an AutoLISP program.


It is figuring out what separate functions need to be written. And that makes programming in AutoLISP so easy.


Next Post


In my next post you will find the complete AutoLISP program. You can copy it to a text file and work with it in your CAD program.


When you work with it, you will see how the AutoLISP program works and you can test it by yourself.


In the posts that are coming after my next post I will be talking about the functions. I will explain how they work.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla



To Your Success


Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.



The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.

Tuesday, March 11, 2014

Discover How AutoLISP Deals With A Rectangle And Donuts 2

As promised in the previous post. This time there is talked about the functions of the AutoLISP program and why they are there.


What Needs To Be Done


You have seen the pictures that tell about what is done with the AutoLISP program. Let;s mention it to be very clear.


1. The AutoLISP program starts with an empty screen and snap and grid are set. There is also zoomed so that the whole screen is displayed.
2. The two points of the rectangle are entered. The lower left point and the upper right point are entered.
3. The rectangle is drawn.
4. The four corner points of the rectangle are found.
5. The four corner points are used to draw the donuts in the corner points of the rectangle.


The Functions


These are the functions that do what needs to be done:


1. START
2. Main Function
3. Main Function
4. FNDLS
5. DRDNS
6. ENDPR


The START function sets snap and grid and it also erases everything that is in the screen. The empty drawing is zoomed.


Picking the two points of the rectangle and drawing the rectangle could have been done in a separate function. But that is not done.


The two points are picked in the main function.


The points of the rectangle are found with the FNDLS function. The points are put into a list of points.


The DRDNS function is used to draw the donuts in the corners of the rectangle. The list from the previous function is given to the function.


The AutoLISP program ends with the ENDPR fucntion.


Talking About The Functions


The START Function And The ENDPR Function


Previously there has been talked about those two functions. No need to talk about them again. They are supposed to be clear.


The Main Function


Here it is:


(defun c:drdns (/ p1 p2 ls)
(start)
(setq p1 (getpoint "\nBasepoint: ")
p2 (getcorner p1 "\nUpper point: ")
)
(command "rectang" p1 p2)
(setq ls (fndls))
(drdns ls)
(endpr)
)


In the main program there is asked to pick the base point of the rectangle. The GETPOINT function is used for picking the base point.


For picking the upper point the GETCORNER function is used. The base point is used as a reference point in that function.


By using the GETCORNER function a rectangle is drawn in the screen. You will see what you are getting after picking the two points.


The FNDLS Function


Here is the function:


(defun fndls (/ et el ls ct pl)
(setq et (entlast)
el (entget et)
ct 0
)
(while (setq pl (nth ct el))
(if (= (car pl) 10)
(progn
(setq pt (cdr pl))
(if ls
(setq ls (append (list pt) ls))
(setq ls (list pt))
)
)
)
(setq ct (1+ ct))
)
ls
)


Before talking about finding the points and putting them in a list, I must tell you something about the rectangle.


The rectangle is a polyline. And the corner points of a polyline can be found in the entity list of the polyline.


The entity list consists of part lists. The corner point is found in the part list that starts with the number 10.


This is how the part list of the entity list may look:


(10 39.3750 30.0000 0.000000)


The FNDLS function finds the entity of the rectangle. It is the last entity of the drawing. And then the entity list is found.


The CT variable is set to zero. With a WHILE loop there is walked through the entity list. The NTH function is used to find a part list.


The number in the part list is found with the CAR function. Take the part list from before. The number is 10.


Now comes the trick. If the number is 10, then a point has to be found. We want to put the point into a list.


To find the point the CDR function is used with the part list. The point in the part list from before is:


(39.3750 30.0000 0.000000)


That is important. If there is no list, then a list is created with the point that has been found. That is done with the LIST function.


If there is a list, then the point is added to the list. It is done using the APPEND function. See the line with the APPEND function.


The value of the CT variable is increased with one all the time. This goes on until no more part list is found. And the WHILE loop stops.


When the WHILE loop stops a list has been created with all the points of the rectangle. The list is given back to the main program.


The DRDNS Function


Here is the function. It is a very short function. The function only has seven programming lines.


(defun drdns (ls / ct)
(setq ct 0)
(while (setq pt (nth ct ls))
(command "donut" 0 2.5 pt "")
(setq ct (1+ ct))
)
)


The CT variable is introduced. It gets a value of zero. And then we have a WHILE loop again. It is used for finding the points.


The elements of the list are found using the NTH function. As long as a point is found, the WHILE loop continues.


As you know. There are only points in the list. A point is found. The DONUT command is sudeedf to drawe the donut at the point.


Next the value of the CT variable is increased with one. And the next point is found. And the next donut is drawn.


All The Functions


You have had an explanation of all the functions. Now you have discovered how AutoLISP deals with a rectangle and donuts.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla



To Your Success


Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.



The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.

Monday, March 10, 2014

Discover How AutoLISP Deals With A Rectangle And Donuts 1


Here is an AutoLISP program. The program is used for drawing a rectangle and next donuts are drawn in the corners of the rectangle.


The Pictures


This is how it looks. The proforma starts. There is asked to pick the two points of the rectangle. Next the rectangle is drawn.


This is how it looks after the rectangle has been drawn.




The program finds the rectangle. And then it finds the corner points of the rectangle. And the donuts are drawn in the corner points.


Here is how the rectangle looks with the donuts in the corner points.




That was easy. The only thing the user had to do was picking two points. The AutoLISP program drew the donuts right away.


The AutoLISP Program


I know. You want to see the AutoLISP program. Very good. Here is the AutoLISP program. And I will tell you about all the functions.


(defun c:drdns (/ p1 p2 ls)
(start)
(setq p1 (getpoint "\nBasepoint: ")
p2 (getcorner p1 "\nUpper point: ")
)
(command "rectang" p1 p2)
(setq ls (fndls))
(drdns ls)
(endpr)
)


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


(defun fndls (/ et el ls ct pl)
(setq et (entlast)
el (entget et)
ls nil
ct 0
)
(while (setq pl (nth ct el))
(if (= (car pl) 10)
(progn
(setq pt (cdr pl))
(if ls
(setq ls (append (list pt) ls))
(setq ls (list pt))
)
)
)
(setq ct (1+ ct))
)
ls
)


(defun drdns (ls / ct)
(setq ct 0)
(while (setq pt (nth ct ls))
(command "donut" 0 2.5 pt "")
(setq ct (1+ ct))
)
)


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


(c:drdns)


The Next Post


In the next post I will tell you about all the functions that the AutoLISP program is having and why these functions are there.


There is also talked about the function. There is said how they work. But that comes in a post after the next post.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla



To Your Success


Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.


The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.








Sunday, March 9, 2014

The Border Application


You or your people are working with AutoCAD. All the time drawing are created. And each drawing has got a border and drawing head.


Creating the border and the drawing head takes a lot of time. What are the sizes of the border and the drawing head?


And what is going to be written in the drawing head? The name of the drawing, the scale, the draftsman, the date?


I have created an AutoLISP application, that will draw the border and the drawing head for you. Once the drawing has been created.


The AutoLISP application works with a dialog box. And the dialog box needs to be filled in. That takes time.


But it doesn't take as much time as drawing the border and the drawing head. With the AutoLISP application the job is done within one minute.


Don't you think you would be saving a lot of time of you are working with the AutoLISP application? You will save hours of work.


Here is how the AutoLISP application works. The one that I have written. At the start this drawing is created.


The drwazing represents the three views of an AutoCAD drawign. There is the front view, the side view, and the top view.






Next a dialog boil shows up. In the dialog box you can select what drawing size you want:


- A4
- A3
- A2
- A1


Here is the dialog box. The box for selecting the drawing size is expanded. After the selection you can click on the OK button.




You cannot select A0 for the size of the drawing. I understand that that size is no longer used for technical drawings.


After clicking on the OK button, the border is drawn and also the drawign head. This is how an A4 drawing looks.




Do you see? The size of the drawing can be found in the drawing head and also the scale of the drawing.


Are you interested in this AutoLISP application? Would you like to have it and save a lot of time when creating AutoCAD drawings?


I can write the AutoLISP application for you. If I do, I will charge you only RM 500. Tha tis less than $ 165.


But I have some questions. What paper size are you using? Is it always the same size? If so then there is no need to ask for a size.


I would also like to have the logo that you are working with. I guess you have it in a JPG file. Or I could create such a file for you.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla

To Your Success

Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.


The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.




Saturday, March 8, 2014

An AutoCAD Operator

I was at Putra World Trade Center in Kuala Lumpur. There I met the director of an engineering firm. I told him about the border application.


He was interested in the border application. He wanted to have it. He saw that with it his AutoCAD operator would save a lot of time.


Two Days Later


We met again three days later. I wanted to show him the border application and I had some questions. But he could not take it.


He explained to me what was the problem was. He had talked the border application over with his AutoCAD operator. And he didn't want it.


I understood why the AutoCAD operator did not want the border application. He was afraid that when it was used, he would loose his job.


My Suggestion


I suggested my customer that he should talk to his AutoCAD operator. He should tell him that he is expecting that more AutoCAD work would come.


He should also tell his AutoCAD operator that he was thinking of engaging another AutoCAD operator. The border application made him change his mind.


Talking To His AutoCAD Operator


My customer talked to his AutoCAD operator. He told him about his plan to engage an extra AutoCAD operator and more AutoCAD work.


I asked my customer if he was thinking of getting rid of his AutoCAD operator. I said to him that I could not imagine he would.


My customer had told him that he would keep his job. Why not? My customer needed him to do all the AutoCAD work.


The Objections Were Gone


The AutoCAD operator got the feeling that he was not going to loose his job. His objections against the border application? They were gone.


The AutoCAD operator promised that he would use the border application if he knew how it worked. That was very good.


Saving A Lot Of Time


A few days later I delivered the border application to the director. His AutoCAD operator is saving a lot of time now.


I sold the border application to the director for RM 600.-. That is far less than what he would have to pay for an extra AutoCAD operator.


Something Completely Different


Here is something completely different from what you normally read in this blog. It is an imagination.


Imagine this. One day you wake up and you are a millionaire! Look at how different your life will be:


- You no longer have to worry about your debts, bills, and slaving for money.


- You can spend your time doing things you love, spend your time with your beloved family and friends.


- You no longer have to worry about money or have to be poor again. Never again living the life you used to have.


Do you want to be a millionaire? Make your dream lifestyle came true. Here's your chance to be a millionaire. Check this out.


Wake Up Millionaire:
http://l1nk.com/rfbzla



To Your Success


Free AutoLISP Course


Sorry. This offer is only for my readers from Malaysia. I want to give an AutoLISP course to them. Free of charge.


I have more than 900 readers. The majority of them is from the USA. More than 500. But I also have readers from Malaysia. About 120.


I don't know what my readers from Malaysia are doing. Are they with an engineering firm or architecture? Or just interested in AutoLISP?


I offer them a free AutoLISP course. It works like this. You let me know if interested and I'll come to your place.


I will give the AutoLISP course at your office. Your people can attend the AutoLISP course. The course consist of 15 lessons.


The first ten lessons are about AutoLISP. All the functions of AutoLISP are explained and there is talked about the system variables.


During the last five lessons we are going to write an AutoLISP program. The people attending the course come with a wish.


That is why this offer is only for my readers from Malaysia. I live in Malaysia. And I do not see how I could travel abroad.


The AutoLISP course is completely free. I will not charge you for the course. But I will ask you to refund my travel expenses.


The people attending the course will get an e-book about AutoLISP. The e-book is a PDF file. What is said in the course, can be found in the book.