Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I finally got around to it. I used to use my old functions @cv_double_up and @cv_triple_up to turn flat lists as returned by (vlax-get plineobj 'coordinates) into a list of points.
But this is more compact and easier...
(defun @group (old n / item new) (while old (while (< (length item) n) (setq item (cons (car old) item) old (cdr old)) ) (setq new (cons (reverse item) new) item nil) ) (reverse new) )
which can be used as follows:
Command: (setq coords '(1 2 3 4 5 6 7 8 9) Command: (@group coords 3) ((1 2 3) (4 5 6) (7 8 9)) or Command: (setq coords '(1 2 3 4 5 6 7 8) Command: (@group coords 2) ((1 2)(3 4)(5 6)(7 8))
Remember that lightweight polylines return just x and y,
but heavies and 3Ds return x, y, and z.
I don't remember what other objects have a coordinates property.
John F. Uhden
Solved! Go to Solution.