Entmake HATCH entity
After working on some autolisp code where I needed to create several HATCH entities, I figured that using (entmake) to do the job would be much faster than pushing the command line version of the HATCH command.
I didn't have my own example of this, and after checking out the DXF reference, it looked a bit more complicated than other entities, so I set out in search of some sample code that worked.... which led me to a post by "CarlB" over in the CADTutor forums that he had posted a few years ago. This worked great until I added in the scale factor and changed the pattern from SOLID to ANSI31. After a few iterations of trial and error, I managed to make it do what I wanted.
When using a real pattern (as opposed to SOLID), you have to specify a few more parameters. Head over to this thread in the CADTutor forums for the example code.
As it turns out, using (entmake) is about 10 times faster than using the (command) function in this case.
EDIT: I failed to mention that the example posted at the link above is for hatching a simple boundary defined by four lines. If you have arcs or other entities involved, the code will be a bit different.
All content is copyright © CAD Panacea 2008-2010 unless otherwise noted.
All content of CAD Panacea is solely my own personal thoughts and opinions and do not represent my employer or any others.
All comments posted to this blog are the sole responsibility of the person making the comment.
Google, as a third party vendor, uses cookies to serve ads on this site. Google's use of their cookies enables it to serve ads to users based on their visit to your sites and other sites on the Internet. You may opt out of the use of these cookies by visiting the Google ad and content network privacy policy.




Recent comments
1 week 1 day ago
2 weeks 20 hours ago
2 weeks 1 day ago
2 weeks 2 days ago
2 weeks 2 days ago
2 weeks 3 days ago
2 weeks 4 days ago
2 weeks 5 days ago
2 weeks 5 days ago
2 weeks 6 days ago