Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading Sript through lisp, vplayer, and layout all in one

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
477 Views, 2 Replies

Loading Sript through lisp, vplayer, and layout all in one

I have a script that defines (or redefines) layers, their color, and linetype.

I am loading this script, then setting the layout to the default option, running vplayer to freeze all layers in all viewports, and then thawing just the "0" and VP layers in all viewports.

The error I am getting is that it is only freezing the layers that were in the original file, any new layers created are not frozen. If I run the GLA command a 2nd time it will freeze everything.

 

Any help on this please?

 

I attached the drawing file and the script (as .txt file) and here is the lisp:

(defun c:gla ()
(command "script" "GNClayers")
(command "layout" "s" "")
(command "vplayer" "f" "*" "a" "t" "0,vp" "a" "")
(princ)
)

2 REPLIES 2
Message 2 of 3
cad-pe
in reply to: Anonymous

I was able to get your LISP routine to work that uses the script, only after I made a new viewport. The viewports in the three (3) layout tabs are locked. Even though I unlock the viewports the LISP routine and script did not work. It was only when I made a new viewport that the LISP routine calling the script worked. Of course I renamed the GNClayers.txt file to GNClayers.scr so it could be found.

 

Unlock all your viewports, delete them, and make new viewports. It should work.

Message 3 of 3
Anonymous
in reply to: cad-pe

That was sort of what I was trying not to do. What I had sent was a sample file. Some of our drawings have many many layout tabs with a lot of viewports. I am just trying to run this script to add layers to a file that may have been purged or to change the colors to print correctly with my company's .ctb file.

 

I did figure it out though, instead of having it all in the lisp file, I added the layout and vplayer commands to the script file and now works perfectly.

 

Thanks for your help.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost