AutoCAD Visual LISP / AutoLISP :: Change Lineweights Of All Layers By A Factor

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Changing Text Color And Width Factor

Sep 28, 2013

What is the best way to change the color of two pieces of specific text in lisp? I want to change where it says (strcase ln6) & (strcase ln7) to the color of green. I tried it a couple of different ways but I'm having some trouble. First I am setting the current layer with a color of blue. I am then running the text command a couple of times. I want to run the mtext command a couple of times but I want the text to be green & I want the width factor to be .85

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layers Based On Attribute Name Tags

Oct 11, 2011

What I am trying to do is grab the value of the owner tag (of which there are four), and use that value to determine which layer to place it on.  What it seems to be doing is hanging.

Here is what I have so far:

(setq SSBlks (ssget "x"'((0 . "*INSERT"))))
(while (/= (sslength SSBlks) 0)
(setq w(sslength SSBlks) V 0)
(setq attentity (ssname SSBlks 0))
(setq attname (entget attentity))
(setq cntr 0)
(while (< V cntr)

[Code] ......

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine For Changing Levels - Transform Survey By Certain Factor

Jun 18, 2013

I used to a have a LISP for changing levels en masse if I needed to transform a survey by a certain factor. Unfortunately I've lost it.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Script That Assigns Lineweights To Layer Based On Color Of That Layer

Nov 19, 2013

Any script that when ran will set lineweights of a layer based on what color the layer is assigned.  For instance if I have 3 lines that are green on 3 different layers. I need the script to change all 3 layers lineweight   to .015mm. I have drawings that are inconsistant with layer names so layer translator and methods of that nature will not work because I do not know all the layer names and I have 100 drawings to do this to.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layers ON / OFF Automatically

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

AutoCAD Visual LISP / AutoLISP :: Script For Layers

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

AutoCAD Visual LISP / AutoLISP :: Import Layers From DWT

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

AutoCAD Visual LISP / AutoLISP :: Changing XREF Layers In DWG

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

AutoCAD Visual LISP / AutoLISP :: Locking Several Layers With One Button

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

AutoCAD Visual LISP / AutoLISP :: Copy A Block To All Layers

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

AutoCAD Visual LISP / AutoLISP :: List Layers By Their Index

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

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 View Related

AutoCAD Visual LISP / AutoLISP :: Freeze All Xref Layers?

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

AutoCAD Visual LISP / AutoLISP :: File To Plot All Layers ON?

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

AutoCAD Visual LISP / AutoLISP :: Deleted The Extra Layers

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

AutoCAD Visual LISP / AutoLISP :: Import Layers From A Text File?

Mar 12, 2012

Is there a way to import layers from a text file?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding LAYERS To Tool Palettes?

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

AutoCAD Visual LISP / AutoLISP :: Sort Through A Database And Rename Layers

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

AutoCAD Visual LISP / AutoLISP :: Freezes Layers In Viewports But Not In Model Tab

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

AutoCAD Visual LISP / AutoLISP :: Replace Block On Different Layers With Different Blocks

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

AutoCAD Visual LISP / AutoLISP :: Merge Layers With Wild Cards

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

AutoCAD Visual LISP / AutoLISP :: Macro Block Inserts And Layers

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

AutoCAD Visual LISP / AutoLISP :: Remove Blocks In Locked Layers?

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

AutoCAD Visual LISP / AutoLISP :: How To Select All Layers Using Command Line

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

AutoCAD Visual LISP / AutoLISP :: LAYISO To Freeze Layers Instead Of Turning Off?

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

AutoCAD Visual LISP / AutoLISP :: Delete All Objects In All Layers Except One Layer?

Jul 29, 2013

lisp program to delete all objects in a drawing based on Layer excluding one layer objects.

in AutoCAD.

Example : I may have 10 layers in a drawings like 1 to 10. I need to delete all objects on 2 to 10 layers.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Thaw Layers From Custom Dialogue Box?

May 31, 2013

I am trying to find a command that will pull up a dialogue box with all layers that are frozen and be able to select one or more to thaw from that list. I hate the layer manager, it's too slow especially when I have a ton of layers to deal with.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Freeze Layers In Viewports On Named Pages?

Jun 24, 2013

I am in need of a LISP to freeze layers in viewports on named pages. I found the following functions to return the frozen vport, but it only returns the list of already frozen and it only works if the viewport is active; besides just listing the frozen layers isn't enough. I need to be able to supply the page/tab and a list of layers to freeze.

; by Jürg Menzi 1999(DEFUN GetFrozenLaysInVport (/ LayLst) (FOREACH memb(GetMviewInfo) (IF(= (CAR memb) 1003) (SETQ LayLst (CONS (CDR memb) LayLst)) ) ) (REVERSE LayLst))(DEFUN GetMviewInfo (/ ActVpt CurSet IDX RetVal TmpVal) (SETQIDX TActVpt (CAAR (VPORTS)) ) (IF (OR(= ActVpt 1)(= (GETVAR "TILEMODE") 1) ) (SETQ RetVal nil) (PROGN (SETQ CurSet (SSGET "X" '((0 . "VIEWPORT")))) (WHILE IDX(SETQ TmpVal (ENTGET (SSNAME CurSet 0) '("ACAD")))(IF (= (CDR (ASSOC 69 TmpVal)) ActVpt) (SETQIDX nilRetVal (CDR (ASSOC "ACAD" (CDR (ASSOC -3 TmpVal)))) ) (SETQ CurSet (SSDEL (SSNAME CurSet 0) CurSet))) ) (SETQ CurSet nil) ) ) RetVal)

Is it possible to provide the page/tab name and a list of layers as aguments to a subfunction that could either activate the viewport and freeze a list of layers, or simply freeze the layer list for the named page's/tab's corresponding vport.

Important: most of my pages/tabs contain at least two vports. The largest of the two vports is the only one I wish to change, but if the layer list is frozen on all vports (per page/tab) it will make no difference because the smaller vport only requires that layer 0 is visible.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Blocks With Some Of Attributes On Locked Layers

Jan 4, 2012

i am trying to restrict users from modifying certain attributes in a block,i can create the blocks with some of the attributes on locked layers, but then autocad pops up an annoying alert box, is there a way to disable this? the other option i can think of is to redefine the commands *ddedit, *attedit, *ddatte,*attipedit,

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File To Thaw All Layers Frozen In Viewport

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







Copyrights 2005-15 www.BigResource.com, All rights reserved