Originally Posted by
rickquin651723
Well, back in the day when I used Eagle Point, I could just do a crossing window and it would grab all the points within that window and ignore all the other geometry inside the window. I think it even told you how many nodes it found, which would be handy for this new drill I'm having to do. We have a new client with new needs!
"I had way too much to say back then."........That's funny, I don't care who y'are
Something like this?
This mimics the output for the "Points_List" report.
Code:
(vl-load-com)
(defun c:ListCogo (/ *error* acDoc ss data i)
(defun *error* (msg)
(if ss (vla-delete ss))
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)
(if (ssget "_:L" '((0 . "AECC_COGO_POINT")))
(progn
(vlax-for x (setq ss
(vla-get-activeselectionset
(setq acDoc (vla-get-activedocument
(vlax-get-acad-object)
)
)
)
)
(setq data (cons x data))
)
(setq i (length data))
(vl-sort
data
(function
(lambda (a b)
(< (vlax-get a 'number) (vlax-get b 'number))
)
)
)
(prompt
(strcat "\nTotal COGO Point"
(if (< 1 i)
"s: "
": "
)
(itoa i)
"\n "
)
)
(prompt "\nNumber\tNorthing \t\tEasting\t\tElevation \t Description \n")
(foreach x data
(prompt
(strcat
" \n"
(itoa (vlax-get x 'number))
" \t"
(rtos (vlax-get x 'northing))
" \t"
(rtos (vlax-get x 'easting))
" \t"
(rtos (vla-get-elevation x))
" \t"
(vla-get-description x)
)
)
)
(textscr)
)
)
(*error* nil)
)
** Adjust the formatting/padding as needed
[Edit] - revised to sort the points prior to output