AutoCAD Visual LISP / AutoLISP :: Turn Off All Frozen Layers
Feb 13, 2013
I have an old routine that freezes layers that are off. I would like it to also turn off layers that are frozen. It took a while but I think I figured out how the old routine works. I was having trouble determining how the routine would know if a layer was off or not. I found if the color was a negative number that meant the layer was off (cond ((< (dxf 62 l) 0) (command "f" (dxf 2 l)))). How do I tell if the layer is frozen?
I was also wondering what the character was after the DXF code ie. (dxf 62 l). Is is a lowercase L or an upper case i and what function does it have?
Below is the old routine that freezes layers that are off.
(defun c:fo (/ l dxf code list)
(defun dxf (code list)
(cdr (assoc code list))
);defun
(setq l (tblnext "layer" T))
[code].........
View 2 Replies
ADVERTISEMENT
Mar 6, 2013
Lisp file to thaw all layers frozen in the viewport,I’m wondering if there is a lisp file that can thaw all layers frozen in the viewport.
View 4 Replies
View Related
Mar 29, 2012
I have a Layer named "Arch - Niveau 1".I would like to enter in the command prompt "a1"..It would read if the layer is frozen or thawed and if it is frozen, it will thaw it?
And if the layer is thawed, it would freeze it..What could be added is: To check up if the layer exists and if not, create it.Would do the same for 2 other layer named "Arch - Niveau 2" command "a2" and "Arch - Niveau 3" command "a3". Is it clear?Now the lisp I've found and modified is this:
(defun c:a1 (/ lay ldef flag) (setq layn "Arch - Niveau 1") (command "_.LAYER") (if (not (tblsearch "LAYER" layn)) (command "_Make" layn) (progn (setq ldef (tblsearch "LAYER" layn) flag (cdr (assoc 70 ldef))) (and (= (logand flag 1) 1) (command "_Thaw" layn)) )) (command ""))
This lisp looks if it exists, if not, create it and only thaw the layer.
I'm not enough familiar with the "not", the "progn" the "flag", "and" and "logand" (!!!!)
View 9 Replies
View Related
Feb 19, 2013
We are using autocad 2010 and I have written a routine that will insert several blocks on to several layers. I thought it worked flawlessly, until I used it. Our drawings use layer states. When one state is in use, all the other layers are frozen. We want to insert a block, at a specific point chosen by the user, and the lisp routine will insert a couple of other blocks at that same point, but on a layer that is frozen. Three blocks installed in all, at the same point, on two layers. The routine works if all layers are thawed, but not if the layers are frozen.
(defun c:lP1 () ; this starts the routine
(setq temperr *error*) ; saves *error*
(setq *error* rerr) ; sets the new error variable
(command "_.Undo" "_mark") ; start of "undo" command
[code]....
View 8 Replies
View Related
Feb 23, 2012
Is there any way to programmatically turn off specific status toggles from the status bar? I would like to switch off all of our users' DUCS toggle so they can't accidentally turn it on. They all have independent CUI files.
It's easy enough to switch off UCSDETECT at drawing startup, this only goes part way. It's so easy to switch it back on via the status toggles - hence the need to switch it off programmatically at drawing start.
View 9 Replies
View Related
Oct 10, 2011
I have used Lisp and the insert command to do *blockname to explode the insertion of a block. This sets the explode check mark on the insert dialog. Once I set it on the next insert an explode occurs. I do not find away to turn it off.
Is there some trick to use that will uncheck the explode box. I don't seem to find any system variable. I thought of inserting a dummy block without the asterisk. I thought about trying to do a cancel somehow on insert.
View 9 Replies
View Related
May 17, 2013
When a text is selected, in properties palette the Annotative field can be turned on/off - how can i do it programatically?
activex doesn't not have a propertiy for it. i presume it is in xrecords but could not find it.
View 9 Replies
View Related
Dec 22, 2011
I would like to turn off the express tool visiblity in the menu bar. I have turned them off in the CUI. (in all workspaces, I have removed the aecmain.lsp witch i see loads into the toolbar, I have unloaded the partial cui and reloaded). If I set the workspace to one which it is turn off it goes away. Problem is that when I open again "its back". Is there another place that I don't know about that controls?
I "do" want to load the express tools. I don't want them to show in the menubar nor the ribbon. I want to allow command line or custom menu macro to call. I was able to do this in 2010.
View 2 Replies
View Related
Jan 18, 2013
I have a lips that creates a zero radius fillet.
(defun c:FZ () (setvar "FILLETRAD" 0)(command "_.fillet" "multiple"))
This works great.I would like to expand this by turning the line into a polyline..
View 3 Replies
View Related
Jul 19, 2011
I don't have this problem on all my files, only a select few. When i save a file and reopen, all the viewports in which I have frozen layers are all reset. All layers are turned back on and I have to go through every viewport and refreeze layers. This problem has persisted long enough that I unfortunately know when I close a file I will have to reorganize the layers next time I open the file. Is this a setting issue or this a bug in the file?
View 3 Replies
View Related
Jan 25, 2013
I know that for layers ON/OFF in current open dwg file, I should use:
[I just want to On/Off for my "STAMP" layer]
(COMMAND "LAYER" "ON" "STAMP" "")
(COMMAND "LAYER" "OFF" "STAMP" "")
but I have more than 150 dwg file and I should open all of dwgs one by one and setting ON/OFF for STAMP layer for every drawing and it takes so much time!
I just want to select files and LISP program set the STAMP layer to ON or OFF value.
View 5 Replies
View Related
May 31, 2012
I am running a simple script to color some layers in XRefs. I need to colour all layers in XRef files that don't have part of their name containing the characters NWP and I can do this with the line
-layer c 32 ~*|*NWP*
but then all the layers in the sheet file (not in Xrefs) also turn to 32 which I do not want. Is there some way to include an "except" statement in scripts.
View 3 Replies
View Related
Oct 23, 2013
I'm trying to set up an easy way to import layers from a certain dwt. file with a shortcut.
Now I found this code, which kind of works, but doesn't do the whole trick. It works with a Popup where I have to insert the dwt. file. It's also annoying that it opens this file than and I have to close it manually.
I would like to have this without any import options and automatically takes this one file always for the layers.
My file would be located here:
"I:AutoCAD BlöckeTemplate\__Bürostandard"
(defun c:IL (/ oAcad oCurDoc strFile oOpenDoc oOpenDocLayers lstObj oLayer array)
(setq oAcad (vlax-get-acad-object))
(setq oCurDoc (vla-get-ActiveDocument oAcad))
(setq strFile (getfiled "choose file:" (getvar "DWGPREFIX") "dwt" 0))
[code]........
View 4 Replies
View Related
Oct 1, 2012
How to edit this string so that it would change ONLY XREF layers in a dwg. to color 3 bylayer, and leave all of my additional layers in the current dwg. as is.
^C^Cchprop;(ssget"x");;color;bylayer;;-layer;color;3
View 2 Replies
View Related
Aug 23, 2011
What the require setting to enable me to lock of several layer continuously when i click the "LAYER OFF" button at the toolbar? I wish to set to be like whenever i use the "LAYER OFF" command, i can direct just continue to click several layers for it to be turn off.
View 9 Replies
View Related
Apr 24, 2013
If I have BLOCKA on a layer (or specifically layer 0), how do you copy blockA onto every layers? I'm sure there are 5 ways of doing this.
View 9 Replies
View Related
Dec 11, 2013
I want to make a list of layers due to their index (order) in the "layers combo box" in the AutoCAD. I prepared this:
(defun c:ListLayers ( / a b)(setq a(list(cdr(assoc 2(tblnext "layer" T)))))(while(setq b(tblnext "layer")) (setq a(append a(list(cdr(assoc 2 b))))));while);end
But, It's not match with the order of layers.
View 9 Replies
View Related
Apr 24, 2013
I have the following code that works, most of the time. Actually, it works or completes itself all the time, but there is no "all encompassing" measures incorporated.
All of the reference entities, believe it or not, are on layer "0". There are also some consistent layers, that you can see in the code below. However, a user may create or even remove any layer in the reference drawing. Therefore in my current drawing, I may have layers that are not frozen in the xref.
Like i said, the following code works, but not all encompassing.
(setq filename "7102-002-950 UC10-03")
(setq FreezePRD (strcat filename "|_PRD"))
(setq FreezeSLD (strcat filename "|_SLD"))
(setq FreezeBORDER (strcat filename "|0_BORDER"))
[Code] ........
I guess what I'm looking for is to freeze all layers that begin with "7102-002-950 UC10-03|".
View 5 Replies
View Related
Mar 6, 2013
Lisp file to plot all layers on,
I’m not sure if there is a lisp file that cans Plot All Layers ON at a time instead of going to the long story of the layer properties manager.
Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.
View 9 Replies
View Related
Dec 3, 2013
I found a lisp in an old post and I edited it alittle with my own layers to have it change to but when I use it, it doesn't deleted the extra layers. It says layer cannot be deleted. Below is part of the code that I am using, I didn't copy all of them since there are alot of layers in the lisp that I added. maybe I copied something wrong I am not sure.
{code}
( defun c:FIXMYLAYERS ( / ss_newlayer change_en )
( setq layerlist ( list ( cons "ENB_ROW-1" "ENB-ROW-1" )
( cons "Border_Condoc_DwgMgmt_Large$0$G-ANNO-TTLB" "DefPoints" )
( cons "Border_Condoc_DwgMgmt_Large$0$G-ANNO-TTLB-LOGO" "DefPoints" )
( cons "Border_Condoc_DwgMgmt_Large$0$G-ANNO-TTLB-NPLT" "DefPoints" )
[Code]...
View 9 Replies
View Related
Mar 12, 2012
Is there a way to import layers from a text file?
View 9 Replies
View Related
Jul 10, 2013
I've inherited management of CAD standards. A third party developed the tool palette - mostly blocks, etc. but there are also icons to add whole series of layers to drawings. Click 'Architectural Layers' you add the architectural layers. Click 'Plumbing Layers' you add the plumbing layers. Since the original implementation, things have been changed.
How do I update these tools?
View 5 Replies
View Related
Apr 5, 2013
I'm new to working with scripts and have played with it a little bit but my knowledge is severly lacking, I picked up script pro and have had some success batching simple commands.
What I have is a large database with differing layer convensions that I want be able to run a script that will open rename layers save and close, the layers are not of the same name but similar enough that I could set peramiters for less then a duzon layer names and catch my target then rename it to a standard, for example "A-wall exterior" to "A-WL-EXT", a simple enough command but within the database the "A-wall exterior" could be one of a duzon simmilar names.
My thought was to run the -rename la "layername" "layername" qsave script but when the original layer is not found it gets stuck untill script pro times out and fails. If there is some way to search out names and once found rename that would work.
View 9 Replies
View Related
Dec 27, 2013
Here is the lisp I am attempting to use:
(defun c:ada ()(setvar "cmdecho" 0)(command "-layer" "t" "*" "on" "*" "s" "0" "f" "*" "t" "*ex_*" "t" "*all_*" "t" "rev*all*" "t" "*prop_*" "f" "*geo_*" "f" "*util_*" "t" "*grd_*" "t" "rev*grd*" "f" "*z_*" "f" "alt*" "f" "*grd_elev*" "")(command "_vplayer" "f" "*grd_elev*" "c" "t" "*grd_ada_*" "c" "" "") (setvar "cmdecho" 1))
The purpose is to show the proposed grading plan at a smaller scale so that we can give detailed grading plans to meet City Regulations per ADA codes. I understand that this can be accomplished by blocks and attributes, but when you have hundreds of spot elevations that can become cumbersome and less customizable than mtext. The large scale drawings can not have all of the spots shown or it would be too cluttered. But I want to be able to see all of my elevations when I am working in model space to ensure that all of my leaders and spots move together.
View 9 Replies
View Related
Jun 20, 2012
I was able to write a LISP that replaced each node with a block of my choice.However, now I need to find a way now to replace the blocks with different blocks.Each point shares the exact same block called "PILE". Different blocks are on different layers and have 11 different colors. I'd like to replace blocks on layer 1 with a block called "1" and blocks on layer 2 with a block called "2" and so on.I was hoping there would be an easy way to do this in LISP, but I've been unable to get any of my scripts to work.
I've attached a link that visualize what my drawing is currently looking like: [URL] ......
View 2 Replies
View Related
Jan 22, 2013
I was wondering if it is possible to change the line weights of all layers in a drawing by factor? What I am trying to do is multiply all lineweights by 0.5 so that all lineweights are cut in half. I could just manually do this, but I have around 1000 layers in the drawing, so I'd rather not lol. However, I forsee a problem becuase layer lineweights cannot be assigned just any value, but instead they come from a predefined list. Which means that when a number is divided in half, that new number might now not be in the list.
So another option would be some way to remap all lineweights. This would work pretty well for me since I only have about 4-6 different lineweights throughout the drawing. So I could just say: All layers with lineweight = 0.024" go to 0.014", and all with 0.014" go to 0.006", and so on.
I am aware of how STBs, CTBs, and the "scale lineweights" option all work. But I am not looking to use those. I want the lineweights coming from the layers themselves.
I have used LISPs before, but unfortunatly I have never written one, so I am not familiar with the syntax.
View 9 Replies
View Related
Nov 10, 2011
I'm needing to merge a bunch of layers dozens of drawings.
original layers..
A-CL-E
A-CL-N
A-CL-X
new layer
A-CL
now i have to go through dozens of layers. that have that same format..
i.e. :
layername1-E
layername1-N
layername1-X
merge to layername1
ideally, a routine that says all layers named LAYER1* MERGE TO LAYER1
View 4 Replies
View Related
Jul 10, 2013
Im currently creating a custom menu to insert blocks on request. I have set up the following macro which seems to work fine:-
^c^c-insert;HVLV-UB610x125;;;;
However when pulling in a specific block the drawing the layer becomes 0.
Ive tryed adding this additional macro line before the above one which fixes the problem :-
^C^C-LAYER;M;E-LIGHTING-CEIL;C;R;;;ORTHOMODE;1;^c^c-insert;HVLV-UB610x125;;;;
However now the block retains its layer properties ......ie E-Lighting-Ceil (or what ever I name it) but it drops the block
in RED, instead of its original colour.
Question is Im looking for a macro that will bring in my block as per ^c^c-insert;HVLV-UB610x125;;;;
but also bring it in to a drawing on its original layer that its saved to.
please note that even thou the first code brings it in at layer 0, the blocks layer is also inserted into the DWG however its just not associated to it ..... hence the user has to select the block once he or she has brought it in and then change the layer from the layers manager manually. This is not ideal.
just to recap i just need a macro that will A) bring in a block from a location. And B) keep all the properties it has when it is brought in.
View 3 Replies
View Related
Jun 25, 2012
The routine below delete group of blocks by name, but if the blocks are on locked layers, these are not removed.
How can improve the lisp?
(defun c:deleteblock (/ rn ss)(defun Jd (realname) (setq ss (ssget "x" (list '(0 . "INSERT")(cons 2 (strcat "`*U*," REALNAME))))) (mapcar '(lambda (x) (if (not (eq REALNAME (vla-get-effectivename (vlax-ename->vla-object (cadr x))))) (ssdel (cadr x) ss))) (ssnamex ss))(setq ss_len (sslength ss)) (command "_erase" ss "") ) (setq rn (vla-get-effectivename (vlax-ename->vla-object (car (entsel "
Select the block you want to delete:"))))) (jd rn) (princ (strcat "
" (itoa ss_len) " Blocks called "" rn "" has been deleted")) (princ) )
View 9 Replies
View Related
Nov 23, 2011
How I can select all layers using the command line?
I am going to write a piece of lisp which will reset all the lineweights for all layers to default and have started by doing it manually on the command line to see what I need to automate.
To start with I choose -layer then LW then type default and it is here I have a problem. It asks enter name list of layers for lineweight default which is where I need to choose all.
View 3 Replies
View Related
Jan 8, 2014
How would I get LAYISO to freeze not turn off layers I do not want to see? I did this in AutoCAD 2006 but recently upgraded to 2014 and do not remember how I did it.
View 6 Replies
View Related