Author Topic: Continuous selection entity inside block, then select the entity change color  (Read 1355 times)

0 Members and 1 Guest are viewing this topic.

well20152016

  • Newt
  • Posts: 130
Continuous selection  entity inside block,  then select the entity change color

Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt (/ lst ss)
  2. (setq ss (ssadd))
  3. (while (setq Ent (nentsel "\nPick an  entity inside the block: "))
  4.        (setq lst (cons ent lst) ss (ssadd (car ent) ss))
  5.        (sssetfirst nil ss)
  6.   )
  7. (foreach a lst
  8.   (vla-put-Color (vlax-ename->vla-object (car a)) 6)
  9.   )
  10. )


EDIT (John): Added code tags for better display.
« Last Edit: September 25, 2017, 09:35:55 AM by John Kaul (Se7en) »

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Is there a question here?

well20152016

  • Newt
  • Posts: 130
My lisp, I don't know what's wrong!

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
AFAIK, you can't highlight nested entities... You could though try changing color and transparency...
Something like this :

Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt ( / adoc ent lst )
  2.  
  3.  
  4.   (while (setq ent (car (nentsel "\nPick an entity inside the block: ")))
  5.     (setq lst (cons (list ent (vla-get-entitytransparency (vlax-ename->vla-object ent))) lst))
  6.     (foreach a lst
  7.       (vla-put-color (vlax-ename->vla-object (car a)) 1)
  8.       (vla-put-entitytransparency (vlax-ename->vla-object (car a)) 75)
  9.     )
  10.     (vla-regen adoc :vlax-true)
  11.   )
  12.   (foreach a lst
  13.     (vla-put-color (vlax-ename->vla-object (car a)) 6)
  14.     (vla-put-entitytransparency (vlax-ename->vla-object (car a)) (cadr a))
  15.   )
  16.   (vla-regen adoc :vlax-true)
  17.   (princ)
  18. )
  19.  

Cheers...
 :thinking:
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

well20152016

  • Newt
  • Posts: 130
Thank you, ribarm, Lee, Mac!
I wonder if it can be implemented with ssget?

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
I wonder if it can be implemented with ssget?

I recall that Tim tried this a long time ago - see here.