December 2009
Getting a list of polyline vertices using LISP
Submitted by rkmcswain on Wed, 12/30/2009 - 10:27Here is one way to generate a list of polyline vertices using lisp. This function requires one argument, a polyline entity. The polyline can be the old style POLYLINE entity (2D or 3D), or it can be an LWPOLYLINE entity.
(defun getcoords (ent) (vlax-safearray->list (vlax-variant-value (vlax-get-property (vlax-ename->vla-object ent) "Coordinates" ) ) ) ) Read more »Accessing Civil 3D objects with autolisp
Submitted by rkmcswain on Thu, 12/17/2009 - 13:42I have been working with the Civil 3D 2010 API in visual lisp recently, and I thought I would share an example of working with an alignment object. This example has plenty of comments, but basically it shows you how to find a point near the alignment based on a station and offset. Then it does the opposite and shows you how to determine the station and offset, given a point. For clarity, I have left out most of the error checking. Read more »
Entmake HATCH entity - Part 2
Submitted by rkmcswain on Tue, 12/15/2009 - 12:29Regarding yesterday's post....what I failed to cover with any detail was the fact that the example code posted in the CADTutor forum post was strictly for a closed area defined by four lines. Of course that isn't the only area you may need to hatch. Today, I needed to adapt this code to hatch an area defined by an ellipse. Read more »
Entmake HATCH entity
Submitted by rkmcswain on Mon, 12/14/2009 - 13:22After 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. Read more »
Massive PDF Files
Submitted by rkmcswain on Fri, 12/04/2009 - 07:21I see a lot of posts in the discussion groups where someone creates a PDF from a drawing and the PDF file size ends up being several times larger than the drawing itself.
OLE objects or images in the drawing. Both can cause the resulting PDF to be large. Remember that images are referenced into drawings and they are not included in the file size of the DWG file.
AUGI Board of Director Voting has started
Submitted by rkmcswain on Thu, 12/03/2009 - 13:32Time once again to vote in the AUGI Board of Directors election of 2009.
Please make note of the following items.
- There are 8 positions to be filled
- There are 9 candidates on the ballot
- You may vote YES for (0) candidates, up to 8 candidates
- This election is being conducted using a "Ranked ballot" (as defined in the By-Laws), so the 8 candidates who receive the most votes will be put into office.
- Voting "NO" for a candidate has no effect whatsoever.
- Voting closes at 12:01am (CST), December 16th 2009.
Click here to vote now (Voting is over now...) Read more »
All content is copyright © CAD PANACEA 2005-2011 unless otherwise noted.
All content of CAD PANACEA is solely my own personal thoughts and opinions and do not those of any other entity or person.
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 day 13 hours ago
1 day 16 hours ago
2 days 17 hours ago
4 weeks 2 days ago
7 weeks 1 day ago
7 weeks 1 day ago
7 weeks 1 day ago
7 weeks 1 day ago
12 weeks 22 hours ago
12 weeks 2 days ago