TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: hermanm on July 01, 2010, 04:31:49 PM

Title: g.c. 91 for LWPOLYLINEs
Post by: hermanm on July 01, 2010, 04:31:49 PM
Anyone know
1) what it does?
2)when it showed up (2010 or 2011 - it is not there in 2009)?

DXF reference for 2011 says it is a "vertex identifier," but it seems to be zero for the LWPOLys I have examined.

Code: [Select]
Select object: ((-1 . <Entity name: 7ed7a908>) (0 . "LWPOLYLINE") (330 .
<Entity name: 7ed78cf8>) (5 . "371") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "0") (100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0) (38 .
0.0) (39 . 0.0) (10 55.0509 38.3673) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0)
(10 69.5689 50.4564) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0
1.0))

what it *does* do is break any LISP code which assumes there are 3 g.c.s (40,41,42) between 10 codes.:(
Title: Re: g.c. 91 for LWPOLYLINEs
Post by: Keith™ on July 01, 2010, 04:55:52 PM
Anyone know
1) what it does?
2)when it showed up (2010 or 2011 - it is not there in 2009)?

DXF reference for 2011 says it is a "vertex identifier," but it seems to be zero for the LWPOLys I have examined.

Code: [Select]
Select object: ((-1 . <Entity name: 7ed7a908>) (0 . "LWPOLYLINE") (330 .
<Entity name: 7ed78cf8>) (5 . "371") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "0") (100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0) (38 .
0.0) (39 . 0.0) (10 55.0509 38.3673) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0)
(10 69.5689 50.4564) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0
1.0))

what it *does* do is break any LISP code which assumes there are 3 g.c.s (40,41,42) between 10 codes.:(

Yeah .. I know the feeling .. thats why several years ago I stopped relying upon the number of group codes ..

Code: [Select]
(setq vtx elist)
(repeat (cdr (assoc 90 elist))
 (setq vtx (member (assoc 10 (cdr vtx))(cdr vtx)))
 ;; ... do stuff here on codes 10,40,41& 42
)

It loops through the GC 10 and strips it before moving to the next
Title: Re: g.c. 91 for LWPOLYLINEs
Post by: hermanm on July 01, 2010, 06:01:34 PM
In this case I am using (ssnamex) to determine which segment of the pline is selected:

Code: [Select]
((equal etype "LWPOLYLINE")
        (progn
          (setq vhead (- (length aline) (length (member (assoc 10 aline) aline)))
                vpos  (nth 2 (car(ssnamex(ssget(cadr alist)))))
                p1    (if (assoc 91 aline);later versions have this
                        (cdr (nth (+ vhead (* 5 (- vpos 1))) aline));quick fix
                        (cdr (nth (+ vhead (* 4 (- vpos 1))) aline)))
                dtype "LWPOLYLINE."
          );setq

Complete program is attached, for anyone who wants it.