AutoCAD Visual LISP / AutoLISP :: List Of Drawings From One Drawing To Next
Dec 5, 2012
I have the following string of code, that I'll write in everyone's start-up suite. I'm able to retrieve a list of files I want to modify, for whatever reason. (One example, when plotting drawings with layouts, sometimes the shadeplot setting is wireframe, and not classic hidden, though it's been set up in our templates).
The huge question is, can I get a list of drawings to a variable in one drawing, and have access to that variable list, in the next drawing I open? I'll iron out the bugs on read-only statuses, or manipulating drawing states later.
QT : 1 . I am looking for a script to move the drawing such that the left bottom corner is placed at 0,0 without any manual intervension. This is to done for all the files in a particular folder.
QT : 2 In the same script file I want one block to be inserted also in each drawing. the block is placed in the network drive . so how to copy the path after putting the insert command. I tried -insert; but it is not working how can i give the path in script file.
I have the need to make the current open dwg (name) equal to its predefined number in a large list. For example, building66.dwg is equal to 123789. I’ll have a large list in a tab delimited txt file with the example below. I can put the list in the lsp file if needed. Something like (if (getvar "dwgname") make equal to listname) and go out to the list and return its number. Seems kind of easy but I can’t make it happen.
(layoutlist) ... returns a list of strings of the layout tabs in the drawing.I've used this ages... Isn't it a core lisp function, or is it coming from express tools or somewhere else?
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)
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?
I have to go into approx 600 3D Models and rotate them all by 90.
I've just tried to search for a lisp that will do this to all of these files in one directory and can't find one. Something that will do this and save loads of time. I need to do this tonight so that these MEP files will all be ready for tomorrow morning.
This probably isn't the correct discussion group but not sure where else to post this.
My sales department wants to be able to create drawings based on entries in selected in their Excel qouting tool. Basically, they want to configure a product in the field, and be able to show the customer the drawing with TrueView. (They don't have AutoCAD installed).
I would think the best I can do, is manipulate a .dxf file based on their selections but that may get very complicated.
Any way to insert a block onto many different drawings quickly? I have a title block I need to insert into about 100 drawings. It seems very tedious to open each drawing and insert 100 times.
I searched the groups and the closest discussion I could find was here but there didn't seem to be a clear cut solution. [URL]. I have a jpg file that I needed to apply some transparency to and saved it as a png file. I now want to delete the jpg file from the folder but it's being referenced in several drawings, and I don't know which ones. Is there a way to reverse the function of Reference Manager (perhaps with a different app), ie find all the drawing files that reference my jpg file?
Intel i7 3.33Ghz, 16Gb RAM Nvidia Quadro 2000D C3D 2012 SP4, holding off on C3D 2014 Win 7-64
When I run the command and write the scale, I need to change the name of the scale and the ratio automatically. The ratio should always be in the format "1: #", also the name of the scale. Maybe assigning more variables with "setq", I do not know.
(defun c:test ()(setvar "cmdecho" 0)(setq name (getint " Type the scale you need:"))(setq ratio (strcat "1:" "0.1"))(command "-SCALELISTEDIT" "Add" name ratio "Exit")(setvar "cmdecho" 1)(princ))
Here's one that I could use on that i can't figure out:
I have a list of a bunch of descriptions that looks like this:
("00.02.00" "CTD01 Mainframe PT1 (top)" "GD01")
What I am doing is grabbing the middle item and i need to break this up into 2 lines. So, my code below grabs the first 3 "words" in the second item in the list and puts them in a list, but I need to convert this back to a string.
Any lisp routine on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?
There are several instances where we would need to take a project to create another one and simply change the title block description.
As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.
These are not attributes, but fields. I've researched alot on here and couldnt find anything.
i am working on writing a lisp to update several similar drawings through a .bat file. One of the things i would like to do is to automatically increase the revision number by one. I have figured out everything except how to select the text. Looking at the database, the coordinates for the revision number are (10 15.2908 0.0295 0.0). However, (setq a (ssget "x" '((0 . "TEXT,MTEXT")(10 15.2908 0.0295 0.0)))) returns nil.
If each drawing's revision number is not in the exact same location, is it possible to select by a range of coordinates? Using (getpoint), the range is from (15.5 0.0 0.0) to (15.1805 0.1409 0.0).
I have a csv file that has the drawing names and their layout names listed in columns A and B. Before I begin a project, I have to create the Sheet List (in Excel) and the csv file. The csv file is needed because I have a lisp routine that reads the csv and updates all my Title Block attributes in all my drawings. (VERY sweet program) What I'm wanting to do, is create new layouts (using my dwt) based on the information in the csv file. So, when I start a new project all I need to do is create the base drawing files first. Then, in my csv file I've got those drawing names listed in Column A and their corresponding sheet titles (Layout names) in Column B. I run the lisp and it reads the csv and creates layouts in all those base drawings and naming the layouts with the sheet titles from column B.
Column A Column B DRAWINGS SHEET TITLES drawing1.dwg A100 drawing1.dwg A101 drawing"n".dwg "n"500 Etc, etc.
I'm needing a way to automate creating hundreds of layouts at once. (very time consuming).So the lisp has to be able to read a csv (or Excel--doesn't really matter) and create new layouts (using my dwt) in as many drawing files represented in column A. [and filtered so it doesn't create duplicates so I can run the routine at a later date when new sheets are added to the drawings] Captcha?
Here is the code snippet from my program, I am trying to build a associative list from two regular lists in the while loop. Does ""append " or "cons" only work for simple lists? Given attributeNameList attributeValTypeList which are always of the same length
I've created a list and want to subtract all the values within it from another variable, and assign it to a new variable. How do I do it?
Basically, I ask for ground level (assigned to variable G1), and then any number of depths beneath that (assign to list LVLLIST), and I want to return the value of the bottom point. So it's all the values in LVLLIST added together and subtracted from G1. And assign it to a new variable BASE.
In the example given I have two instances to show how unique the information can be.
I would like the left column of words to be some type of drop down or list so that the user does not have to type these for each line. I don't care if it's attribute, text, mtext, just whatever gets it done.
I want to list all of loaded lisp programs in AutoCAD (both .lsp and .fas) It's easy for .ARX files: (vlax-safearray->list (vlax-variant-value (vlax-invoke-method (vlax-get-acad-object) 'listarx)))
I'm looking for a lisp routine that will globally list all the values from a specific attribute tag within a specific block. The attribute tag is "COMMENT" and the block name is "FSD".