AutoCAD Visual LISP / AutoLISP :: Renaming Relative Path Xrefs?
Oct 12, 2011
I have set up a master set of dwg. files we use to create our construction documents. The files consist of a master file that xrefs base files. All of our files are named using the project # first. (i.e. 2011001c.dwg). I have set up the master set using x's to replace the numbers.
Here is how it works:
XXXXXXXc.dwg (master file) relative path xref's the following files.
XXXXXXXlw.dwg
XXXXXXXvlw.dwg
XXXXXXXeg
XXXXXXXfg
XXXXXXXtitleblock
note: all of these files are saved in the same folder.
I am trying to find a way to keep the xref paths working when I copy the files to a project folder and rename the files using the actual job # insead of the x's as place holders. As it is now, when I change the drawing name the reference is lost and I have to manually change all of the xref paths in the xref manager. Is there a command, program, or lisp routine than can change the file names and update the paths automatically.
View 1 Replies
ADVERTISEMENT
Nov 12, 2012
I have found a way to convert FULL to RELATIVE using XRP2004.lsp but not the other way round. Main reason I want to do this is to change the Relative to Full, move the drawing and then revert them back to Relative.
View 3 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
Mar 20, 2013
I have a specific problem with renaming layouts. I found some similar lisps, but I just could not make them work.
In every layout I have following attributes.
PROJECT: 306
PHASE: RD
OBJECT: A0101
PART: EL
DRAWING: 611
ZOOM: X
REVISION: 01
I need to rename every each of layout using those attributes. Layout's name should look like that: "306_rd_A0101_el_611_x_01" . "rd", "el" and "x" must be written using lowercase.
View 9 Replies
View Related
Apr 21, 2008
I have an XREF that contain block inserts sometimes nested 2 or 3 levels deep. Given the block names, is it possible to find and translate the insertion point of the nested inserts to the current World UCS?
Ideally I would give a routine the block name and it would scan the current drawing and return a list of the translated insertionpoints>
View 5 Replies
View Related
Oct 14, 2013
I have been using to copy multiple objects from x-refs. The problem I'm having is that when I have the user input prompts in a macro i can screw up the command if i accidentally miss picking my selection set. I'm new to LISP and having trouble with selection sets and selection filtering.
On another note: I'm trying to rename layers copied this way to remove the "$0$" and using the rename command swapping $0$* with * works, however in the -rename command it does not.
View 1 Replies
View Related
Nov 21, 2011
I want to set all the layers on all nested xref's to color 8.
View 9 Replies
View Related
Oct 31, 2011
I have been looking around the web to find a quick lsp routine that will take all the xrefs in a drawings and move them back onto layer "xref" or "0" depending on what the design team wants.
The ones I have found don't work or move all the xrefs to separate layers.
View 9 Replies
View Related
Jul 3, 2013
I have a LISP that use the XATTCH command. How can I collect xrefs inserted by XATTACH? It can be more than one xref.
View 9 Replies
View Related
Nov 15, 2013
who can share with me a lisp which can create layer by xrefs and blocks ( if this can be an optional , would be nice ) ?
even maybe lisp can create layer group filter with "XREF" group name and move layers to inside.
View 4 Replies
View Related
Oct 9, 2012
Any code that will select all xrefs in modelspace and bind (insert) them?
the -xref bind command requires explicit names and if I use * it will also bind my titleblock xref in paperspace which I want to avoid.
View 9 Replies
View Related
Aug 13, 2013
I often work on drawings which have multiple xrefs, each having up to 100 Layers or more, so the layer manager can be a bit difficult to trawl through to find a local layer to select.
I know how to create a local layer filter using the code ~*|* from the new filter area in layer manager.
Ideally all I want to have to type in is: LOCAL and then the local layer filter would be created, with the filter name being Local-Layers (or similar).
View 9 Replies
View Related
Jul 30, 2013
I'm trying to get the file name of a file outside the search path. Obviously (findfile) is not an option. The file location changes with each project so adding a search path is also not an option. I can get the path to the file but i can't seem to figure out how to get the file name. I can also get the first set of characters, as they are constant from project to project, it's just the end of the file name that changes. The file is always a PDF.
View 9 Replies
View Related
Feb 12, 2013
I'm try to write a list to produce a script file!I just want to insert a dwg file in current drawing.back to MS Windows, in case of having [space] in a folder's name, we should use "" marks:
CD "Program Files"; DEL "file 10.txt"; ....
I tried both with and without "" marks but I failed!I pasted part of my code below with result of each case:
(setq TBFile "H:z.autocadA1 A2 A3.dwg")
(write-line "-INSERT" des)
(write-line (strcat "*" TBFile) des); ; *H:z.autocadA1 A2 A3.dwg <<=should be this
(write-line "0,0" des);;insert point
(write-line "1" des);;xyz scale
(write-line "0" des);;rotation
[code]....
View 4 Replies
View Related
Dec 17, 2013
I'm using a Lisp which searches a certain folder and then updates all blocks, which are nested in that folder.
My issue is, that I'd like to use more than one folder on different path, where the LISP can search for this files. Is there a way to use multiple search path?
The code I'm using now to search for the blocks is: (setq dir "I:\AutoCAD Blöcke\Template\Support")
View 9 Replies
View Related
Jul 4, 2012
like in AutoCAD there is REMEMBERFOLDERS can u tell me if i use syntax with getfiled and i want the path to be remember next time what should i do or what syntax i use for that.
View 1 Replies
View Related
Sep 18, 2013
Some of our 64-bit users lose their custom Support File Search Paths.
After reading about it, I saw that I could add them back in by putting
(setenv "ACAD" "S:\Fonts;S:\Acad2007\Hatch_Patterns;S:\Acad2007\Lisp;S:\Acad2007\Simpson\Menu;”)
at the end of acad2013.lsp.
1. However, I get malformed string on input error in AutoCAD.
2. My other question is do I need to list only the custom paths or all of the built-in paths as well?
View 1 Replies
View Related
Dec 10, 2013
Could a .lsp file work with the block editor so that double-clicking a block will make it skip straight to the editor without displaying the "Edit Block Reference" dialoge?
View 1 Replies
View Related
Aug 2, 2013
Have issues with creating an AutoCAD deployment and "The path of the added item is too long" error message?
I understand that the paths are limited to 255 characters but I tried just a local path and I get the same error.
Under Additional Files in deployment options, I want to add 2 folders under <Installation Directory> and add 2 files under Support folder.
1st folder would be ARG folder for a custom profile xxx.arg file
2nd folder would be Template with a custom template xxx.dwt file
Under Support, I want to browse and add two files: custom accaddoc.lsp and enterprise acad.cuix file.
All of those files reside on a share drive but the paths are about 40 char so I'm way below the limit.
Every time I want to add a folder under <Installation Directory> I receive the error message:
The path of the added item is too long: "Create New Folder" Please limit this path to -28 characters (currently 17).
So I copied all thos files locally but the same error show up. Is this a bug? I can't customize my deployment if those files are not available.
View 2 Replies
View Related
Sep 10, 2012
There are times that I have a really long curb polyline that has both line and arc segments. I wish to pick two points along that polyline and have it give me the distance between those two points along the path of the polyline.
Do we have this ability natively? Have I been missing something all this time? Normally I have to make a copy of the original entity, ... break, break, list erase or undo....
View 6 Replies
View Related
Aug 22, 2012
Our I.T department uses kixstart to run a batch script every morning, which is supposed to establish a network connection. The connection is 9/10 times available. 1/10 times it fails and means that workspaces and other user defined settings are inaccessible.
Bringing up the issue with I.T seams to eparch on there skills as a professional so nowadays I tend to bring it up once maybe twice but then settle for ding it my self
So what I found out is the following batch scrip/ snippet is used to establish a network
net use P: \AutoCAD_2012-08-22
I could compile a batch and then launch it using a lisp for example
(command “startapp”….
Or
(command “shell".However this would be hakky and also requires two files (the lisp and then also the bat file, rather keep it simple just the one).Is it possible to establish this connection using lisp?
View 2 Replies
View Related
May 27, 2013
I am trying to make a script for inserting a standard title block in some drawings. ( which needs to be often done for different projects). The title block is kept in the network path. How can i specify the path in the script file in order to insert the block.
-Insert,> Block name > (I need to specify the drawing in the network to get the block in it)
View 3 Replies
View Related
Jan 3, 2014
I do a lot of repetitive tasks in my daily drawings and I’d like to make life easier! I was researching how I could write a lisp to draw a walkway path for a roof. I came across a couple of interesting posts but couldn’t follow the code because of my lack of understanding the language.
So what I do is draw a 30” x 30” square (using the rectangle command). Then copy it so there is a 2” gap between them. Then I go back and hatch them with a dot hatch scaled to 96. What I’d like to do is type a command and it would draw the walkways for me and hatch them if possible. The problem is the last one is a custom cut size depending on the length of the walkway run?
Now I know I can draw a line, draw the square, hatch the square, array it on the path with set distance between items, then fix the last one so it looks the way I want it to, and then delete the line. But why do all that when I have a program that allows me to customize it to be done for me?
View 6 Replies
View Related
Jan 6, 2012
I have the following path declared for a R2007 workstation:
(setq rr (strcat "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R17.0\ACAD-5001:409\Profiles\" (getvar 'CPROFILE)))
How can I extract this path without manually declaring it?
Something like:
(VL-Get-Registry-Path-Prefix (getvar 'CPROFILE))
Which will result in the following statement:
(setq rr (strcat (VL-Get-Registry-Path-Prefix (getvar 'CPROFILE)) (getvar 'CPROFILE)))
Dyslexia is a permanent physical disability that cannot be seen.
View 2 Replies
View Related
Jul 22, 2013
I used this snip it to add the path for network tool palettes. It works but it keeps adding the same search path every time i open a new session of AutoCAD. The list keeps getting longer with the same information. Say you want to make sure your users all have a certain tool palette.
(setq tooldir "z:\1111\2222\test]" toolpaths (vlax-get-property (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'Preferences) 'Files) 'ToolPalettePath))(if (not (vl-string-search tooldir toolpaths)) (vlax-put-property (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'Preferences) 'Files) 'ToolPalettePath (strcat (vl-string-right-trim ";" toolpaths) ";" tooldir) ))(setq tooldir nil toolpaths nil)
View 3 Replies
View Related
Dec 20, 2012
I have a file path im trying to capture in a text file however its not working and autocad is prompting back,
; error bad argument type: streamp nil
Im assuming its because of the slashbacks but Im not sure..
Hence the code so far...
(defun C:GO ()(SETQ ACADLSP (findfile "acad.lsp"))(setq f (open "C: est.txt" "w"))(write-line ACADLSP f)(close f))
View 4 Replies
View Related
Jun 18, 2009
I am trying to repath our xrefs from hard paths to relative paths. for example, currently our xref paths look similar to this:
F:/208009.00/arch/floorplan and we would like to repath it to: ../arch/floorplan
I have already tried to use reference manager. it takes far too long and usually fails to work.
heres where im at. i would like to use the redir command where i put in the old path as f:/208009.00 and new path as ..
however we have hundreds fo drawings in multiple folders that need to be changed. i am looking for a way to dynamically import the path info without having to enter each path manually. i have a script to isolate the info i need per drawing, but cannot figure out how to transparently input it into the 'new path' option of the redir command.
View 3 Replies
View Related
Jul 2, 2012
I am trying to change my Xrefs from full pathing to relative pathing. If the file i am trying to xref is located at the following location
\hfg.intdepartmentsProduction"6 HA"1 StructuralFabrication EngineeringDrawing OfficePrevious ProjectsA11001
What do i put for the file path for it to be relative pathed?
View 3 Replies
View Related
Jul 12, 2012
Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high? If there is no lisp already created, how to create one?
See Continuous dimension attachment for example.
I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.
View 6 Replies
View Related
Nov 14, 2013
I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg"). how would i go about doing that using LISP?
View 2 Replies
View Related
Oct 7, 2013
Is there a way to programatically set a visual style before a drawing actually opens?
We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings. Some models will crash on some workstations when trying to open in a rendered mode.
I found a lisp with a function that looked to set viewport visual styles. But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)
View 9 Replies
View Related