I have an Xref which has hundreds of layers, referenced into many of my drawings (not my Xref). Many of these layers I want to freeze/not show in my drawings. I know what each and every one of these layers is called and I'm looking for a lisp where I can copy/paste this list of layers into the body of the code and after loading the lisp, I want to be able to type in "FREEZER" and have all the layers in the code instantly turned off.
.... I know what each and every one of these layers is called and I'm looking for a lisp where I can copy/paste this list of layers into the body of the code and after loading the lisp, I want to be able to type in "FREEZER" and have all the layers in the code instantly turned off.
I prefer to use the -LAYER command. everything in quotes is just as if you were entering that data in the command line, so it's really easy to modify. Just don't forget the a double quote is considered a return.
Hello, I have the same problem that you had described, I just haven't been able to implement it in my drawings. I have a list of multiple layers in an Xref, say that the Xref name is "T-P-PROFILE.dwg" and the layers that I want to freeze in there are named "C-TRACK-CURVE L1" and "C-TRACK-CURVE L2" among many others.. now, I have a list of these in an Excel spreadsheet.. how do I implement your 'solution' with my problem? I'm not familiar with lisp by the way..
- and ultimately, I will need to add this lisp to multiple files which are all different plotsheets, like file1.dwg, file2.dwg, file3.dwg and my thinking is: "ok i need to open each one of these and import the lisp one by one when i want to use it and freeze the layers"... question is, is there a better way to expedite this and not have to open the files one by one and run the lisp one by one?
Here is an example of what I do with my layers. We use about 10 of these for basic sheets. I'm in civil and we have a lot of layers and use color plot styles. This one changes the colors on our "Proposed site plan" to grey back existing, freeze demo, and bold proposed.
... I will need to add this lisp to multiple files ...: "ok i need to open each one of these and import the lisp one by one ...." ... is there a better way to expedite this and not have to open the files one by one and run the lisp one by one? ....
There are many threads about running code on multiple drawing files. I think they nearly all do involve opening each, but it can be automated -- Search for references to SCRIPTPRO, which is a program that can do that.
hello, im been studying the list routine above that is very simular to what Im looking to accompolish but the routine it does not work. Im looking for it to set layers to 0, freeze the layers listed, and zoom extent.
When you appload a lisp it asks you if you always want to load it or just once. I usually only load always if it's something I constantly use that and I like to make sure a lisp works without problems before I do that too. I have a lisp that I was only loading once, but now I want to load it always. I don't get the dialog box that asks any more however. How to I get it to load always or get the dialog that asks back to pick that option?
I know there is a way to make autocad re-ask you all the questions that you checked the box for don't ask this again. I can not for the life of me find where that is or find my bookmark that talks about that. I know I have done it before when I was fixing my geo maps issue.
I thought those were it, but I can't get them to make a difference. On some lisps I get the dialog box in the image below. However I do not get this dialog for the lisp that I want to always load now.
That's not asking whether you want it always loaded whenever AutoCAD is started or a drawing is opened. It's asking whether you always want to accept loading of it when you explicitly go after it with something like APPLOAD, without being asked for a confirmation, despite its being from a non-verified source in a non-trusted location. But you still need to ask for it to be loaded every time -- it just won't ask for the OK to load it once you've picked that option for it.
The one you "want to always load now" is probably either in a trusted location, or you've previously picked the Always Load option for it, either of which would explain why it doesn't ask that any more.
If you want something loaded every time you start AutoCAD or open a drawing, you can have an acaddoc.lsp file always load it, with a (load) or (autoload) function, or as already mentioned you can put it in the Startup Suite. Or if it's in plain AutoLisp code [i.e. not some compiled format that you can't get into], you can include that code directly within acaddoc.lsp itself.
I have secureload set to 0, but all the other lisp routines that I call from the acaddoc file load fine. It's only the ones like the one I attached that won't load. I tried changing secureload to 1 but the routines still don't load. Also, the ApplicationPlugins folder is supposed to be a Trusted Folder, so I shouldn't have to set permissions for it.
I have also tried using the startup suite, but these particular routines won't load automatically. I can only load them manually. I'm not really sure what the problem is, they worked fine in 2014 which is supposedly when all this secureload stuff started.
I have my own lisp folder , c:/temp/lisp and put it on top in my support path and also have my own acad.lsp which load a few routines in the startup. Most routines are loaded though on demand from one of my toolbars in the old way (if (not (c:mylisp))(load "mylisp"))... etc. This way I have the least problems when autocad is re-installed or other stuff IT hits me with.
Thanks Tharwat but that didn't help. The file path wasn't there, so I added it, but the routines still don't load. Other routines, saved to the same location, load fine. It's just a couple that won't load. They only work if I load them manually.
I can't see anything wrong with the routine a first glance. Maybe commands are evaluated upon load? Try command-s instead of just command? Are other routines still loading from this location and is it just this one? Try ".zoom". Put (princ "\nzoom lisp loaded") as last line. Maybe it is loaded but commands are redefined later?
You may try to Repair the program from Control Panel -> uninstall -> Repair and this process would go back with your AutoCAD to the original installation which means you would need to readjust AutoCAD if you have your own customization like menu, toolbars ... etc other than the default one.
Tried it in 2017 and added (princ"\nzoomlisp loaded") as very last line and added file to startup suite and it works fine. You could try remove the second "" from c:ZR because that gave me
Command: ZR
Unknown command "ZR". Press F1 for help.
indecating it has one enter to many. Since autocad xx whatever some commands are evaluated a little different and that's when they gave us command-s. To be able to test commands before they are executed.
But so you have a couple of lisp files that are auto-loaded successfully. Remove your zoomlisp from any autoload and add just one of your little zoom defuns to one of those files and see what happens... if that works , add the next...
My $0.05 we have all our lisps on a server and at home in a directory it was just a case of adding the paths and importantly adding trusted paths and it all works for 2016 2018 2019. We do have the file called Autoload.lsp not sure if that makes any difference. On a brand new box just run a lisp that sets all support paths and trusted paths so does in one go. Just find it easier to seperate our and my stuff from Autocad paths. I have not had to add any Command-s to any routines.
Hi I am a new user to BricsCAD after years of experience with AutoCAD. I have a routine that places the bearing and distance on any line work you select. The routine works great in AutoCAD however for some reason does not run in BricsCAD? When I try to run it I get the following:
Don't do much Bearing/Distance, mostly electrical dwgs, but found this lisp routine VERY cool. And being a Lisp novice, just enough to be dangerous (very rarely understand the "why", but able to figure it out, sometimes), was able to figure out to put the following @ line 51 (before ext'g 51) that creates the 2 needed layers once the BD is started, not @ loading (which I first tried, not good, don't need it in every dwg opened). My colors are crazy just for visual, edit as needed, if needed.
Im looking to Export my board data in a specific format, that is accepted by autocad i will attach a picture of the currently used format, This may be a 3rd party integrations to make come true but its absolutely something that is needed. Looking for help on how to start an integration like this or what tools to use any help is greatly appreciated.
AutoLISP is a popular high-level language used for programming in CAD Packages such as AutoCAD, BricsCAD or ZWCAD. Using AutoLISP, you can create customised CAD commands to perform actions in order to generate the desired output.
LSP files or files with .LSP extension are the files written in LISP programming language. The LSP files contain source code for AutoLISP in the form of plain text program code which is executed with the help of an LSP interpreter. These files can be opened using any text editor. LSP files are used with Popular CAD programs such as AutoCAD, BricsCAD and ZWCAD.
59fb9ae87f