AutoCAD Visual LISP / AutoLISP :: Script File To Open Multiple DWG File Not Working In 2012

Dec 22, 2011

I am trying to make a script file to open a drawing and run a lisp routine. They both work independently just fine, the script file will open the all of the files fine... and the lisp is in the startup suite and works in all the files. But when I tell the script file to open the first drawing then run the lisp it hangs trying to open the next file after running the lisp. I have Filedia set to 0, but the message I get when it goes to open the next is "No canvas exists. click New Canvas." (And on top of that... Filedia even set back to 1 still does not display the Dialog box anymore, I have to shut down AutoCAD 2012 and start again then it works.) I Have tried several ways, Opening one at a time then run lisp, and open all files first and then try to run lisp (that closes the file after running) and try and run it again in the next... It will only run the lisp one time and then locks up from there.

View 7 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Remember The File Open Once Or The Path?

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

AutoCAD Visual LISP / AutoLISP :: Multiple DWG Files With Basic Set Of Commands In Script File

Jul 19, 2013

I can run the ACC fine on multiple DWG files with a basic set of commands in the script file.  But, when I try to load an AutoLISP/Visual LISP file and run it from inside the script file, it doesn't work. How to run a LISP file using the ACC?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Lines From A File And Save To Multiple Lists?

Jul 22, 2013

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.
 
