Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Using LISP to get the x,y coordinate s of a pline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Is there anyway to use LISP to list the x,y coordinates of a pline?
Vonnie A.
Re: Using LISP to get the x,y coordinate s of a pline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Using LISP to get the x,y coordinate s of a pline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
vonniea wrote:Is there anyway to use LISP to list the x,y coordinates of a pline?
....
What format do you need them in? For a Lightweight Polyline, this will give you a simple list of the X & Y coordinates of the vertices, undivided into individual points [supply appropriate information in place of the green parts]:
(vlax-get (vlax-ename->vla-object PlineEntityName) 'Coordinates)
Or [again for a Lightweight Polyline] this will give you a list of two-coordinate lists [the same as above, but divided into a separate pair for each vertex], removing the 10's from the vertex entity data entries:
(mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) PlineEntityData))
Might you sometimes be working with "heavy" Polylines [2D or 3D]? Some adjustment would need to be made to get rid of the Z coordinates that the above functions would include for those.
Other adjustments would need to be made if you need them as comma-separated pairs, or written out to a file, or....
Re: Using LISP to get the x,y coordinate s of a pline
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Test out the attached for LWPolylines, by loading file with APPLOAD and then typing PLVERTEX. Application will list all x,y coordinates for vertices of polyline.
C3D 2012 SP1, Win XP Home
