Forget DEFPOINTS and changing Layers and all -- if you have a new-enough version of AutoCAD [I don't know when this came in] use HIDEOBJECTS on them to make them disappear for Plotting. Then use UNISOLATEOBJECTS to bring them back.
Unfortunately, there doesn't seem to be a way of filtering for TrueColor values rather than ordinary color values in (ssget) to directly find only such objects. But you can find all "candidate" objects, and step through and put the ones with the right color into a selection set for hiding.
Both commands here include the setting up of the visibility of such objects and the calling up of a PLOT command. On the assumption that all the "labels" are either Text or Mtext objects, these seem to work in very limited testing:
(defun C:H25500P (/ textss H25500 n ent entTC); = Hide color-255,0,0 labels and Plot
(if (setq textss (ssget "_X" '((0 . "*TEXT"))))
(progn
(setq H25500 (ssadd)); initially empty
(repeat (setq n (sslength textss))
(setq
ent (ssname textss (setq n (1- n)))
entTC (vla-get-TrueColor (vlax-ename->vla-object ent))
); setq
(if
(and
(= (vla-get-Red entTC) 255)
(= (vla-get-Green entTC) 0)
(= (vla-get-Blue entTC) 0)
); and
(ssadd ent H25500); put it in the set
); if
); repeat
(if (> (sslength H25500) 0); found any
(command "_.hideobjects" H25500 ""); then
); if
(initdia)
(command "_.plot")
); progn
); if
); defun
(defun C:P25500 (); = Plot with color-255,0,0 labels on
(command "_.unisolateobjects")
(initdia)
(command "_.plot")
); defun
That second command assumes that if any of the labels are currently not visible, it is because they were hidden with HIDEOBJECTS, not because the Layer they're on is turned off or frozen. If they're already visible, it won't matter, unless you have used HIDEOBJECTS or ISOLATEOBJECTS on other things and want that status maintained -- if that's ever the case, these commands are not for you.
If the "labels" include other object types [Leaders? Boxes of some kind around things? Dimensions? etc.], add the possibilities to the (ssget) filter list entity-type entry.
Kent Cooper, AIA