Showing posts with label CAD. Show all posts
Showing posts with label CAD. Show all posts

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.

Thursday, March 13, 2014

Drawing Polylines with AutoLISP 1

I haven't been talking about AutoLISP lately. I don't know. Are you thinking I feel I have talked enough about AutoLISP?


If you were thinking in a negative way. Stop doing that. Now I'm going to talk about an AutoLISP program that I created.


I have created the AutoLISP program for a couple of my students. They wanted to learn programming in AutoLISP.


The Program




The program starts. Four lines are drawn. See the opening screen that shows up. See how the four lines look.


After the program has started. The opening screen is displayed in the screen. And there is asked to select a line.


A line is selected. And a polyline is drawn over the line. This is how it looks if a horizontal line has been selected.




But the vertical line could also have been selected. If that is done, then the polyline is drawn over the selected area.


See how looks. The polyline is not drawn over the whole line. It is only drawn over the area where the line was selected.




That is important. After a line has been selected, the previously drawn polyline is erased. So it is no longer there.


One more thing. The user is asked to select a line. But you know how users are. Do they do it on purpose? They may select a polyline.


Well. If they select a polyline, the AutoLISP program will not crash. The polyline will be erased and a new one is drawn.


Next Post


In my next post I'm going to talk about the AutoLISP program. I'm going to give you the whole listing and tell you what needs to be done.


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.








Wednesday, March 12, 2014

What AutoLISP Reveals

You are working with AutoCAD. Or maybe you are working with an alternative of AutoCAD such as IntelliCAD.


In the program you are creating technical drawings. The guess is that you are creating a lot of technical drawings with the program.


That Is How It Is


It takes a lot of time before your technical drawing is is created. And once it is created, you cannot use it right away.


The technical drawing needs to be checked first. And checking the technical drawing. That takes a lot of time too.


Wasting Time And Money


That is what AutoLISP reveals. You are wasting a lot of time and money. You could work with an AutoLISP program.


The AutoLISP program could be used to create parts of your technical drawing. It could even be used to create a complete drawing.


And that is how it is. Creating a complete technical drawing with an AutoLISP program is very fast. It is done in seconds.


If a complete technical drawing is created with an AutoLISP program. You don't have to wait for hours before the technical drawing is created.


And you don't have to check the technical drawing. In the AutoLISP program is laid down what standards are to be used.


OK. I said that a technical drawing is created in seconds with an AutoLISP program. Let's be honesty. It may take longer.


Suppose the AutoLISP program works with dialog boxes. Filling in the dialog boxes takes time. So it may be one minute.


Even if the AutoLISP program is creating parts of your technical drawing, you are saving a lot of time. You can imagine.


No AutoLISP Program


If you want to create a complete technical drawing with AutoLISP or parts of it, then you need an AutoLISP program.


But an AutoLISP program is not the only solution. You could also have a Visual Basic program or a program written in C++.


A Visual Basic program? Sure. Your program could be a Visual Basic program if you are working with an older version of AutoCAD.


Because nowadays AutoCAD is no longer supporting program that are written in Visual Basic. Now only AutoLISP and C++ programs are supported.


Disadvantage Of A C++ Program


A C++ program has got a big disadvantage. It is the price. The price of a C++ program is much higher than that of an AutoLISP program.


Can more be done with a C++ program than an AutoLISP program? No. You can do the same with AutoLISP and C++ programs.


Make AutoCAD Fast


If you are interested in getting an AutoLISP program, you could come to me. I can write an AutoLISP program for you.




If interested, give me a call. If you are from Malaysia. This is my telephone number:


012-9312742


From outside Malaysia you must dial:


+60129312742


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.




Friday, January 31, 2014

The Secret of IntelliCAD And Saving Money

You are most probably working with AutoCAD. I don't know what version you are using. Is it AutoCAD Light or the full version?


I already talked about AutoCAD Light. I told you. Taking AutoCAD Light is a big mistake. You are wasting money if you do.


The Full Version Of AutoCAD


But taking the full version of AutoCAD instead. I think that is wasting money too. How much is the full version of AutoCAD? $ 6,000.-?


You could take the IntelliCAD program. I'm working with the IntelliCAD program from 4M. There are three versions:


Program Use Price


1. 2D drawings
2. 2D/3D drawings
3. 2D/3D drawings


Much More Affordable


Do you see? The IntelliCAD program is much more affordable than the full version of AutoCAD. And all programs have AutoLISP support.


You can download a trail version of IntelliCAD and see how the program is. Go to this website to download a trail version:


http://www.4msa.com


Like AutoCAD


That is good about IntelliCAD. You will see it when you download a trail version of IntelliCAD. It looks like AutoCAD.


