AutoCAD Visual LISP / AutoLISP :: Set Of Routines With DCL Files
Aug 8, 2012
I have writted a set of lisp routines with dcl files that I have implemented in most versions of Autocad since release 14. I can install the toolbars in Autocad 2013 but when I try to execute on of the commands, either by toolbar icon or command line, I get the message "Unknown Command".
I have a routine I wrote years ago for R12 and it worked fine. Now when I try it in 2000 it freezes Acad when I select the first button. The routine is for structural steel members and the idea is to select a country of origin which brings up a list, then select a section type from the list which brings up another list of all available sizes. You then select the size member you want then insert it into the drawing. There is also an option to explode the block on insertion. If I remove the (set_lista) section from the following line it doesn't freeze.
(action_tile "AUS" "(setq sectype AA)(setq Country 1)(set_lista)")
(set_lista) is a selection of lists, the list to use is determined by the variable "sectype".
I can select the country I want then cancel the dialog box and type (set_lista) at the command line then reopen the dialog box and the list is refreshed. Just won't do it automatically.
I've gotten these two routines from different threads on here. One works with *text and blocks. The second works with multileaders.
I'd like to merge the two so one command can work with a selection set of any of the above objects (assume selection set of mixed objects - some multileaders, some text, some blocks)
(defun c:at ( / ss ang *error*)(vl-load-com)(ErrorHandler '("cmdecho" "osmode"))(setvar "cmdecho" 0)(setvar "osmode" 576)(setqss (ssget '((0 . "*TEXT,INSERT")))ang (getangle " Select two points along desired alignment:"))(mapcar'(lambda (x)(vla-put-rotation(vlax-ename->vla-object x)ang))(mapcar 'cadr (ssnamex ss)))(*error* nil))(defun c:test (/ ss ang i sset)(vl-load-com); Tharwat 17. 05. 2011 (if (and (setq ss (ssget ":L" '((0 . "MULTILEADER")))) (setq ang (getangle " Specify Rotation Angle :"))) (repeat(setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (vla-put-TextRotation (vlax-ename->vla-object sset) ang)) (princ)) (princ))
I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines. I have the 3 lisps working independantly but can't figure out how to get them to all run in one script.
Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks. The last lisp locks all viewports in all windows. I'll attach the 3 lisps I'm trying to merge in the script. I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...
Here is what I have for the script file contents (which doesn't work):
We are working together whit another firm and we would like to share our tool pallets and lisp routines. The pallets and lisp files we would like to share are quite large so we would like to simply send them a USB stick whit all the files and a title "executable" program that automatically puts them on the right place and changes the appropriate information.
I am running autocad 2011 for mac to design sails. I was given a autolisp file that will automate the majority of the process, but it uses a .dcl file to input all the numbers. Unfortunately .dcl files are not support with the Mac version and therefore I am looking for any solutions.
- Is there another way to input the information and therefore link the lsp file to something different? - Is it easy to re-write the lisp file and input directly into that?
At the moment the time I am wasting researching how to make the .lsp program work, I could have hand drawn most of the sails anyway!
I have an mdb database, with one table called MATRIX. That table has seven relevant fields, see attachment. What I want to have is for every language an txt file.
I have some legacy custom .DCL files that we want to convert the user interfaces (text boxes, labels, etc) to Chinese characters. Is that even possible in .DCL?
I have gotten our NET and VBA apps converted but not having much luck with the DCL files.
i am wondering if it is possible to alter a specific attribute in cca 250 files? I have this template which has like 50-70 attributes,but not all of them are used. I have to change only one attribute in all of the files. For instance, i have an attribute with a specisfic tag, but the content of it is ie MARK, i want to change MARK to PETER, without having to open,click,retype,save,close every file. Is it possible to automatize it somehow? maybe lisp, batch or even VB?
I have a lisp routine that gathers all xrefs from the current drawing and creates a script that opens each xref, runs specific commands then saves/closes each drawing. Once all commands have been ran in each xref I would like the script to reload all xrefs in the original drawing that the script was called from. I have a reload-all lisp that is already loaded in all of my drawings but for some reason when this command is called at the end of the script it will not run.
Is there a way to have the script continue to run in the original drawing that it was called from? Or maybe even pass control back to the lisp that created/called the script? Its seems to me that the easiest thing would be to have the script continue to run after it has gone through all of the specified drawings but this is not working.
As you can see, if i rename this to "acad.lsp" and put it in the network search path of AutoCAD users, it will update several settings in their Options > Files. WHAT A TIME SAVER THIS HAS BEEN!
What i want to do now is to set the "Default Template File Name for QNEW" but i don't know how to complete this line:
I am using autocad 2013 and importing PDFs into the drawing and recently the OSnap points within the pdf are missing. The PDFs are of floorplans and I was able to measure from wall to wall using endpoints and midpoints. Now I am only able to select the endpoints on the frame of the pdf.
Is there a switch that might have been turned off?
Is there any way for me to choose a bunch of .dsd files, and have those be batch plotted?At the moment I have to publish one .dsd file at a time, and each .dsd file can take about 10 minutes to go through all the layouts I have.
Does Autocad have that capability built in? Or is this a problem that can be solved with scripts?
Just recently I have noticed a Major problem occurring with Xdata. My programs that i use XDATA storage in work fine until you save the drawing. When you call the file back up the Xdata is gone the only thing in the xdata is NameSpace value. Is this related somehow to a Windows update?
I downloaded a Copy of AutoCAD Recent Documents Manager.exe from the autodesk website and it won't run on any of the computers in our system. I was thinking about writing a LISP routine to delete the filenames with a DST suffix by replacing them with the next filename in the list. My question is If I replace the file with the next one above and the filetime,filepinned and class respectively. When I reach the end of the list can I just use "" for the file,filetime and class and integer 0 for filepinned (it looks like it requires a double).
Is it possible to write an AutoLISP script to read an .xlsx file and use the data in the various cells to modify a block within a .dwg?
Ex.: We use Flow Control Modules (FCMs) and use AutoCAD Electrical to show electrical contractors where/how to wire up the devices. In AutoCAD, we have blocks for various types of FCMs, and each block has terminals which are tagged DESCA1, DESCA2, DESCA3, etc. Each of these tags will change based on what the particular FCM is used for.
We also have .xls(x) files we call FCM Maps, which come from our engineers and tell the drafters how to lay out the .dwg files.
Is it possible to write a LISP script to take, say, cell A1 from the .xlsx file, and put that data into DESCA2 in the block, cell A2 into DESCA3, and so on?
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.
Retrieving a list of Workspaces from menu files .cui and .cuix
The function to use is (workspacelist) which returns a list of workspace names, similar to (layoutlist) for retrieving a list of Layout names.
The functionality for extracting "WorkspaceRoot.cui" from .cuix requires copying the .cuix to .zip so that it can be accessed as a Windows compressed (zipped) folder which the Windows object "Shell.Application" provides.
Please rename the attachment to .lsp
I received the following error when I tried to post the .lsp: "The contents of the attachment doesn't match its file type."
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?