Search the Community
Showing results for tags 'auotlisp'.
-
(setq cdate_val (rtos (getvar "CDATE") 2 6)) (setq YYYY (substr cdate_val 1 4) M (substr cdate_val 5 2) D (substr cdate_val 7 2) ) (setq dateFolderName (strcat D "-" M "-" YYYY)) (setq subfolderName (strcat (rtos x 2 2) "-" modtext)) (setq nestedFolderPath (strcat (getvar "DWGPREFIX") "\\" dateFolderName "\\" subfolderName)) (princ (strcat "\nNested Folder Path: " nestedFolderPath)) (if (not (vl-file-directory-p nestedFolderPath)) ; Use vl-file-directory-p for checking directories (progn (if (vl-mkdir nestedFolderPath) (prompt (strcat "\nCreated folder: " nestedFolderPath)) (prompt (strcat "\nFailed to create folder: " nestedFolderPath)) ) ) (prompt (strcat "\nFolder already exists: " nestedFolderPath)) ) (setq saveFileName (strcat nestedFolderPath "\\" (vl-filename-base (getvar "DWGNAME")) ".dxf")) (princ (strcat "\nSave File Path: " saveFileName)) (if (not(vl-file-copy (getvar "DWGNAME") saveFileName)) (prompt (strcat "\nError: Unable to save the processed drawing as DXF.")) (prompt (strcat "\nProcessed drawing saved to: " saveFileName)) ) (princ) Why this code did not work..?
-
Gather information in one drawing and create the table in a seperate drawing
mwohlford posted a topic in AutoLISP, Visual LISP & DCL
I wrote a lisp program that creates an equipment list from part numbers in selected blocks and a csv file with information about those part numbers. It allows the user to then select a layout followed by an insertion point, then creates the table a populates it with the list. On a small project were 4 or 5 sheets are all that is needed the sheets are in the same drawing file and this works great. However, on larger projects the sheet that the equipment list needs to go on is not in the same drawing file. Is there a way to select a layout in another file for the table to be created and inserted on? I know I could save the list to a global variable, open the drawing with the sheet to insert on and create the table from there. I would like to not have to ask the user to go through the extra steps. Is it possible to maybe use getfiled to open a drawing to the specified sheet then create the table? Any guidance would be helpful whether with getfiled or some other method that I could work into my code.