Been trying to figure this out for a few hours but can't quite seem to get it. As my LISP is going through all the selected coco points, it will stop at points that have a certain description. Once it's found that point, I need to get the X&Y coordinates for the next 2 point numbers.
So for instance, it will go through the points until it finds a point description matching "DEC" and that point is 1400. Now it needs to find the X&Y properties of points 1401 and 1402.
I've commented out the spot I'm needing this in the code below:
(defun c:desc2 (/ ss x northng pnt eastng descr dist hndl eastng1 eastng2 northng1 northng2)
(vl-load-com)
(if (ssget ":S:E" '((0 . "AECC_COGO_POINT")))
(progn
(vlax-for x
(setq ss (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
(setq pnt (vlax-get x 'number)
eastng (vlax-get x 'easting)
northng (vlax-get x 'northing)
descr (vlax-get x 'rawdescription)
hndl (vlax-get x 'handle)
);END setq
(if
(= 0 (vl-string-search "DEC" descr))
(progn
(command "text" "c" (list eastng northng) 0.5 0 descr)
(command "_insert" "nf_shrub_decid" (list eastng northng) "" "" "")
(setq pnt1 (+ 1 pnt)
pnt2 (+ 2 pnt)
)
;; ***** This is where I need to find the next 2 sequential points
);END if TRUE
(progn
(if
(= 0 (vl-string-search "CNF" descr))
(progn
(command "text" "c" (list eastng northng) 0.5 0 descr)
(command "_insert" "nf_shrub_conifer" (list eastng northng) "" "" "")
);END if TRUE
);END if
);END if FALSE
);END if
);END vlax-for
);END progn
);END if
(princ)
)