AutoCAD Visual LISP / AutoLISP :: Add Counter For Layer Changing
Mar 29, 2012
i have this LISP as attach...at moment it works like this as below:-
1) Activate the LISP
2) Automatic select all the preset block name in the lisp and change to a pre-set layer
3) LISP end
Now i wish it to be like this:-
1) Activate the LISP
2) Automatic select all the preset block name in the lisp and change to a pre-set layer
3) At command prompt, will state out " n block have been change to layer Eye Bolt"
4) LISP end
View 1 Replies
ADVERTISEMENT
Aug 22, 2011
if my attach lisp can add sort of counter that how many dimensions, leader and multileaders have been move to layer "dimension"...
View 9 Replies
View Related
Oct 5, 2012
How to edit the string below so that it will ignore all layer names starting with "E-". I want to change all XREF layers in the current dwg. to 161 but ignore all XREFED layer names that start with E- such as E-lighting, E-power etc.
View 4 Replies
View Related
Sep 26, 2013
for my latest little project I'm trying to change layer settings depending on a entry in a sheet set attribute.
Basically, if the sheet set custom attribute entry is 'white' I want the colour of a specific layer displayed as 255,255,255, and if it's blue I want it changed to 0,0,255. So I can control the colours from a sheet set custom properties level.
And for it to check if the layer existing in the drawing, so it'll skip the process if it's not there.
View 7 Replies
View Related
Sep 3, 2013
I have too many blocks with specific layers inside.
develope lisp can change all to layer 0 but keep color and linetype as it is.
I will use this as a part of script to change multiple block.
View 9 Replies
View Related
Sep 19, 2013
I'd like to change a layer's color from command line because of a user icon. I figured out from previous topics that I should use macro similar to this: ^C^C_filedia;0;-la;s;Verdeckt (ISO);c;1;l;dashed;;_filedia;1;re;
(I want to use this macro to change layer's linetype, too, but that's not the point)
The only problem with this macro: layer's name contains a space therefore Autocad tries to recognize Verdeckt as a command (and macro interrupts there) instead of setting Verdeckt (ISO) as the current layer. I've tried using different quote marks, none of them worked (' and " and <>). I hope there's a method for entering a parameter that contains space.
Software: Inventor Series 2011 SP1 x64
OS: Vista Business x64
CPU: E6400
RAM: 2*2Gb GeIL
VGA: Quadro FX 550
View 5 Replies
View Related
Mar 23, 2010
How can i test a polyline if its clockwise or counterclockwise? I have a routine that gets the area of polylines then if clockwise,the area is positive and negative if not. But I dont want to get the area just to test if its clockwise or not.
View 9 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
Oct 15, 2012
I want to override the measurement in a dimension with a string of text using a LISP command.
E.g.. "select dimension"
type new text for dimension
replace dimension measurement with new text. I can get the entity and its values, buy not sure which value to change for the "text override".
BTW Acad 2012.
View 3 Replies
View Related
Feb 8, 2013
Can you change the color of a block attribute with lisp like you can with the built in Enhanced Attribute Editor function eg
I can change the value of the attribute LAMP but can I also change its color from the color of the layer its created on?
(while (not (equal ck "SEQEND"))
(setq e1 (entnext e1)
e2 (entget e1)
ck (cdr (assoc 0 e2)))
(if (= (cdr (assoc 2 e2)) "LAMP")
(progn
(setq e2 (subst (cons 1 lamp)(assoc 1 e2)e2))
(entmod e2)
(entupd e1)
(setq ctr (+ ctr 1))
)
)
)
View 9 Replies
View Related
Sep 3, 2004
Is there a way to force a setting in a PC3 file?We have one set up to print rotated and sometimes for whatever reason it changes back to Auto for the rotation. It's under Graphics of the Custom Properties I would like to write something that if a person plots with this PC3 that to rotation will be forced to 90 degrees.
View 4 Replies
View Related
Apr 17, 2012
lisp..It work fine but just that i need some minor modificatio to it...At moment, when i activate the lisp, it will automatic select all dimension,leader and multileader to a layer call "DIMENSION"...Anyway i wonder if it is possible to prevent any dimension,leader or multileader in layer "Section" will not be change to layer "Dimension"?
View 2 Replies
View Related
Jun 20, 2012
Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?
View 9 Replies
View Related
Feb 21, 2013
Possible to link an xref layer and local layer so they display the same (eg. sync viewport colour, linewieght, line type)?
I insert xref's for my base drawing but legend is on local layers and I would like to be able to ensure that the line colour and linetype always match...
View 4 Replies
View Related
Aug 28, 2012
I have a customized button to draw an ‘ac-arrow’. I created a lisp to create the layer “G-ANNO-LEDR”
if the layer name is not found. The advanced part I would like is:
Current layer: E-ANNO-WIRE
Ac-Arrow Leader: G-ANNO-LEDR
OPTION 1:
If, say I am on current layer “E-ANNO-WIRE” and need to draw my “ac-arrow” leader, and continue working
on the original layer “E-ANN-WIRE” (and have the leader be drawn [remain] on the layer “G-ANNO-WIRE”).
With this option, I have the block “ac-arrow” imbedded in my template drawing file to have the block at hand.
With this option, the layer “G-ANNO-LEDR” will be created IF it is not on the drawing.
OPTION 2:
- Currently be on layer “E-ANNO-WIRE”
- Bring in the block “ac-arrow” from my block library “L:AutoCADSymbols”
- Draw the “ac-arrow” leader which will be on layer “G-ANNO-LEDR” (this layer created IF it is not
on the current drawing).
- After the leader is drawn’
- Be put back to the layer I was, “E-ANNO-WIRE”, and continue working.
The OPTION 2 is what I would really like to have. A while back, I happen to see one like OPTION 2, but I cannot
find it anymore on the users groups. I have been searching for a while now.
Currently, I use the button in my customized toolbar (see image) and have to have the “ac-arrow” block in my drawing and have its layer created in the drawing.
View 1 Replies
View Related
May 31, 2012
I'd like to have/write a lisp to change all objects on layer "0" to layer "PC - Module"
If possible also;
save the document close the document open next in directory run layer changer program again.
View 8 Replies
View Related
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
Mar 20, 2013
Right now I have a few lines in the ACADDOC.lsp file to set up the plot stamp for all users. I would like to just turn on the plot stamp and auto load a custom .pss file that I have set up.
View 1 Replies
View Related
Jul 27, 2013
I need to create a command which could change a color of an allready existing selection set when activated. For example i have a command which creates a cube, where each specific group of lines were added to different selection sets. how can i recall any created selection set by its name and change its color?
View 9 Replies
View Related
Feb 17, 2009
How to change the Backgroundcolor of the Blockeditor with VLisp? I haven't found neither a SystemVariable nor somthing inside the AcadPreferencesDisplay object.
View 6 Replies
View Related
Feb 6, 2011
I have insert blocks in my dwg. It is the circle. While creating the block, i was just pick the point into the circle not exactly at the centre.
Now i want change the insertion point of the block at centre of the circle without moving the objects from the dwg.
Beacuse i had use block editor to change the insertion point. But after changing, all blocks were moved from the original position.
View 4 Replies
View Related
Dec 21, 2012
I am trying to speed up some basic drafting of text revisions. In the P (plumbing) we call out the fixture units for a water pipe, along with the fixture units, the pipe size changes.
Is there any way to add numbers in an attributed block? (I have a lisp that works on text & mtext, but not attributes)
1.1. Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size). I would want it to only add the 1st text fields. [If possible then change the 2nd text field according to a changeable chart. (see #2)]
1.1.1. This is how the block looks like: x (y")
1.1.1.1. x could be any number from 0.5 – 10,000 (only using 1 decimal place, and only as needed)
1.1.1.2. y could be any number from the following list: ½, ¾, 1, 1¼, 1½, 2, 2½, 3, 3½, 4, 5, 6
Is there a way like in excel that you can set up a formula that will give a numerical result depending on other input? Like pipe size that change depending on the number of fixtures. There would need to be two different formula, one for hot and one for cold values (The value would be set at the beginning of the job; typically these values would not change later in the job). This could be separate text or if possible using the attributed block as described in #1.
2.1. Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size). I would want it to change the 2nd text fields according to the value in the 1st text field. If the value in {x} is 0.5 – 1.0, it would result in ½; 1.5 – 7.0 = ¾; 7.5 - 17 = 1; 17.5 – 36 = 1¼; ect.
2.2. In excel it would be =IF(x)<1,"1/2",IF(x)<7,"3/4”,IF(x)<17,"1",…{all #’s in between} …IF(x)>5000,"6")))))
View 9 Replies
View Related
Apr 19, 2012
Once upon a time in a job far, far away I had a lisp routine that deleted the current page setups and replaced them with new ones imported from a template drawing. It's probably been a good 6-7 years since I found it the first time.
View 2 Replies
View Related
Sep 20, 2012
I am currently using this lisp routine to export selected objects as a dxf to import into another program:
(defun c:dxf ()
(command "_dxfout"
(getfiled "DXF File:" "c:/dxf/" "dxf" 1)
"_Objects" (ssget)
"" ; completes selection
"_Version" "2004"
"16" ; non-default number or other option if desired, with followup line(s) if
necessary
)
(princ "2004 DXF Created")
(princ)
)
this saves the dxfs to a location of C:DXF
I would like it to save to a different location, the desired location is within the same root folder that the drawing is located in and is called "DXF-Programs-Releases"
View 9 Replies
View Related
Dec 30, 2011
I am using the following routine definition then calling the different view poins from a pop up menu.
Each time I switch veiw points it drastically zooms out. I would like to maintain the "zoom distance" if there is such a thing when switching views.
Ideally, like when in 3dorbit, I would like it to swing views around similar to that but to the defined viewpoints as below....
(DEFUN V (inp) (setq inp (strcase inp))
(cond ((= inp "T") (SETQ IXY 270) (SETQ FXY 90)) ((= INP "F") (SETQ IXY 270) (SETQ FXY 0)) ((= INP "RE") (SETQ IXY 90) (SETQ FXY 0)) ((= INP "L") (SETQ IXY 180) (SETQ FXY 0)) ((= INP "RI") (SETQ IXY 0) (SETQ FXY 0)) ((= INP "URI") (SETQ IXY 0) (SETQ FXY 45)) ((= INP "UL") (SETQ IXY 180) (SETQ FXY 45)) ((= INP "UF") (SETQ IXY 270) (SETQ FXY 45)) ((= INP "URE") (SETQ IXY 90) (SETQ FXY 45)) ((= INP "URF") (SETQ IXY 315) (SETQ FXY 35)) ((= INP "URR") (SETQ IXY 45) (SETQ FXY 35)) ((= INP "ULF") (SETQ IXY 225) (SETQ FXY 35)) ((= INP "ULR") (SETQ IXY 135) (SETQ FXY 35)) );COND (COMMAND "VPOINT" "R" IXY FXY) );END V.LSP
View 3 Replies
View Related
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
Jan 2, 2014
Any routine for changing color of AutoCAD background in model space. As for changing background color we have to follow four steps namely as follows:-
1. Execute OP
2. Go to display tab
3. Go to color tab
4. Change color
A tool that directly calls the model color shall be highly beneficial.
View 3 Replies
View Related
Nov 23, 2011
The following snippit of code is changeing the color of text in a cell of an AcadTable. It will set the color to an RGB value and works great. But what if the color is a normal color 1 through 255 from autocad's pen table. How would I set the cell text color?
(setq objColor (vla-getcellcontentcolor eVLAMT R C)) ;sets a Color Object, whatever that is
(vla-setrgb objColor RED GRN BLU) ;sets the new color of the Color Object
(vla-setcellcontentcolor eVLAMT R C objColor) ;sets that new color object to the cell
View 5 Replies
View Related
Jul 15, 2013
Any lisp routine for changing the text width of all the attributes in a block globally. I want to change it from 1.0 to 0.8. I have attached a symbol where the attritube tags will be the same.
View 2 Replies
View Related
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
Feb 7, 2010
How can I get the layer that an entity is on. I have tried numerous method but they don't seen to be retrieving the layer information.
View 8 Replies
View Related