AutoCAD Visual LISP / AutoLISP :: Batch Rename All Blocks In Drawing?
Feb 29, 2008
I would like to batch rename all blocks in a drawing to NEWJOB01, NEWJOB02 ,etc. I can't use wildcards with RENAME command because the old names don't always have a common name. I prefer to use a lisp routine.
View 9 Replies
ADVERTISEMENT
Oct 3, 2012
I have 30 blocks per drawing about 60 drawings. Each block starts with the jobname has other block info and then the block type. For example
Bldg31-MechEquip_ABC
Bldg33-MechText_DEF
Bldg45-ElecEquip_GHI
I want the output to be just ABC, DEF, and GHI.
I have a rename script but I dont know where to go from here. How can I tell it to remove everything up and including the "_" symbol?
View 5 Replies
View Related
Oct 22, 2009
I am working on a large project where a 3rd Party firm has turned over 100s of drawings that we need to get into our system. The problem is that they did not name their physical files properly. We have a particular numbering system for our drawings, the engineering firm did fill in our attributed title block properly and used our numbering system correctly within the drawing. However, their physical file name follows their format. We need to have the physical file name match the information in the title block to get into our system.
Is there a way to "Batch Rename" these files by reaching into the title block and then renaming the physical file to match the attribute?
I have to be honest, I may use AutoCAD 50 to 60 hours per week, but I am no programmer! I am just the go-to person here for AutoCAD whom is stuck trying to come up with a efficient solution for the project team whose engineering firm could not follow our procedures! I was hoping some sort of batch routine could take care of this problem for us instead of us having to individually rename each physical file one by one.
View 9 Replies
View Related
Oct 30, 2012
I am looking for a lisp routine or rename mulitple blocks by keeping the same name, but adding a suffix to it.
I have used "rename" block to add a prefix to multiple drawings, but it doesnt let you add a suffix. (As far as I can see)
View 7 Replies
View Related
Feb 22, 2012
We've recently converted all our microstation drawings to autocad now that the company has decided to go with one cad program company wide.
One of the issues we are having after getting the drawings back from the this co. converting them is the cells to blocks convertion inside the drawing. when we open a drawing and see a "Fuse" block for instance and if it a has multiple inserts, it named them:
Fuse
Fuse_1
Fuse_2 etc....
is there a lisp routine or some command that would replace the "Fuse_*" blocks with "Fuse"..I've been searching the forums and know about the express tool Replace Block but need to be able to automate somehow.
I thought about trying to rename each of the "Fuse_*" but of course it won't let you rename to a block name that already exists..
View 1 Replies
View Related
Mar 23, 2003
I have a lisp routine that uploads all the blocks contained within a specific folder and inserts or redefines all blocks of the same name within the current drawing.
My problem is that when I run the routine I prompts me that it can't fine the folder? I created a folder called "blocks" and is located straight onto my C:..........but it still doesn't work.
;FUNCTION TO UPDATE ALL BLOCKS WITHIN A DRAWING
;FROM A SPECIFIC DIRECTORY
(defun c:bup()
(SETVAR "cmdecho" 0)
(setq sst (ssget "X" (list (cons 0 "INSERT"))))
(setq c1 0)
[code].......
View 3 Replies
View Related
Oct 29, 2013
I would like to update a CUIX and rename it, both the file name and the internal customization group name/description. The main issue is that the associated MNL file will fail to load after the renaming.
The internal name is currently the same as the file name with spaces replaced by underscores.
I have tried the CUIX transfer method, I have tried simply renaming the file and leaving the internal name alone, I have also tried renaming to .ZIP, and modifying the one file inside that contains the internal name/description, recompiling the ZIP and renaming back to CUIX.
As stated above, using any of the above methods the main issue is that the associated MNL file will fail to load. This is with Civil 3D 2014. Also the customization group name may appear in the CUILOAD dialog without underscores and depending on the method the ribbon tabs will not even appear.
I've also noted that the MNL file associated with the partial CUIX loads twice in Civil 3D 2014 and only once in AutoCAD 2013. I haven't done further testing on that.
This is mainly cosmetic as our current CUIX has 2011 in the name and I would like to update to 2014.
View 1 Replies
View Related
Jan 10, 2013
I am looking for a lisp that will rename all the layouts automatically. I tried the Layoutlist function but the output is not in order. Is there anyway that i can get all the layouts in a drawing from left to right order. for eg. i have layouts from layout1, layout 2........layout10). The layoutlist returns as layout1,layout10 etc...instead of layout 1 layout 2.
View 4 Replies
View Related
Nov 25, 2012
what i would like to do is rename (externally) and repath about 4-8 xrefs in a drawing set of about 100 drawings.
you may ask why? it is because we are trying to establish a template set of drawings for a civil design office. and when we start a new project, copy over the drawings to the relevant project folder, change the project number, run the script across the drawings and go from there. I've also tried this using the reference manager, but it doesn't work when you change the name of the xrefs (loses association)
basically i know if i could use a lisp i would run it using autoscript or something equal. All i need is to figure out the code to change the project number in the xref
for example
current - "xxxx-PN009999-aaa-00-survey.dwg"
change to - "xxxx-PN001234-aaa-00-survey.dwg"
from my research so far, the easiest way is to make a lisp with the following
-rename
b
xxxx-PN009999-aaa-00-survey
xxxx-PN001234-aaa-00-survey
-xref
p
xxxx-PN001234-aaa-00-survey
c:acadcivildummyfolderxref
If this is the correct code, do i have to rename the CAD xref files in explorer first?
View 1 Replies
View Related
Sep 3, 2012
I have to batchplot a lot of drawings but before that i need to rename a block in every drawing. I want to get from ABC 123 to ABC_123.
this is my code right now for the part to rename the block.
(princ "-rename
" File#1)
(princ "b
" File#1)
(princ "ABC 123
" File#1) <---- here i get the problem.
(princ "ABC_123
" File#1)
This comes in the prompt:
Command: -rename
Enter object type to rename
[Block/Dimstyle/LAyer/LType/Material/multileadeRstyle/Style/Tablestyle/Ucs/VIew/
VPort]: b
Enter old block name: ABC
Cannot find block "ABC".
How do i include space and 123 in the princ?
I am using map3D 2012.
View 4 Replies
View Related
Sep 23, 2013
I am looking for a LISP to automatically rename all my layouts. I would like the first layout to say "HWY 400 (01)", second layout "HWY 400 (02)", third layout "HWY 400 (03)" ect..
View 4 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
Jun 24, 2009
I need to do three things in a LISP routine for around 200 drawings. First, I need rename lots of old layer to new standard layer name, like change layer name "CL-RAILWAY-0" to new layer name "CL-0".
Secondly, I need translate some layer to standard layer, like all the things on layer "CL-WATER-160" to layer "CL-0"
Last, change some linetype, like change linetype"CENTER" to "CENTERLINE". I can do all those things by "CHECKSTANDARD" manually, but I really need someway faster and easier.
View 9 Replies
View Related
Aug 15, 2011
how to write a LISP that enable me to direct automatic rename multiple block name?
Example is i have 3 block names as " A123 " , " A728 " , " A003 "
When i activate the LISP, it will automatic rename the block name to be " CAD1" , "CAD2" & "CAD3", whereby
the word "CAD" i can change whenever i start to use it change multipld block name.
View 9 Replies
View Related
May 17, 2013
I wanna change my block name to attribute text value, any similar lisp code?
View 9 Replies
View Related
Feb 28, 2011
(defun CELBLKS ( / e blk ss blkl)
(setq blkl "" ss (ssadd))
(while (setq e (entsel "
[Code]....
i have this lsp, it works great but how can modify it if i want select with a window.? exemple: if i have 3 differentes blocks, i want to select them with windows and the lisp select all blocks that are identical of those 3.?
View 9 Replies
View Related
Jan 24, 2012
I have a project in 3D that I would like to export to Stadd. This requires lines rather than blocks. Is is possible to convert the blocks in the attached dwg file to to lines that are centered on those blocks?
View 9 Replies
View Related
Dec 27, 2013
How to add the sheet description field into the rename & renumber window? I ask this because during the sheet set-up process we use the sheet description often, and I would like to go from sheet to sheet without having to right click and edit every sheet.
Civil 3D x64 2012
Win 7 x64 Ultimate
I7 3820 (3.6ghz quad core with HT)
32gig RAM (Corsair XMS3 4x8g)
Intel x z79 mobo (BOXDX79TO 2011 socket)
Radeon HD 7850 2gb GDDR5
View 2 Replies
View Related
Nov 23, 2011
My work needs to convert thousands of DGN files to DWG. We are using AutoCAD 2012. Is it possible to batch convert dgn files with a LISP and a mapping file?
View 9 Replies
View Related
Nov 11, 2011
I am trying to make a lisp to export to dgn for use in a batch. I have tried the following but get hung up at an "invalid path" error. I think I am not passing to -dgnexport a path in the correct format.
(defun c:deport()
(setq fname (getvar "dwgname"))
(setq fpath (getvar "dwgprefix"))
(setq dgnname (vl-string-right-trim "." fname))
(setq dgnnamenew (strcat fname ".dgn"))
(princ dgnpath)
(command "-dgnexport" "V8" dgnnamenew "master" "standard" "C:ProgramDataAutodeskACA 2011enuTemplateAutoCAD
TemplatesV8-Imperial-Seed3D.dgn"))
View 3 Replies
View Related
Jun 17, 2013
I cannot get my lisp routine to run when I batch plot in AutoCAD 2014. It's loaded into the startup suite and runs when I open the individual drawings but not during a batch plot. How can I get this to run during a batch plot?
View 9 Replies
View Related
Jun 15, 2012
I recently upgraded to a new PC.
We get a lot of files from customers where there are multiple drawing borders all in model space.
Sometimes as many as 150-200 borders in one file that we need to print for the shop floor.
Years ago, I wrote a LISP routine that prompts for printer settings (Fit or To scale, etc.) and then prompts for
2 corners of each border and then writes a script file and launches it to batch plot each drawing.
My thinking was that I had to manually pick each drawing anyway, this LISP routine saved me from having to issue the plot command over and over.
Anyway, since my PC upgrade, the LISP routine fails.
There is a line of code that answers the plot prompt for output device name where I have the same printer as always.
When the script runs up to that line, AutoCAD tells me that printer is "not found".
So then it keeps reading the rest of the script lines which answer other plot prompts and repeatedly says "device not found".
If I manually print, I can choose the same print settings in the dialog box that the script file has and it can "find" that same device.
Why I can print manually but the LISP/script file gives me a "not found" error.
BTW, when I upgraded my PC, I also upgraded AutoCAD from 2012 to 2013..
View 8 Replies
View Related
Apr 26, 2012
Is there any way for me to choose a bunch of .dsd files, and have those be batch plotted?At the moment I have to publish one .dsd file at a time, and each .dsd file can take about 10 minutes to go through all the layouts I have.
Does Autocad have that capability built in? Or is this a problem that can be solved with scripts?
View 1 Replies
View Related
May 9, 2013
I have 40 pages in one set of drawings and would like to rev-up the drawings. i will put same texts in same locations in the title blocks.
View 9 Replies
View Related
Jan 11, 2014
I was on an older cad and am now moving to 2014.. my previous cad was heavily customized the old school way, I have decided to learn the CUI (and dynamic blocks)
My old cad has blocks on a drop down menu.. click BATH menu than WC icon, a macro sets the correct layer than inserts the WC.. took time to setup but pretty simple and straight forward (see attached for menu syntax). I also made a toolbar BATH and on that toolbar I made a WC icon.. that’s what I use the most
couple of questions
1) do I have to make a new command in CUI for each block to do the same thing?
2) I looked into the design center, but seems like its too many steps but it seems a toolbar with an icon on it, clicking the icon and a macro sets layer and insert block is still pretty quick..??
3) if a toolbar with an icon is still a fast and less step method, can I open the block and somehow make an icon of it? if so where do I put it?
View 9 Replies
View Related
Apr 12, 2012
I have this code w/ which I can open up Block Library Blocks for editing. We have R2012 installed w/out VBA.Our MIS department is impossible to deal with. We have this new fangled permission hysteria so I cannot install VBA myself.Is there any other way to open up my blocks? What I can I do instead?
(defun CpL () (prompt "...Open Library Block or Xref...")(terpri)
(setq a (entsel)) (setq b (car a )) (setq c (entget b)) (setq d (assoc 2 c))
(setq e (cdr d)) (setq ff (strcat e ".dwg")) (setq PP (findfile FF))
(setq opath (strcat "acadapplication.documents.open ""PP"""))
(command "vbastmt" opath))
View 2 Replies
View Related
Aug 15, 2012
I have a batch program which I want to launch from a LISP program.
First this is an attempt at an automated process whereby user input is extremely restricted. Other than the first click of the mouse on the menu item to save a copy of the file to a very restricted folder, no other user input is allowed.
AutoCAD, like most commercial apps writes a temporary file and then renames it when you choose save or saveas. And due to the restrictions in this folder that will not work. Crazy, I know but it's the parameters I must work within.
The batch file I'm launching calls another batch program in it's execution and I'm wondering if that could be where control is lost. But the thing is I can type this at the command line in AutoCAD:
(startapp "//a_very_long/novell_server_path/my_folder/vlisp/mybatchfile.bat")
The whole process works great. The command window flashes briefly AutoCAD closes the active drawing window just like I want it to. And when I check that the dwg file has been copied to the restricted folder it's there and done. But when I place that same command within my LISP program or one like this:
(command "._STARTAPP" "CMD //a_very_long/novell_server_path/my_folder/vlisp/mybatchfile.bat")or(command "._STARTAPP" "CMD ""//a_very_long/novell_server_path/my_folder/vlisp/mybatchfile.bat"")
or just about anything else I try it fails to run. Perhaps I've been looking at this problem too long. I think I may move on to a VB.NET process to do this but I am really baffled why it will run from the command line but not within the program.
View 4 Replies
View Related
Dec 24, 2013
My drawing constitutes of many blocks and other objects , and i need to find specific blocks (with same block name) in my drawing which i cannot find them one by one and i though that i can find them all with lisp routine ..
so , i wanna specify point out of my drawing area and lisp routine will draw to line from basepoint of those blocks to specify point when i select one reference block.
View 4 Replies
View Related
Jan 14, 2013
would like to set a base point during insertion of one block.When not insert by AutoLISP, just type "b" to be able to change the base point.
But when I'm using an AutoLISP that inserts a block, it does not work, it interrupts the sequence of routine.
Lisp:
(defun c:carrobox()(setq #clayer (getvar "clayer")) (if (= unidades nil)(setq unidades "cm")).....
View 3 Replies
View Related
Jan 5, 2012
I've been trying tons of different solutions to solve this problem: insert a block that has an attribute which happens to be the last object id.
This is the best code I tried so far but without any succss.
(defun c:q1()
(command "_.PLINE")
(while (= (getvar "CMDNAMES") "PLINE")
(command pause)
[Code] .....
View 9 Replies
View Related
Apr 17, 2012
I wanted to flatten arcs, circles and lines inside a block using the following lisp (which I found in this forum). I found that sometimes this lisp is unable to flatten the ARCs inside the blocks. I do not understand why it is not working for all the blocks. I have attached a drawing in which this lisp is not working.
(defun c:FlattenRaj ( / blocks stpt enpt inspt )
(vl-load-com)
(setq blocks
(vla-get-blocks
(vla-get-activedocument
[code].......
View 1 Replies
View Related