How to change entity visibility with Intelli-lisp

#1
I found this autolisp :

Code: Select all

;;(change visibility)
	(repeat (setq x (sslength ent))
		(setq obj (vlax-ename->vla-object (ssname ENT (setq x (- x 1) ))))
		(if  (= (vla-get-HasAttributes obj) :vlax-true)
		    (foreach att (vlax-invoke obj 'getattributes)
				(if (= tagname (strcase (vla-get-tagstring att)))
				  (progn           
					 (vla-put-invisible att :vlax-false)  
				  );;close progn
				);;close if
		    );;close foreach
		);;close if
	);;close repeat
but vla-get-HasAttributes don't exist with Icad !

I want obtain this property :
2025-07-02 21 30 29.png
2025-07-02 21 30 29.png (16.71 KiB) Viewed 6611 times

Re: How to change entity visibility with Intelli-lisp

#3
Ha yes with only HIDEOBJECTS in terminal it's ok. Thks Quan I searched for a long time with Visibility/Visible but I didn't find it...
In my script i do like that so:
(command HIDEOBJECTS ent "" "")

BUT
Command: HIDEOBJECTS
This command is not allowed while the Block editing session is active.
HIDEOBJECTS + ISOLATEOBJECTS don't work in Block Editor mode ! Hoops !
I want hide the Construct Line I created If I want to use with block editor I can't... like Acad.
in this video at > 13.57 : https://www.youtube.com/watch?v=OrF1tE3lvXE

I want use "Construct lines" and hide them and close my block so the block don't show these contruct lines !

Re: How to change entity visibility with Intelli-lisp

#4
Try this routine, Patrick.

Code: Select all

(defun c:invis (/ ent i ss) ; InVisible
  (if (setq i -1 ss (ssget ))
    (while (setq ent (ssname ss (setq i (1+ i))))
      (vla-put-visible (vlax-ename->vla-object ent) :vlax-false )    ))  
  (princ) )

(defun c:vis(/ ent i ss) ; Visible
  (if (setq i -1 ss (ssget "_A") )
    (while (setq ent (ssname ss (setq i (1+ i))))
      (vla-put-visible (vlax-ename->vla-object ent) :vlax-true ) ))
  (princ))

Re: How to change entity visibility with Intelli-lisp

#5
Yes Quand I will try it....At soon Thks for your nice help.

EDIT: Nickel/Chrome Quan! your prog work very good !
I added the two function in the same lisp file and added two buttons to hide/display objets
Here is the file now: https://1drv.ms/u/c/3e78343d1605325e/ET ... g?e=u6PUio
image_2025-07-03_122027053.png
image_2025-07-03_122027053.png (5.61 KiB) Viewed 6590 times
Blue is to create ConstructLine and eyes are to DisplayAll/Hide !
Very goog tools now because you Quan !