In AutoCAD you have toolbars, a drawing area, and a command window. In IntelliCAD you have the same. IntelliCAD is exactly the same.


There is a difference with AutoCAD. Only the full version of AutoCAD has got AutoLISP support. All versions of IntelliCAD have AutoLISP support.


Work With AutoLISP Appreciations


So if you are only creating 2D drawings and you want to work with AutoLISP appreciations, take the cheapest version of IntelliCAD.


Here is something else that is the same with AutoCAD and IntelliCAD. The drawing files are saved in the AutoCAD format.


In IntelliCAD you can select the file format that you want for your drawing. That file format can be
from AutoCAD 10 till AutoCAD 2013.


Creating AutoCAD Drawings


But that is the most important aspect of IntelliCAD. You are creating AutoCAD drawings in IntelliCAD.


You can open drawings that have been created in IntelliCAD in AutoCAD. And you can open AutoCAD drawings in IntelliCAD.


Go For IntelliCAD


I don't know about you? Do you have too much money? Or are you thinking about getting a CAD program? I would go for IntelliCAD.


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, January 26, 2014

How To Create Layers With AutoLISP

You know about layers. You can create them in AutoCAD or an alternative program for AutoCAD. And draw on them.


But you can also create them with AutoLISP. I know. You want to know how it is done. That is what you'll find in this post.


Kishore Gave Me An Idea


Talking about creating layers with AutoLISP. Kishore gave me that idea. I read about it on his blog. His blog is here:


http://autolisp-kishore.blogspot.com/


Kishore had an AutoLISP program for creating layers with AutoLISP. This is the program that he had.


Kishore's AutoLISP Program


(defun create_layer()
(command "layer" "n" "text"
"c" "blue" "text"
""
)
(command "layer" "n" "wall"
"c" "white" "wall"
""
)
(command "layer" "n" "line"
"c" "red" "dim"
""
)
(command "layer" "n" " title "
"c" "cyan" " title "
""
)
(command "layer" "n" "cir"
"c" "13" "cir"
""
)
(command "layer" "n" "hatch"
"c" "magenta" "hatch"
""
)
(command "layer" "n" "Beam"
"c" "green" "Beam"
""
)
(command "layer" "n" "crossb"
"c" "yellow" "crossb"
"lt" "hidden" "crossb"
""
)
)


With the AutoLISP program the following layers were created:


- TEXT
- WALL
- LINE
- TITLE
- CIR
- HATCH
- BEAM
- CROSSB


All the layers were given a color and of the last layer even the line type was changed.


Extra Information


I would like to give you a little bit extra information. Let's talk about the LAYER command first. This is the prompt:


? to list/New/Make/Set/Color/Ltype/LWeight/Print/ PStyle/ON/OFF/Freeze/Thaw/LOck/Unlock:


As you can see the LAYER command has got 15 options. You can invoke an option by entering the capitalized character at the prompt.


I'm not going to talk about all the options of the LAYER command. I do not want to write an AutoCAD course. But two options I will mention.


NEW Option And MAKE Option


I will mention the NEW option and the MAKE option. Both options can be used for creating a new layer with AutoLISP.


But these two options do not work the same. They work differently. Kishore has used the New option. I only use the MAKE option.


If you use the NEW option, then there is asked for the name of the new layer. Next you want to give the new layer a color.


You invoke the COLOR option. You enter the color that you want. Next there is asked what layer gets that color.


You gave the name of the new layer. But that name isn't shown. So you must enter the name of the new layer again.


OK. A new layer is created. But the new layer is not activated. If you want to draw on that layer, you must SET it first.


Do you see. In the AutoLISP program from Kishore the name of the new layer is given again after a color has been selected.


The MAKE Option


The MAKE option is different. Let me show you with a program of myself.


(defun nwlyr ()
(command "layer" "m" "025"
"c" "red" ""
""
)
(command "layer" "m" "035"
"c" "yellow" ""
""
)
(command "layer" "m" "050"
"c" "green" ""
""
)
)


Do you see? I have entered the color of the new layer. There is asked to what layer the color goes. Between brackets is the new layer.


So I do not have to enter the name of the layer again. I can give a return or click on the right mouse button.


New Layer Is Activated


There is another difference with NEW option of the LAYER command. The newly created layer is activated. You can draw on it right away.


I think that is a very important advantage. I create new layers with the MAKE option. I don't have to set the new layer.


OK. I gave you some additional information. I did not do that to suggest the Kishore didn't give good information.


The Blog Of Kishore


In fact. You can visit the blog of Kishore. He has got a lot more AutoLISP programs on his blog. This is the address:


http://autolisp-kishore.blogspot.com/