Author Topic: Isolate specific layers  (Read 2317 times)

0 Members and 1 Guest are viewing this topic.

antistar

  • Guest
Isolate specific layers
« on: March 22, 2013, 11:10:19 AM »
Hi to all,
I need a routine that isolates specific layers via LISP, even though these layers are frozen or off.
The names of layers are: E-MET, E-WOOD, E-PIPE and E-CONC.

Thanks in advance.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Isolate specific layers
« Reply #1 on: March 22, 2013, 11:32:39 AM »
LAYISO?

antistar

  • Guest
Re: Isolate specific layers
« Reply #2 on: March 22, 2013, 11:46:42 AM »
LAYISO?

Hi Lee,
The LAYISO command prompts you to select objects.
I would be isolated to specific layers automatically.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Isolate specific layers
« Reply #3 on: March 22, 2013, 11:55:50 AM »
Code: [Select]
(defun c:nameit (/)
  (vlax-map-collection
    (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
    (function (lambda (x)
(if (wcmatch (strcase (vla-get-name x)) "E-MET,E-WOOD,E-PIPE,E-CONC")
  (progn (vl-catch-all-apply 'vlax-put (list x 'freeze 0))
(vl-catch-all-apply 'vlax-put (list x 'layeron -1))
  )
  (progn (vl-catch-all-apply 'vlax-put (list x 'freeze -1))
(vl-catch-all-apply 'vlax-put (list x 'layeron 0))
  )
)
      )
    )
  )
  (princ)
)
« Last Edit: March 22, 2013, 12:56:55 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC


antistar

  • Guest
Re: Isolate specific layers
« Reply #5 on: March 22, 2013, 12:44:31 PM »
Code: [Select]
(defun c:nameit (/)
  (vlax-map-collection
    (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
    (function (lambda (x)
(if (wcmatch (strcase (vla-get-name x)) "E-MET,E-WOOD,E-PIPE,E-CONC")
  (progn (vl-catch-all-apply 'vlax-put (list x freeze 0))
(vl-catch-all-apply 'vlax-put (list x layeron -1))
  )
  (progn (vl-catch-all-apply 'vlax-put (list x freeze -1))
(vl-catch-all-apply 'vlax-put (list x layeron 0))
  )
)
      )
    )
  )
  (princ)
)

Hi ronjonp,
Thank you so much for your time and reply, but doesn't work to me.  :-(

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Isolate specific layers
« Reply #6 on: March 22, 2013, 12:57:47 PM »
I updated my post above missed 4 quotes  :oops:

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

antistar

  • Guest


antistar

  • Guest
Re: Isolate specific layers
« Reply #9 on: March 22, 2013, 01:33:01 PM »
I updated my post above missed 4 quotes  :oops:

Now runs perfectly.
Thank you very much.

Regards.  :-)