LSP/LISP routine that will turn on or off layers in multiple drawings

vsmith9HYC2
Participant
Participant

LSP/LISP routine that will turn on or off layers in multiple drawings

vsmith9HYC2
Participant
Participant

I love LSP routines. The BFIND is my most used LSP and has saved me hours of drawing edits on each job.

Now I just need to find one that can turn on or off a specified layer in all the drawings in a folder.

I found a couple in searches but 2 of them don't have the lsp file I need. One has a great LSP file but it only works in an open drawing. I'm looking for one that will make the change to all drawings in the same folder.

Any help is appreciated. Thanks!

Ciao y'all!

0 Likes
Reply
2,481 Views
28 Replies
Replies (28)

pbejse
Mentor
Mentor

@vsmith9HYC2 wrote:

I'm looking for one that will make the change to all drawings in the same folder.

 


Same author of BFIND presents

 

;; Title: Batch freeze/thaw
;; Purpose: To freeze or thaw layers in multible drawing files
;; Written: Lee Mac
;; Creation: 12-19-2018
;; Revisions:

 

Refer to attach lisp file

 

0 Likes

vsmith9HYC2
Participant
Participant

I don't see anything attached.

0 Likes

pbejse
Mentor
Mentor

Its right there at post # 2

 

pbejse_0-1624638889759.png

 

0 Likes

vsmith9HYC2
Participant
Participant

I must have had some issue with my computer not showing attachments on Friday. I can see it today. Thanks!

0 Likes

pbejse
Mentor
Mentor

@vsmith9HYC2 wrote:

I must have had some issue with my computer not showing attachments on Friday. I can see it today. Thanks!


Good to know, please let us kmow how it goes. 

 

0 Likes

vsmith9HYC2
Participant
Participant

It wasn't quite what I needed. That froze the layers in all the drawings in the folder, which is still handy in cases. But I want to be able to turn one layer on and one layer off in all the drawings. My drawings are originally made for the shop to install; larger text, part numbers on the layout instead of a Bill of Materials to have to cross reference, easy for for the techs to read. But when the project is done, I will need to make them "customer friendly", Bill of Materials with item bubbles back on the layouts, etc. I have all the shop text on its own layer and the customer text on its own layer. I found a great LISP that will turn do this change in one command but it only works in that drawing. 

0 Likes

pbejse
Mentor
Mentor

Converting that great lisp to work on multiple files would be easy, go ahead and post it here.

 

0 Likes

vsmith9HYC2
Participant
Participant

Thank you so much! I can do minor adjustments to some LSP for what I need but doing that was way beyond what I could figure out.

0 Likes

JamesMaeding
Advisor
Advisor

@vsmith9HYC2 

That thing of batch modifying layer props, is in my free tools.

Free Tools 

Check out the help PDF, and look at the "Layer Modify" mode in lower left of dialog.

The slick thing is the Batcher tool does things without "opening" the drawing in the editor.

We call that "dbx doc" style, which takes seconds a file instead of full open which is 20 sec or more.

 

That batcher does other things too, like clean app ids, purge, translate layer colors....read the help a bit.

thanks


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes

pbejse
Mentor
Mentor

@vsmith9HYC2 wrote:

Thank you so much! I can do minor adjustments to some LSP for what I need but doing that was way beyond what I could figure out.


Are you saying the  program will only be targetting this two layers?

Do you still want an option to select or typed in a layer name?

 

 

0 Likes

pbejse
Mentor
Mentor

Command: laycustM

and

Command: layshopM

 

HTH

 

 

 

 

0 Likes

vsmith9HYC2
Participant
Participant

Just those two. I just want to be able to either have the Layer for Shop on all the drawings or Layer for Customer on all the drawings.

0 Likes

vsmith9HYC2
Participant
Participant

"Do you still want an option to select or typed in a layer name?" - either works for me.

0 Likes

vsmith9HYC2
Participant
Participant

I like this idea of the file batcher. The PDF shows all it can do and I can use quite a bit of that. But I don't see an installation instruction PDF. I loaded the .lsp file but I still can't get it to work. When I type "PID" Autocad is trying to get me to install Print Studio.

Thanks!

0 Likes

JamesMaeding
Advisor
Advisor

@vsmith9HYC2 

The install is this, from the instructions in that zip:

1) Unzip to somewhere on local drive. Be sure to preserve folder structure, not dump all files in one folder.

2) *** Important *** you must unblock the dll with name like "..\AcadXtra\AcadXtra.22.dll", the one ending in "Xtra.".
To unblock, right click on it in explorer and pick properties. Look for an unblock button. Pick it.
You will do that for 1 file, as mentioned, ending in "Xtra."

3) Using OPTIONS in Autocad or Bricscad, add a support path (in any order) to the folder for that version, like "c:\tools\HAToolsFree Acad 2019".
4) Load the start lisp, such as "HAToolsFree Start 2015-2017.lsp" using appload, startup suite, dragging into drawing area from explorer,
or adding to the automatic startup lisp like acaddoc.lsp.
5) With Autocad, if things will not load, try changing Secureload to 0, or adding the folder to trusted locations in options.

 

Did you do these things?

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes

vsmith9HYC2
Participant
Participant

This is the only part I'm having trouble with:

2) *** Important *** you must unblock the dll with name like "..\AcadXtra\AcadXtra.22.dll", the one ending in "Xtra.".
To unblock, right click on it in explorer and pick properties. Look for an unblock button. Pick it.
You will do that for 1 file, as mentioned, ending in "Xtra."

 

I've right clicked on the AcadXtra.23.dll file but I can't find any "Unblock" button.

0 Likes

JamesMaeding
Advisor
Advisor

@vsmith9HYC2 

Ok, so the idea is we want to make sure that dll can load.

In acad, type NETLOAD, then pick the file.

If it loads, the dll blocking is not the issue. If not, you get some sandbox whatever error as I recall. It is likely not blocked if you don't see the button. It only shows if blocked by windows.

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes

nrussell4CW5T
Contributor
Contributor

So this is great and I love using it, but when I thaw a layer, it thaws the layer, but i dont see it in my drawing. If i go to print preview i can see that the layer is on which is what i want, but i cant physically see the layer on until i do like control z, or close and reopen. It's not a big deal because i know that its on, but it would be helpful to see it. 

0 Likes

Kent1Cooper
Consultant
Consultant

@nrussell4CW5T wrote:

.... when I thaw a layer, it thaws the layer, but i dont see it in my drawing. .... 


REGEN.  If a Layer is frozen when you open the drawing, its contents are not generated, so when you thaw it, you need to REGENerate to see them.  [If, during an editing session, you freeze a Layer and later thaw it, the contents will typically become visible again, because they had been generated before the freezing.]

Kent Cooper, AIA
0 Likes