I'm looking for a way to replace in this code the need for "chprop" just to highlight what the user selected. Like when you use the move or erase commands (for example) how the objects stay highlighted until the end of the command. This one I would like to see the same when the single-picked text is selected, it stay highlighted. Thanks in advance for any help.
(defun RTT1 (/ ent enttxt ent2 SourceText DestinText)
(setq SourceText (entsel "\nSelect text to copy: "))
(setq sColor (assoc 62 (entget (car SourceText))))
(command "chprop" SourceText "" "c" "yellow" "")
(setq DestinText (entsel "\nSelect text to change: "))
(setq ent (entget (car SourceText))
enttxt (cdr (assoc 1 ent))
ent2 (entget (car DestinText))
ent2 (subst (cons 1 enttxt)(assoc 1 ent2) ent2)
);setq ent
(entmod ent2)
(command "chprop" SourceText "" "c" "bylayer" "")
(princ)
)
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Explore these methods.
1) (redraw en 3)
2) (sssetfirst nil ss)
3) (vlax-invoke-method obj 'Highlight :vlax-true)
The first option worked. Thank you tons.
(defun RTT0 (/ ent enttxt ent2 SourceText DestinText sssetfirst)
(setq SourceText (entsel "\nSelect text to copy: "))
(redraw (car SourceText) 3)
(setq DestinText (entsel "\nSelect text to change: "))
(setq ent (entget (car SourceText))
enttxt (cdr (assoc 1 ent))
ent2 (entget (car DestinText))
ent2 (subst (cons 1 enttxt)(assoc 1 ent2) ent2)
);setq ent
(entmod ent2)
(redraw (car SourceText) 4)
(princ)
)
(defun highlite_ss_on (ss / i)
;highlites object stored in selection set ss
(setq i -1)
(if (= (type ss) 'PICKSET)
(while (< (setq i (1+ i))(sslength ss))
(vla-highlight (vlax-ename->vla-object (ssname ss i)) :vlax-true)
)
)
(princ)
)
(defun highlite_ss_off (ss / i)
;removes highlited objects stores in selection set ss
(setq i -1)
(if (= (type ss) 'PICKSET)
(while (< (setq i (1+ i))(sslength ss))
(vla-highlight (vlax-ename->vla-object (ssname ss i)) :vlax-false)
)
)
(princ)
)
This will put highlite on objects in selection set variable ss. From this variable concepts can be created.
Miljenko Hatlak
Can't find what you're looking for? Ask the community or share your knowledge.