TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Mark on February 01, 2005, 07:44:00 AM
-
Here's a simple method for highlighting user selected entities.
(defun c:hle1 (/ ent ent_type lst_of_ents)
(while (setq ent (car (entsel "\nPick something <enter> to quit: ")))
;; highlight the selected entity
(redraw ent 3)
(setq ent_type (cdr (assoc 0 (entget ent))) ; extract entity type
lst_of_ents (cons ent lst_of_ents) ; create a list of entities selected
)
(princ (strcat "\nAdded " ent_type " to the list"))
); while
;; un-highlight the entities
(foreach item lst_of_ents (redraw item 4))
(princ)
)
-
Why not use
;convert object to vla object
(setq sor (vlax-ename->vla-object (car ent)))
;set highlight to true for the selected object
(vla-highlight sor "true")
and
(vla-highlight sor "false")
--ImaJayhawk
-
Here is another, not sure where i got the code.
(if ss
(progn
(setq num (sslength ss) i -1)
(while (< (setq i (1+ i)) num)
(setq vlaobj (vlax-ename->vla-object (ssname ss i)))
(vla-Highlight vlaobj :vlax-true)
(vla-update vlaobj)
)
)
)