Sunday, December 1, 2013

Hatching in AutoLISP

You find a lot of AutoLISP in my blogs. I wanted to know if there are more blogs about AutoLISP. On Google I did a search for “AutoLISP blog”.


A Lot Of AutoLISP Blogs


I can tell you. A lot of entries showed up. So there are a lot of AutoLISP blogs. I found the one from Kishore.


The blog is called “AutoLISP-Kishore”. Kishore is a man from India. He is doing more than AutoLISP. This is the address:


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


Article About Hatch


Kishore had an article about hatch. Here is the article he had.


--------------------------------------------------
How to give the hatch to the particular area by pick the point in AutoLISP or AutoCAD


Hi friends,


in this article I will explain about how to give the hatch to the particular area by pick the point in AutoLISP.


In previous article I explained about how to give the hatch to the rectangle in AutoLISP and how to give the hatch to the circle in AutoLISP.


First of all open the Visual Lisp Editor in AutoCAD:


- Click on Tools
- Click on AutoLISP
- Click on Visual LISP Editor.


After opening the Visual LISP Editor write the following code.


(defun c:pth()
(setq p1(getpoint "pick the point")
p2(list (+ (car p1) 10) (cadr p1))
p3(list (car p2) (+ (cadr p1) 10))
p4(list (car p1) (cadr p3))
p5(list (+ (car p1) 5) (+ (cadr p1) 5))
)
(command "line" p1 p2 p3 p4 p1 "")
(command "hatch" "net" 10 "45" "l" "")
(command "-hatch" p5 "")
)


In the above program I take four lines and draw lines and make those lines as rectangle.


We can’t give hatch to the explode rectangle using the code in the previous article how to give the hatch to the rectangle in AutoLISP and how to give the hatch to the circle in AutoLISP.


We have to use the pick point property. For this we have to use the above code.


Save the file as pth.LSP


Then write the below line in the AutoCAD Command
prompt.


Command: (load “pth”)
Command:pth


The output of the above program is as shown in the
below figure.


--------------------------------------------------


Remarks


I do not want to say that the article is bad or that the AutoLISP program is no good. But I want to make three remarks:


1. Kishore is working with AutoCAD. I guess he has the full version. And he writes his AutoLISP programs in the Visual LISP Editor.


I don't do that. I'm working with IntelliCAD and I write all my AutoLISP programs in TextPad. It is an almost free program.


2. AutoCAD commands are used in the AutoLISP program from Kishore. But he did not set the CMDECHO system variable to zero.


3. For adding a hatch to his drawing Kishore uses the HATCH command from AutoCAD. I always use the BHATCH command.


That is important. I do not want the dialog boxes from AutoCAD when I'm hatching though AutoLISP. So for the command I enter “-bhatch”.


I hope you enjoyed the article from Kishore. You can visit his blog. You can even subscribe to his blog. Through RSS.


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.
-------------------------------------------------






1 comment:

  1. UETech Engineering provides cheap civil CAD drafting and design works for our clients that range from civil, structural, electrical, mechanical, and utility sectors. Our professional team has 8 years of experience and in-depth knowledge of drafting services and is adept at delivering high quality solutions to the clients in Melbourne, Australia.

    ReplyDelete