AutoCAD Civil 3D :: Lisp Routine To Read From Directory Which Has Multiple Folders?
Jul 10, 2012
Having trouble with my lisp routine to read from a directory which includes several folders. There is no problem when the files are all mixed in the directory but when dealing with hundreds of files, it makes sense to organize files by types.
Using (ade_aliasadd "BASE" "S:\") and there is no problems when the files are actually there and not in a subfolder called APN_DWG or EAS_DWG. Should I be setting up the environment differently and if so how?
I'm looking for a way to make a LISP routine that will create multiple dimstyles.I'm having difficulties creating annotative dimstyles.I would like to use the variable 'dimanno'. However, 'dimanno' is 'read only'.
How should/could I go about creating a LISP routine that will create annotative dimstyles.
Is there a way to have a Lisp Routine open multiple script files?
I have 10 types of scripts, that are specific to the type of file they open (as shown below). which simply open a file, purge/audit, save and close.
open "Q:PROJECTS321700Field ManagementCoordinationElectricalSleeving613321700_ES-613-Lev01.dwg"audit y-purge all * n-purge R * naudit yqsavecloseopen "Q:PROJECTS321700Field ManagementCoordinationElectricalSleeving613321700_ES-613-Lev02.dwg"audit y-purge all * n-purge R * naudit yqsaveclose The file above was named ES-613.
I would like to create a Lisp Routine that opens this script, *Some how closes the file*, and then opens another script.
Any LISP routine that can create multiple paper space layout tabs and can name them incrementally. I have a template and I wanted to copy tab2 of my layout multiple times and name them incrementally. I have a code shown below that comes close to what I need it to do but it creates a "New Layout" instead of copying the tab I need it to. Please see code below:
(vl-load-com)(defun c:LAYOUT+ (/ *error* prefix i n acDoc oLayouts layoutName) (defun *error* (msg) (if acDoc (vla-endundomark acDoc) ) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat " ** Error: " msg " ** "))) ; Fatal error, display it ) (princ) ) (if (and (setq prefix (getstring " Enter layout name prefix: "))
Any lisp routine that will remove "phantom parcels" in a drawing? They are the parcels many topics on this discussion forum have topics on, that can be selected but can't be deleted by any simple means.
The drawing is relatively new...with minimal objects in it. Just some Feature Lines and 3D Polylines. I have Sites in my drawing...but no parcels. Only thing in the sites are the feature lines. When I do a Q SELECT for the parcels it selects and highlights my feature lines, which is weird.
I'm trying to make a LISP routine that will match point style, label style, marker rotation, label rotation and layer for a selected point to multiple other points. I don't know what the exact variable names are or how to find them.
See the post below for code that is similar too what I'm looking for.
Any program or routine in lisp or net that can select a group of 3d polylines in the form of a tin and convert them all to 3d faces?
I know that I can take the 3d polylines and explode them to 3d lines. Then I can use map clean to delete the duplicate lines. Then I can create a C3D surface using the 3d lines. Then I can extract 3d faces from the surface.
i've been trying to write a lisp shortcut for drawing cleanup but it keeps asking me for a profile name to load and i cant figure out how to add my .DPF file to my routine.
I have to update a block in literally thousands of cad files. I have the book "AutoCAD Secrets Every User Should Know About" and the author gives examples of this by using a Batch File, Script File, and then Lisp Routine. Any easier way to do the following:
Insert "Gennnotes=" (updating the block) into any drawing that has this block in the drawing already, if not Quit.
Typically to do this I would open the drawing "insert" "gennotes=", then cancel the command and save the drawing. I have a lot of subfolders that also hold drawings so the command would have to search through each subfolder for dwgs.
Like I mentioned above, I tried to use the Batch File/Script Method but my batch file failed. It could find the folder Autocad 2012 - English. For some reason it was not seeing the spaces in between. Not sure. Here's the batch file portion of the routine:
Batch file:
For /r C:Sybex %%f in (c:sybex*.dwg) do start /wait C:ACAD2012Autocad 2012 - Englishacad.exe "%%f" /b C:gennotesupdate.scr
I am doing bulk earthworks with C3D 2013 and quite often I am modeling large dam walls with multiple raises, core sections, filter layers, etc so I end up with up to 50 surface models in one drawing. The process I follow involves modeling each raise of the wall by targeting an elevation 10 metres or so below NSL. I then use a volume surface to give me the intersecting boundary between the topography surface and the wall raise surface. I repeat this process for each raise/core/filter section - create volume surface to find intersection, extract boundary of intersecting volume surface, add boundary to wall raise surface, put both on a unique layer calculate volume - repeat for next wall raise - ad nauseum.
To speed things up a previous draftsperson created a shortcut button on the ribbon that does the volume surface trick with one click so all i need to do is hit the button, select topo, select wall raise and it gives me the volume surface between the two, all i need to do is extract the border and add it as an outer boundary to the wall raise. I would like to take this to the next level if possible and this is where I an stuck.
If my drawing consisted of a topography surface and "X" number of wall raise surfaces all named in a uniform fashion ascending numerically or alphabetically would it be possible to write a routine/shortcut button that did the following;
1.) Create a volume surface between topo & wall surface 1 - extract border as polyline - add polyline as outer boundary to wall surface 1 - move both wall surface 1 and newly created boundary polyline to unique layer.
2.) Repeat process for topo and wall surface 2
3.) Repeat process for topo and wall surface 3
.....and so on until all wall surfaces have had volume surfaces created between them and the topo?
I am writing a program to grab a bunch of layers from a list, check a drawing to see if the layers are on the list, and if not save to an external file. I have the second part of the program done, but I can't get the first part to work.
I am trying to open a file read the contents and save it to a list.
Here is the code I have so far, but it doesn't even get into the foreach statement.
Having trouble plotting a dwg file when it is deeper than 5 folders in a directory. I was given instructions a few years ago on how to correct this, but unfortunately lost/forgot them. We just upgraded to ACAD Mechanical 2012, and I need to modify this setting again...it was something simple, I just can't remember.
I am running Civil3D 2011 on Windows 64 machine and am wondering how I go about setting up multiple working folders when using data shortcuts. I have two different projects I am working on, for which I set up surface data shortcuts, but the 2nd one I set up over-wrote the 1st folder and so now that surface is not properly shortcutted into that project. how to set this up, for I am new to the whole shortcutting game?
Civil 3D 2013 SP2 | Win 7 64-bit SP1 Intel Core i5-2500 @ 3.30GHz, 8GB Ram | ATI Radeon HD 5450
I would like to know how to write a routine to thaw all layers in current drawing and multiple xrefs; then freeze all, then thaw only certain layers globally for a drawing that is open. Such as a dimension plan will thaw only *-BLDG, *-DIMS, *-RD-*, *BNDRY.
I would like to create one that will fit every project which has a different xref name.
I need an offset lisp routine to offset a selected line a set distance on each side of the selected line and change the layer of the offset lines to the current layer, and then keep prompting me to select the next line for offsetting until I'm finished.
I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.
I'm writing my first VBA apps in Corel Draw X5. I want to modify the standard FileCOnverter .GMS file that came with X5. Every time I try and save changes I'm advised that the file is Read Only. I've also copied the original .GMS file, but I get the same error messages on the new file.
Next I tried to create a new .GMS file by creating a .TXT file and renaming the extension to a .GMS folder (as all of the user guides explain to do). Once again the VBA editer will not allow me to make changes within the file, although it did allow me to create a Macro.
I'm also interested if I can have the .GMS files in a directory other than the Corel Draw GMS directory. It is bad programming practice to save data files in a Program File directory.
I put mleader into a LISP routine and it is doing the text attached to it only in the command line instead of in the drawing is ther a way to put mleader into a LISP routine and have it do the same as when you just type in mleader?
We are moving from AutoCAD Map 3d ver 10 to ver 11. There's a lisp routine I use all the time and it doesn't seem to want to work in the newer version 11. this routine is supposed to fill but like I said doesn't work in ver. 11.
We have just finished modelling hundreds of pits/manholes in 3d, to import into 12d as required by our current project.
After importing into 12d we have realised that all the faces are back to front as the dark edges are facing outwards, and the light edges are facing inwards on the pits.
Is there a way to globally flip, or perhaps a lisp routine to flip all the faces?
Say you launch AutoCAD, then run VLIDE.Then from inside the VLIDE, you go File>Open.....it seems to default to a different, random directory every time. I know there has to be some logic to it, and I want to set the default location, so I do not have to browse every time.
Years ago, I seem to remember how to set this starting directory, I just can't find that now.
Is there a way to sent print to a selected printer by choosing multiple dwg files thru Folder directory without opening autocad? For example if I want to print 12.dwg, 13.dwg, 14.dwg and 15.dwg by just choosing these dwg files on my directory.
Basically, the routine asks for the user to choose the hatch type (Retirer/Percer), then the layer (Defpoints/Select/Current) and finaly the type of the object to draw (Polyline/Rectangle). My original routine has also a Circle and a Boundary options, and an Error trap to reset the variables but I will keep it simple for the purpose of my issue.
So, my issue is: when I choose the type of object to draw, it draws just one of it and the routine ends. I would like to have something that "says" to the routine that I want to keep drawing that object (Polyline or Rectangle) and putting the hacth inside until I do enter and then the routine goes to its end.