Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

automatically setup not printable layers to not be shown in viewports.

leticia.campanelli
Advocate

automatically setup not printable layers to not be shown in viewports.

leticia.campanelli
Advocate
Advocate

Hi there,

 

I am wondering if there is an automatic way to setup the non printable layers to not be shown in the viewports.

I usually simply freeze them in the viewport, but for this specific project it is boing time consuming.

 

thanks

0 Me gusta
Responder
Soluciones aceptadas (1)
442 Vistas
5 Respuestas
Respuestas (5)

cadffm
Consultant
Consultant

Hi,

 

not ootb, but with few lines code and the native command VPLAYER, no problem:

(defun c:AllNoPlotLayers2VPFRZ (/ a b)
  (setq b "")
  (while (setq a (tblnext "LAYER" (not a)))
    (if (zerop(cdr(assoc 290 (entget (tblobjname "LAYER" (cdr(assoc 2 a)))))))
        (setq b (strcat (cdr(assoc 2 (entget (tblobjname "LAYER" (cdr(assoc 2 a))))))"," b))
    )
  )
  (command "_.VPLAYER" "_fr" b "_all" "")
  (princ)
)

Sebastian

leticia.campanelli
Advocate
Advocate

feeling stupid. :cara_con_lágrimas_de_alegría:

 

Thank you so much, but I have no idea how to use this code.

 

is it easy enough to explain it here?

 

0 Me gusta

cadffm
Consultant
Consultant
Solución aceptada

no problem.

 

For usual you have a .lsp (or /.fas./vlx) file with code inside, so you can drag&droop the file into your drawing or

load it by command APPLOAD (often you will see informations about loaded function names in commandline/Textscreen [F2]).

 

In the case here, you have the (Lisp)sourcecode only, so you have to create a .lsp file yourself:

Open EDITOR, copy&paste the code into, save as <Name of your choice, but often the part after "defun c:" is senseful :cara_guiñando_un_ojo: > incl. the file extension .LSP

In this case here:

 

Save it to your new AutoCAD Custom Tools folder wherever\Tools\AllNoPlotLayers2VPFRZ.lsp

Now, you can load this file by drag&drop into your drawing or by APPLOAD command.

Note: In APPLOAD dialog, you can set up Acad to load this file into every file by open that file.

Sebastian

0 Me gusta

leticia.campanelli
Advocate
Advocate

thank you!!!!

0 Me gusta