AutoCAD Visual LISP / AutoLISP :: XREF Rename / Repath
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
ADVERTISEMENT
Jul 31, 2009
Is it possible to run a lisp which can extract all the xref names, make a layer with that name and then change the xref on the layer? I have got a similar routine from earlier posts but it doesn't work if any xrefs inserted in paper space (works fine on model space). could change this routine allowing to change the layer of xref in paper space too.
(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( )
(setq ss (ssget "x" '((0 . "INSERT"))))
[Code].....
View 8 Replies
View Related
Oct 2, 2012
I am using (trying to anyway) a :VLR-xrefSubcommandReloadItem reactor. My only question is how to get the xref/block name from the 'reactor callback data' Object ID.
I am ultimately trying to pass it to (vla-get-xrefdatabase ....), but I cannot figure out how to turn the second parameter from the reactor callback data into something I can use - for example the second parameter returned may be "65" or some other number.
Civil 3D 2011
Windows 7 x64
View 1 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
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
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
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
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
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
May 17, 2013
I wanna change my block name to attribute text value, any similar lisp code?
View 9 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
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
Jan 27, 2012
I am looking for some mleader customization.Basically looking for a mleader that will add an objects name(in my case an xref or block) in the text. Attached is a picture of our current process... nothing special. basically instead of typing in text we use the insert field. In the field dialog that opens we select "object" under Field names, then under object the type button is pressed to select object(in my case and xref or block) then under property the "Name" option is chosen. This will insert the xref name in the multileader. This is not terribly hard but am curious if I can automate and save some steps.
View 1 Replies
View Related
May 10, 2012
I can't seem to find the SYSVAR that controls insert to 0,0,0 instead of pick on screen..
Quad Core 2.3GHz Intel, 64-Bit, Win 7
16GB Ram, 2GB Graphics Card
256GB SSD
View 2 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
Jun 29, 2013
I'm new to the programming thing, and this one has me stumped. We have a problem with people accidently dragging xrefs. The simple solution would be to put all of the xrefs on a locked layer, but I was vetoed on this suggestion. I've been trying to figure out if I can write a lisp that will do one of the following: Give an alert if an xref is moved.Not allow an xref to be moved.Tell the user when they open a drawing that an xref is not at 0,0,0 insertion point.
View 1 Replies
View Related
Jun 18, 2013
This lsp was passed on to me from a colleague but he doesn't know where he got it. It does a useful procedure of placing each xref, residing in the drawing, to a unique layer. The layer name is derived from the xref name. I would like to edit this to take only part of the xref name. This system I work with requires all files to have the job number as a prefix eg LE1399901_Contours.dwg, so the xref name would be LE1299901_Contours by default. I want to remove the first 10 characters to be left with "X_Xref-Contours" layer name using this code.
(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( / ss cnt xrs en ed bn xp xbn )
(setq ss (ssget "x" '((0 . "INSERT"))))
(setq cnt 0)
[code]........
View 5 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
Aug 14, 2009
I'm looking for a lisp that will change all the layer colors of selected xref by clicking the xref and select color from the color table palette. I have a routine that would change the layer color of a selected entity other than xref.
;;Changes selected object layer to a true color
;;of chose from a dialog
box
(defun c:cvc (/ ent ent_data rgb str objlay)
(setq ent
(entsel)
)
[code]....
View 5 Replies
View Related
Oct 19, 2011
Is there way get field object att in xref ?
View 3 Replies
View Related
Feb 11, 2013
is it possible to bind an an xref via ObjectDBX without opening the drawing?
View 1 Replies
View Related
Nov 7, 2013
Any routine or way to convert a nested xref to a regular xref?
View 4 Replies
View Related
Aug 15, 2013
I think there is a function that will cause the selected object that is in the XRef to highlight.
View 1 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
Apr 30, 2013
I need a routine that will duplicate the current sheet's Layout tab and content to the next tab, set it current, delete the titleblock (by name) on the new tab and reference in a differently named titleblock, 1:1, 0,0 onto the new Layout tab. I'll be running this in a batch script.
View 9 Replies
View Related
Aug 22, 2012
I have a Lisp that I have been working on with some folks in the office, and i feel like i am close, but i am not getting the cigar. The idea would be to have the lisp allow the user to select a nested x-ref entity, and change the color and linetype of the selected layer, similar to the old "LAP" command (I know it is a dinosaur, but I still miss it). I seem to be doing swimmingly, code I have quasi-plagiarized. It seems to crap out where i try to pass the selected linetype back to the layer. I get the nastygram "Command: ; error: no function definition: GETLINETYPE" right after selecting the linetype from the dialog.
Code below...
x(defun c:CX (/ Sel EntList DataList cnt Num ClrNum EntData)
(if (setq Sel (nentsel "
Select object to change layers color and linetype: "))
(progn
[Code]...
HP Elitebook Workstation
Windows 7
View 6 Replies
View Related
Feb 13, 2013
I am trying to write a LISP that does the following:
-Open drawing
-Saveas as NEW drawing based on certain criteria from DCL menu
-Deletes old drawing
-*THEN, if drawing contain attached IMAGE FILE (.tiff in my case)
-Rename image file and repath image file based on the new file name
I have gotten it to do all of this, except I can not figure out how to change the "reference name" of the attached image file (.tiff)
Is this read-only data? I can manualy change it under xref manager, so there should be a way to do it via code...
The closest I have gotten:
;;after renaming and repath image file...
(SETQ NAME2 (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4)))
(setq item (vlax-ename->vla-object (entlast)));convert to vl object
(setq check (vlax-property-available-p item "Name" T));check if the entity can be updated
;if it can
(if check
;change value to match
(vlax-put-property item 'Name NAME2))
'Name seems to be valid w/ xref'd blocks but not xref'd/attached image files..
View 1 Replies
View Related