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

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

leticia.campanelli
Advocate Advocate
876 Views
5 Replies
Message 1 of 6

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 Likes
Accepted solutions (1)
877 Views
5 Replies
Replies (5)
Message 2 of 6

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

Message 3 of 6

leticia.campanelli
Advocate
Advocate

feeling stupid. 😂

 

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

 

is it easy enough to explain it here?

 

0 Likes
Message 4 of 6

cadffm
Consultant
Consultant
Accepted solution

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 😉 > 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 Likes
Message 6 of 6

leticia.campanelli
Advocate
Advocate

thank you!!!!

0 Likes