(setq layerslist (list '"0list" '"detaillist" '"clearancelist" '"clearanceelist" '"doorsdrawerslist" '"hiddenlist" '"hiddenelist" '"deletelist"))(setq count 0)(foreach thislayer layerslist (setq f (open (strcat "C:\filterlists\" thislayer ".txt") "r")) (while (/= (setq text (read-line f)) nil) (setq (read thislayer) (cond ( (= 0 count) (cons (cons 8 text) (read thislayer)))( (append (read thislayer) (list (cons 8 text))) ) );cond );setq (setq count (+ count 1)) );while (close f) );foreach
 
I've also attached one of the text files. Im doing something in the wrong order, or I have something inside the wrong set of parenthesis.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extracting Attribute Values From Multiple Dwg Files To An Excel File

May 11, 2013

how to extract the attribute value of a  particular block in multiple drawings to an excel file.

Eg... there are nearly 800 drawings where I need to list down the description and Drawing number which is mentioned in the title block name "Title". The Drawing Number and the description is done in same attribute block. extract the data into an excel file or txt file. All the drawings are saved in one location.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract All Layers In An Open Drawing To A Notepad Or Txt File?

Mar 5, 2012

How can I extract all layers in an open drawing to a notepad or txt file?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open File To Write On External Drive - Bad Argument Type

Jun 5, 2012

I'm trying to open a file to write to on my external drive, I get this message "bad argument type: stringp nil".

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Appending Txt File Including Quotation Marks And Open Closed Brackets

Jun 22, 2012

Id like to append a file with the following text...
 
(load "C:/ICT/GEBERIT/LSP/GEBERIT.LSP")
 
Quotation marks and all but how do i Handel them and the open and closed brackets using the following lisp example

 (setq f(open "C:/ICT/AutoCAD_Architecture_suite_2012/LSP/acaddoc.lsp" "A"))(write-line "(load "C:/ICT/GEBERIT/LSP/GEBERIT.LSP")" f)(close f)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Working With Multiple Attributes Within Block?

Aug 8, 2012

I know how to retrieve the entity information from the block, but can't figure out how to write the loop statement to loop, look for first attribute, assign to a variable, goto next attribute, assign to different variable, etc., etc...

In my research, most programs I've seen it execute the loop, assign to a variable, then print/put that data somewhere, loop again and utilize the same variable to print/put the next data somewhere. 

I would like each attribute within a block to be assigned a separate variable.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Each Sheet In Excel File To TXT File

Dec 4, 2012

I am trying to export each sheet in an Excel file to an separateTXT files.

I currently have code to read each cell in a sheet, but unfortunately some of the Excel sheets have in excess of 5000 cells and it is taking too long to read. So I am switching to another method.

The program will check dates of TXT files and XLS file to make sure TXT files are current (if not, open and recreate TXT files).Then read the TXT files (much faster).

Where I am getting stuck is 2 places -

Get the names of each sheet in the excel file (not always a known name)

Save each sheet as separate TXT file.

Here is condensed code so far without error checking, etc -

(defun E2TXT (FileName /)
(if (and (setq XLfile (findfile FileName)) (vl-file-systime XLfile) (setq XLapp (vlax-get-or-create-object "Excel.Application")))
(progn

[Code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File Is Not Read Only / And Permission On File Appear To Be Just Fine

Aug 20, 2013

(if (findfile MyFile)
  (setq fl (open MyFile "a"))
)

the file exists however the open function still returns nil... the file is not read only, and permission on the file appear to be just fine.What other reasons would there be that cause open function to return nil?This is happening only on one machine. All the others are writing to the file just fine.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Writing File Path To TXT File

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

AutoCAD Visual LISP / AutoLISP :: Combine All PDF File To One File

Sep 3, 2012

I have more DWG files, all dwg file convert same size (A3 SIZE) PDF file and combine one PDF file. Find script program or lisp program.

I have script program for convert dwg file to pdf file but i don't know all pdf compile one pdf file.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Writing Elevation Text In A Cad File From Text File

Jun 27, 2012

Write the elevation text in a cad file from attached text file.

In this text file Easting Northing and Elevations are given. We have hundreds of that text files.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File Not Found (CI)

Sep 21, 2012

Autocad 2008. Certain command and mouse control unable function.. which the error dialog box  shown when start up launch the autocad...

" Customization file load failed. File not found: COMMANDLINE.cui

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File Name In A List

Aug 26, 2012

I have a list like ("a.dwg" "b.dwg" "c.dwg") and an filename "b.dwg"

I want to know if the file name is a part of the list. which function must be used for this?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Corrupted LSP File

Dec 31, 2011

my LSP file. My computer is stolen and i have a backup in flash memory. I just wanna run it but i think it is corrupted. When i open it, it has codes like.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Bind JPG In Same DWG File?

Sep 24, 2012

Now i attached more logos in the drawing file. The logos all in JPG files.This all jpg files in different locations. Every time i sent file to email attach with all jpg files. Some time i forget the attach files. So i need 'how bind all jpg files in the drawing file'. Now i am working with AutoCAD 2013.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Macro In MNL File

Aug 27, 2013

I used to have a short, one-line macro in my MNL file that would read the location of the currently active drawing, find the parent directory of that drawing (truncated to 3 levels) and open a Word document in that directory that is named after the project.

For example, if the active drawing path is

"Q:/Projects/12345 Cold Storage/Elevations/Phase 1/North Storage.dwg"

this macro would open the Word document named

"12345 Cold Storage.doc"

that was in the directory

"Q:/Projects/12345 Cold Storage"

If the file did not exist, it would be created named the same as the 3rd level directory.

After i wrote this, it sure sounds like a lot, but as i remember, it was a short, one-liner. Of course if a lisp routine would be better, that's okay too. I understand beggars can't be choosy.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create TXT File

Apr 3, 2012

Looking for example of a lisp file that take the value of a variable and create a txt file on a specific place defining by the user, with 10 lines in each one of them begins with what is in the variable, followed by a text already done.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Save File As TXT?

Oct 30, 2013

I have a Lisp program that is reading information from a .txt file. The problem is, the file we get is an .edi file extension, and right now, the user has to manually change it to a .txt file for the program to run. Can I get autolisp to save the file as a .txt?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Opening DWG File

May 17, 2012

Right now I'm working on a program that will go into a directory and it's subdirectories, collect a list of all the .dwg files in those directories, then apply certain changes to all of those .dwg files. 

My problem is that none of these things works.

(command "open" (srtcat basedir (nth i file)))
(command "open" (nth i fullfile))
(vl-cmdf "open" (strcat basedir (nth i file)))
(vl-cmdf "open" (nth i fullfile))

Where "basedir" is the main directory (e.g. C:/...), file is the list of the dwg file names (e.g. mydrawing.dwg), fullfile is the list of the ull paths (e.g. C:/.../mydrawing.dwg)

I have tried using the filename with and without the .dwg extension with no luck. 

I have this code set in (while ...) so that it will go through all the files in the list "file" or "fullfile" in sequence.  The lisp will run without errors but will not open any of the files.  When I look at the command line, I see that the lisp has put open on the command line like it has executed the command, but right below that, it says "Unkown command: C:/.../mydrawing.dwg" or "Unkown command: dwg" depending on which of the above code pieces I'm using.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File Doesn't Run

Aug 28, 2013

I have an AutoLisp file that runs fine with AutoCAD Core Console 2013.  It runs fine when loaded through the standard interface of 2014.  However, it does NOT run using AutoCAD Core Console 2014.  I know there are new security features in 2014.  What has to be done to allow it to run in 2014 AutoCAD Core Console?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create VLX File

Aug 6, 2013

how can i create single " .vlx" file from my lisp and dcl files?  how to convert my lisp to vlx ?

i have to collect my all lisp into the single .lsp file and than convert to .vlx? if it is gonna be like that how about dcl file ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create New ARG File

Jul 18, 2012

How to create a new .ARG file

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Embedded Data In DWF File

Mar 18, 2012

I'm looking for a way to add custom data in dwf files. We currently create 3D models which get exported to dwf format so that we can share information with clients. Ideally, we'd like them to be able to click on any member and have the software provide additonal information about that part. Example, part number. It would be awesome if the client could then say double click that part and have the actual detailed part drawing open up.

The parts we are trying to reference are generated using a third party application, so they are not solids, but the information is easily accessible in LISP.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Data From DXF File?

Oct 6, 2011

I am trying to write a lisp file that extracts the LAYER, Z, X, Y, TEXT HEIGHT, POINT NUMBER, from the attached DXF file. Ultimately I will have the lisp insert a "POINT" at the X,Y,Z, cords, and then a "TEXT" entity at the same coordinates with the text height value and the point number string. Both entities need to be on the layer ending in  "-PN". The layer name will change depending on the date. I have a third party program that creates the DXF file.

The point of the lisp file is to insert the point numbers and points into my drawing at their correct locations. For the life of me I can not make this work. I have attached the little bit of lisp I have, which unfortunately does not work properly because of it searching for the "TEXT" entry in the DXF file of which there are three per point number. I only need one. I have also attached the DXF file I have. maybe just an overall procedure that I can then code myself? I'm just not good at getting lisp to read a file and extract what I want from it.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Browse For DWG File Selection?

Apr 15, 2012

To get the 'File Selection dialog box' in AutoCAD via LISP, which command should I use other than 'GETFILED' ?

I have a program which using GETFILED to select the drawing file , but I think this dialog box size is too small to browse folder/file , as you cant see the favorites list and you cant resize the dialog box.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot In A File Some Windows?

Jan 24, 2001

I need to plot in a file some windows from a LISP, like (command "-plot"...

The windows are defined in a list of points like (((0 0 0)(10 10 0))...) defining lower-left and upper-right corners. Each .plt file must be saved with a different name.

Is it possible from AutoLISP in 2000?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting A Block From A File?

Dec 31, 2013

I want to insert a stored block into a drawing (model space).  Below is the code I'm using and I get Runtime Error '5': Invalid procedure call or argument.

Sub Dummy()
Dim COESTD_obj As AcadBlockReference, InsPtStd(0 To 2) As Long, COESTD As String
COESTD = "C:JimHYDROCAD_DwgsBlocksZ_COE_STDS.dwg"
InsPtStd(0) = 0#: InsPtStd(1) = 0#: InsPtStd(2) = 0# 'Set insertion point as 0,0,0
Set COESTD_obj = ThisDrawing.ModelSpace.InsertBlock(InsPtStd, COESTD, 1#, 1#, 1#, 0#)
End Sub

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Deleting Script File

May 21, 2010

I have a lisp routine that creates a script file and then it runs the script file. After the script has finished running, I want to delete the script file from autocad, but for some reason it doesn't delete.

I've tried using (vl-file-delete path).

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved