MULTIPLE LAYERS TURNING OFF BY SELECTING MULTIPLE ELEMENTS BY CROSS WINDOW

MULTIPLE LAYERS TURNING OFF BY SELECTING MULTIPLE ELEMENTS BY CROSS WINDOW

Anonymous
Not applicable
1,353 Views
5 Replies
Message 1 of 6

MULTIPLE LAYERS TURNING OFF BY SELECTING MULTIPLE ELEMENTS BY CROSS WINDOW

Anonymous
Not applicable

Hi helpers,

 

I need a lisp for that can turn off multiple layers, by selecting multiple elements in different layers.

 

Thanks,

T.Brahmanandam.

0 Likes
Accepted solutions (4)
1,354 Views
5 Replies
Replies (5)
Message 2 of 6

dbhunia
Advisor
Advisor
Accepted solution

Check this.......

 

(defun C:DEBA ( / )
(setq selectionset (ssget))
(repeat (setq N (sslength selectionset))
(setq Data (ssname selectionset (setq N (- N 1))))
(setq EntityData (entget Data))
(setq Lay_Name (cdr (assoc 8 EntityData)))
(setq layobj (tblobjname "layer" Lay_Name))
(vla-put-LayerOn (vlax-ename->vla-object layobj) 0)
)
(princ)
)

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 3 of 6

Moshe-A
Mentor
Mentor
Accepted solution

@Anonymous hi,

 

have you tried LAYOFF command?

 

moshe

 

0 Likes
Message 4 of 6

dbhunia
Advisor
Advisor
Accepted solution

If you want to turn off the layers by window selection then go through the code.....

otherwise go through "Layoff" command by selection an object of each layers.....


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 5 of 6

Moshe-A
Mentor
Mentor
Accepted solution

@dbhunia

 

if user just press enter to (ssget) or by mistake, what would happened to your code?

are you sure you can use (vlax-ename->vla-object) without loading ActiveX?

 

moshe

 

 

Message 6 of 6

Anonymous
Not applicable

Thank you for smart and immediate reply Sir.

0 Likes