Jump to content

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Hi everyone, I need to modify some options in the "Automatic Publish" submenu through a lisp or if not possible through a script, in detail I should modify the "Type" section from the "Multi-sheet" file to "Single-sheet file" and vice versa does anyone know if it's possible? Many thanks in advance
  2. Good afternoon, One of our vendors has sent us several shp files with lines/polylines and ones with points. All the data comes in on a single layer, but I would like to sort the data with a LISP based on existing layers I've created and some of the Object data. Below is an example of the OD I want to use, and the layers I would like to have the objects sorted into. Could anyone help with some code that I could use to sort these objects? The OD table name will change depending on the file we receive, if that matters. Thanks
  3. Hi, I looking for some guidance on creating a script that will allow me to plot selected layouts to a specified folder location. I have tried the below, but it will only plot to the same location as where the drawing is stored. I can't seem to find where I enter the folder location below. I have attached my script, I can't use a Lisp command as I am only using an LT version of the software. plot Y DWG to PDF.pc3 ISO full bleed A3 (297.00 x 420.00 MM) Landscape No Layout FIT Ortho ON -Osnap app,ext,mid,int,cen,qua,tan,per,end,par,ins,node,nea, Viewres Y 20000 Zoom e Regenall 2.F_(Rev_C01).scr
  4. Dear team , I used etransmit command >add file than bind xref option, but not bind in current drawing. Is any tools or lisp, VBA macro for add multiple xref and bind together in current file and save as a zip file.? Note :, Xref not attached in current drawing. I need to attach multiple and bind together in current drawing. Thanks
  5. to this...I have so many data and need to make this type of drawing can anyone suggest lisp or script to make the drawing possible easily...POP to POP will get connected by different GP. Thanks in advance
  6. Hi, I am have a database containing object information. I am able to write out a script from my database that inserts blocks into Autocad C3D. Here is an example of the script file: osmode 0 -layer Set "2020_DESIGN" ATTREQ 1 ATTDIA 0 -insert "DESIGN" 607476.547,7574318.945,0 1 1 0 GAS GR04L001 10354 Is there a way that I can also insert Object Data (into a data table) using this script when creating the block? I have attached an image showing the structure of the data table that I would like to populate. Thanks in advance Lee
  7. ;; [INSERT INCEPTION SOUND EFFECTS HERE] ;; Preface: I've built a lisp routine that generates a script. The script then runs a SECOND lisp routine on a series of drawings. ;; I'm having serious trouble passing information from the first lisp routine to the second lisp routine. ;; The first lisp routine uses a DCL dialog box to gather user information, and the second lisp routine needs to apply this information to each drawing in a set. ;; I have assembled the information into a list of strings, which I'd like to pass as an argument into the second lisp (unless there's an easier way someone can share with me). ;; To do this, I've created the _StringifyList function, which creates a new list declaration string that gets written to the script file. ;; So here's the problem: ;; The strings in the arguments may contain quotes or backslashes since they are user entered. ;; The vl-string-translate commands I've added aren't properly appending extra backslash escape characters to make up for this. ;; Try running this example: (defun C:ListTest ( / *error* simpleList simpleListString) ;Return error descriptions to command line in the event of an error (defun *error* (/) (princ "\nInternal error") ) ;test strings are A,B,C ;to create a list: (setq simpleList (list "A" "B" "C")) (princ "simpleList: ") (princ simpleList) (princ "\n") ;result is not what we need: ;simpleList: (A B C) ;now lets wrap it with the stringify function: (setq simpleListString (_StringifyList simpleList)) (princ (strcat "simpleListString: " simpleListString "\n")) ;result is good, it can be written to a script as an argument now: ;simpleListString: (list "A" "B" "C") ;how about something more complicated though? ;test strings are one"quote, this\that, three"""quotes ;to create a list: (setq complexList (list "one\"quote" "this\\that" "three\"\"\"quotes")) (setq complexListString (_StringifyList complexList)) (princ (strcat "complexListString: " complexListString "\n")) ;result is bad. quotes have been replaced with backslashes, and backslashes haven't been duplicated. ;complexListString: (list "one\quote" "this\that" "three\\\quotes") ;what the result should look like (I think): ;complexListString: (list "one\"quote" "this\\that" "three\"\"\"quotes") (princ) ) ;; _StringifyList - plackowski ;; takes a list of strings and converts them to a declaration of a list of strings. ;; lst - [lst] A list of strings, like ("A" "B" "C") ;; str - [str] Output string in the format "(list "A" "B" "C")" (defun _StringifyList (lst / str) (setq str "(list") (foreach item lst ;any backslashes should be replaced with double slashes: \ -> \\ (setq item (vl-string-translate "\\" "\\\\" item)) ;any quotes in the string should be replaced with slash quotes to escape them: \" -> \\\" (setq item (vl-string-translate "\\\"" "\\\\\\\"" item)) (setq str (strcat str " \"" item "\"")) ) (setq str (strcat str ")")) )
  8. I am new to script so this is basically my first script file: Don't know why but my script only run about 4 line in and then no more output in the text window is observed. Curiously if I reorder some of the line in the scr I get only 1 line being run. The (command) is not as intended as enter/space but rather as Cancel. And this script is trying to find out which are read-only; I want the print out for each variable of whether it accept value or is read-only as though it's done manually with the Setvar Command. So I'm not trying to change any variable. I thought of using (setvar) and see which output error but I am assuming that I don't know what value are appropriate to pass for each variable so I could have just passed an invalid value to a non-read-only variable and that would throw the same error as a read-only one. So I want the script to behave like the below (manually typed) history, going thru each variable. Command: SETVAR Enter variable name or [?]: _server _SERVER = 0 (read only) Command: *Cancel* Command: SETVAR Enter variable name or [?] <_SERVER>: *_AUTHORPALETTEPATH Enter new value for *_AUTHORPALETTEPATH <"C:\Users\L\AppData\Roaming\Autodesk\AutoCAD 2020\R23.1\enu\S...">: *Cancel* Command: SETVAR Enter variable name or [?] <*_AUTHORPALETTEPATH>: HQGEOM Unknown variable name. Type SETVAR ? for a list of variables. Command: *Cancel* Command: SETVAR Enter variable name or [?] <*_AUTHORPALETTEPATH>: 2DRETAINMODE Enter new value for 2DRETAINMODE <1>: *Cancel* Command: SETVAR Enter variable name or [?] <2DRETAINMODE>: 2DRETAINMODELEVEL Enter new value for 2DRETAINMODELEVEL <0>: *Cancel* But this is what running my script produces, stopping after parsing the 4th line in the script file. So I'm wondering why doesn't it continue in the same pattern? If you move 2dretainmode to the first line in the script it actually only finish only the first line while ordering the scr another way get a few more like the one below, but all seems to just stop abruptly. Note that I don't want to change any variable with this script, nor have I even tried to confirm the variables as I am intending to cancel the setvar command each time. Command: setvar Enter variable name or [?]: "_SERVER" _SERVER = 0 (read only) Command: (command) Command: nil Command: setvar Enter variable name or [?] <_SERVER>: "*_AUTHORPALETTEPATH" Enter new value for *_AUTHORPALETTEPATH <"C:\Users\L\AppData\Roaming\Autodesk\AutoCAD 2020\R23.1\enu\S...">: (command) Command: nil Command: setvar Enter variable name or [?] <*_AUTHORPALETTEPATH>: "HQGEOM" Unknown variable name. Type SETVAR ? for a list of variables. Command: (command) Command: nil Command: setvar Enter variable name or [?] <*_AUTHORPALETTEPATH>: "2DRETAINMODE" Enter new value for 2DRETAINMODE <1>: (command) Command: nil setvar.scr
  9. Jord_91

    Make boundary

    Hey guy's I've got this lisp that is working pretty well with an end user but when I try to add it to a script it saids that it's an Unknown command... is there something in it that is wrong? (defun lib:Zoom2Lst( vlist / bl tr Lst OS) (setq Lst (lib:pt_extents vlist) bl (car Lst) tr (cadr Lst)) (if (not (and (lib:IsPtInView bl) (lib:IsPtInView tr))) (progn (setq OS (getvar "OSMODE"))(setvar "OSMODE" 0) (command "_.Zoom" "_Window" (trans bl 0 1)(trans tr 0 1) "_.Zoom" "0.95x") (setvar "OSMODE" OS) T) NIL)) ;External contour of objects (defun C:MakeBoundary ( / *error* blk obj MinPt MaxPt hiden pt pl unnamed_block isRus tmp_blk adoc blks lays lay oname sel csp loc sc ec ret DS osm iNSpT) (defun *error* (msg)(princ msg)(mapcar '(lambda (x) (vla-put-Visible x :vlax-true)) hiden) (vla-endundomark adoc)(if (and tmp_blk (not (vlax-erased-p tmp_blk))(vlax-write-enabled-p tmp_blk) ) (vla-Erase tmp_blk))(if osm (setvar "OSMODE" osm))(foreach x loc (vla-put-lock x :vlax-true))) (vl-load-com)(setvar "CMDECHO" 0)(setq osm (getvar "OSMODE")) (if (zerop (getvar "WORLDUCS"))(progn(vl-cmdf "_.UCS" "")(vl-cmdf "_.Plan" ""))) (setq isRus (= (getvar "SysCodePage") "ANSI_1251")) (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object)) blks (vla-get-blocks adoc) lays (vla-get-layers adoc)) (vla-startundomark adoc)(if isRus (princ "\n???????? ??????? ??? ?????????? ???????")(princ "\nSelect objects for making a contour")) (vlax-for lay lays (if (= (vla-get-lock lay) :vlax-true) (progn (vla-put-lock lay :vlax-false) (setq loc (cons lay loc)))) ) (if (setq sel (ssget))(progn (setq sel (ssnamex sel)) ;;; (setq iNSpT(apply 'mapcar (cons 'min ;;; (mapcar 'cadr (apply 'append (mapcar '(lambda(x)(vl-remove-if-not 'listp x)) sel)))))) (setq iNSpT '(0 0 0)) (setq sel (mapcar 'vlax-ename->vla-object(vl-remove-if 'listp (mapcar 'cadr sel)))) (setq csp (vla-objectidtoobject adoc (vla-get-ownerid (car sel)))) ; (setq unnamed_block (vla-add (vla-get-blocks adoc)(vlax-3d-point '(0. 0. 0.)) "*U")) (setq unnamed_block (vla-add (vla-get-blocks adoc)(vlax-3d-point inspt) "*U")) (foreach x sel (setq oname (strcase (vla-get-objectname x))) (cond ((member oname '("ACDBVIEWPORT" "ACDBATTRIBUTEDEFINITION" "ACDBMTEXT" "ACDBTEXT")) nil) ((= oname "ACDBBLOCKREFERENCE") (vla-InsertBlock unnamed_block (vla-get-insertionpoint x)(vla-get-name x) (vla-get-xscalefactor x)(vla-get-yscalefactor x) (vla-get-zscalefactor x)(vla-get-rotation x)) (setq blk (cons x blk))) (t (setq obj (cons x obj)))));_foreach (setq lay (vla-item lays (getvar "CLAYER"))) (if (= (vla-get-lock lay) :vlax-true)(progn (vla-put-lock lay :vlax-false) (setq loc (cons lay loc)))) (if obj (progn (vla-copyobjects (vla-get-activedocument (vlax-get-acad-object)) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbobject (cons 0 (1- (length obj)))) obj)) unnamed_block))) (setq obj (append obj blk)) (if obj (progn ;(setq tmp_blk (vla-insertblock csp (vlax-3d-point '(0. 0. 0.))(vla-get-name unnamed_block) 1.0 1.0 1.0 0.0)) (setq tmp_blk (vla-insertblock csp (vlax-3d-point inspt)(vla-get-name unnamed_block) 1.0 1.0 1.0 0.0)) (vla-GetBoundingBox tmp_blk 'MinPt 'MaxPt) ;_??????? ????? (setq MinPt (vlax-safearray->list MinPt) MaxPt (vlax-safearray->list MaxPt) DS (max (distance MinPt (list (car MinPt)(cadr MaxPt))) (distance MinPt (list (car MaxPt)(cadr MinPt)))) DS (* 0.2 DS) ;1/5 DS (max DS 10) MinPt (mapcar '- MinPt (list DS DS)) MaxPt (mapcar '+ MaxPt (list DS DS))) (lib:Zoom2Lst (list MinPt MaxPt))(setq sset (ssget "_C" MinPt MaxPt)) (if sset (progn (setvar "OSMODE" 0) (setq hiden (mapcar 'vlax-ename->vla-object(vl-remove-if 'listp (mapcar 'cadr (ssnamex sset)))) hiden (vl-remove tmp_blk hiden)) (mapcar '(lambda(x)(vla-put-Visible x :vlax-false)) hiden) (setq pt (mapcar '+ MinPt (list (* 0.5 DS)(* 0.5 DS)))) (vl-cmdf "_.RECTANG" (trans MinPt 0 1)(trans MaxPt 0 1)) (setq pl (vlax-ename->vla-object(entlast))) (setq sc (1-(vla-get-count csp))) (if (VL-CATCH-ALL-ERROR-P (VL-CATCH-ALL-APPLY '(lambda () (vl-cmdf "_-BOUNDARY" (trans pt 0 1) "") (while (> (getvar "CMDACTIVE") 0)(command ""))))) (if isRus (princ "\n?? ??????? ????????? ??????")(princ "\nIt was not possible to construct a contour"))) (setq ec (vla-get-count csp)) (while (< sc ec)(setq ret (append ret (list (vla-item csp sc))) sc(1+ sc))) (setq ret (vl-remove pl ret)) (mapcar '(lambda (x)(vla-Erase x)(vlax-release-object x))(list pl tmp_blk))(setq pl nil tmp_blk nil) (setq ret (mapcar '(lambda ( x / mipt)(vla-GetBoundingBox x 'MiPt nil) ;_??????? ????? (setq MiPt (vlax-safearray->list MiPt))(list MiPt x)) ret)) (setq ret (vl-sort ret '(lambda (e1 e2)(< (distance MinPt (car e1))(distance MinPt (car e2)))))) (setq pl (nth 1 ret) ret (vl-remove pl ret)) (mapcar 'vla-erase (mapcar 'cadr ret)) (mapcar '(lambda(x)(vla-put-Visible x :vlax-true)) hiden) (foreach x loc (vla-put-lock x :vlax-true)) (if pl (progn (initget "Yes No") (if (= (getkword (if isRus "\n??????? ???????? [Yes/No] <No> : " "\nDelete objects? [Yes/No] <No> : ")) "Yes") (mapcar '(lambda (x) (if (vlax-write-enabled-p x)(vla-Erase x))) obj))) (if isRus (princ "\n?? ??????? ????????? ??????")(princ "\nIt was not possible to construct a contour"))))))) (VL-CATCH-ALL-APPLY '(lambda ()(mapcar 'vlax-release-object (list unnamed_block tmp_blk csp blks lays))))));_if not (foreach x loc (vla-put-lock x :vlax-true))(setvar "OSMODE" osm) (vla-endundomark adoc)(vlax-release-object adoc)(princ)) Could you help me please!!
  10. Hi, I'm looking to make a script, lisp or batch sort I could take all the 3D drawing from a file and convert it to a 2d drawing. I've tried a lot of thing like "flatshot", "outbounding", "flatten"... The best result was definitely with the "Flatshot" command, but it cannot be use as a script or lisp (I might be wrong). Outbounding wasn't effective at all. So I came ou with the Flatten Function from the Express tools that i run in the Wscript of Lee Mac. I made all a routine that goes like this : _open *file* _-view _top -calque nouv 2D _ai_selall _Flatten no _change tout propriétés elév 0 tout propriétés Couleur jaune _change tout propriétés ca 2D _ai_selall _-overkill terminé PURGER TOUT * NON _AUDIT OUI _-VIEW _TOP _qsave _close The fact is that the weight of the files are always too big and the details are not as accurate as "Flatshot". I could also add wblock to the script but it still a pretty heavy file So finally, I would need to take my 3D file to become a flat 2D drawing on a specific layer and color (pretty simple to do). Here's an example of the furniture i would need to "transform" 3-MLE3060EFM.dwg, the flatshot finish Flatshot.dwg and the flatten script 3-MLE3060EFM.dwg. Sorry for my bad english and just notice that the command are in french or internationnal.
  11. Hello, I have 5000 drawings that contains three specific tables. All these tables are linked to external Excel using data links. The main issue i have is, after the data link is removed the cell content of all three tables remain locked. Is there any way to unlock the cells using lisp??. I know i can do it manually but i don't want to go that route unless it is the only the way to do so. Please take a look at the drawing & lsp file. Trial.dwg Thank you very much. Regards, A AUTOCAD AUTOMATION.LSP
  12. Hi, Recently been testing the water with writing scripts to try and automate some of the functions that I do repetitively so a newbie to this. Unfortunately only have access to AutoCAD LT so can't use LISP or anything. Have tried the ^C^C and (command) suggested in other forums. Essentially my script something like this: -layer set Datum LINE 0,-14000 850000,-14000 -INSERT BLOCK1 10000,20000 1 1 0 20000,20000 1 1 0 30000,20000 1 1 0 -INSERT BLOCK2 37000,7000 1 1 0 When I run it in CAD it keeps asking for an insertion point for BLOCK1 (even though I don't want more than 3 in the drawing) - how do I escape this command and move onto next line of commands (insert BLOCK2). Essentially I want equivalent of escape key. Can't find answer anywhere. Thanks in advance
  13. Hello dear community, My task is to validate coordinates of antenna changes for a mobile network; this list is supplied in Excel format an the respective points are introduced in matlab on separate layers for each antenna change, e.g. AC_1>2, AC_5>100, AC_80>34, ... On another layer are the locations of the antennae as points. I want to validate that no antenna change (AC) takes place too far away from that antenna. I have developed a process to do this, yet I still don't have figured out how to do each step. Process: For each antenna (how are for-loops done?) 1. disable (make layers non-visible) all non-relevant layers for this antenna Solution: -layer au *_* ei *45_*,*_45* 2. Connect all remaining visible points with lines (e.g. tree spanning algorithm) 3. Center to the region containing all remaining points and set a predetermined scale (allows to validate distances on paper with ruler after printing) 4. Print to a pdf A3 with same scale always However I do not know how to loop over antennas and don't know how to implement steps 2-4. I would be very thankful if you could provide me same valuable tips. My knowledge in AutoCAD is not very developed, but I have strong programming knowledge. Thank you in advance.
  14. Hello All, I am trying to remove one table from my drawings. Please take a look at the attached sample dwg. I have over 8000 drawings to modify. All drawings contains 3 tables as shown in sample drawing. I want to erase table 3. The location of the table 3 can be anywhere in with in outside border. tried many things. but no luck so far. right now i have an autolisp that works fine if i run it in one drawing. but it doesn't work while running thru script. (defun c:abcd() (setq ss1 (ssget)) (command "erase" "p" "" ) (command "zoom" "e" "") (command "qsave") (princ) ) i have a scrip that loads the autolisp containing the above code. any help would be really appreciated. TEST DWG.dwg
  15. Hi, I need to run a scrit on multiple files and I would like it To chose wich SCR to run bas on the begining of the Name of the DWG File. In this case i have file with 2436, 3648 etc... and my scr would need to run the 2436INS.SCR on the 2436 ans same thing with the 3648 etc... I have try using Script Pro 2.0 But as it's openning a new file that has nothing in it it wont run proprelly the srcip. Here's my .scr Also Got it in Macro Command I would at least be able to run it in Script Pro but if someone is able to make a.bat or a lisp quith that it would be so fantastic I'm really sorry for my bad english! Thanks to every one!
  16. I am trying to script a counter of specific strings. How can I select all occurrences of text that has a specific value? I cannot use filter or quickselect, and I cannot get selection sets to find specified values. Any help would be greatly appreciated. I am using ACADE 2015.
  17. I have a client who used Simplex.shx font all over their drawing package. Is there a way to use Simplex.ttf in a text style instead? I have read and searched all over and haven't gotten anything to work. When I go to my style manager Simplex_IV25 and SimplexIV_IV50 are the only true type fonts I can use of Simplex. They are wider and bolder than the regular version, which is not selectable. I would like to change the style using a script on my 300+ drawings so that when we convert to PDF it is searchable. I cannot use either Simplex_IV25 or Simplex_IV50 because the clients would notice and would complain, it would also throw alignment off. I am using ACADE 2015. Any other info needed, I can gladly give. Thanks
  18. Hi, I want to make a script who draw circles in multiple Points. The Points are automaticly made in a extension to autocad. All the Points are in same layers. It´s around 200 to 1000 Points in the drawing. My first issue is to find a commando who draw circles, with basepoints in all Points. Does anyone know the appropriate command for me? Regards, Emil
  19. I'm trying to write either a script or a macro to make it easier to do an array that we will need to replicate on a regular basis. Basically, I want a path array to offset mtext every 20m along a centreline. If I do this in the command line, it's fine: ARRAY select object PA [path] select path curve M [method] M [measure] I [item] 20 [distance apart] F [fill length of path] A [align to path] Y [confirm] X [exit] If I do this in a script or macro, I encounter a difficulty in that the type of array is limited to polar or rectangular. It doesn't even register that path is an option. If I try a similar thing using ARRAYPATH, the options that come up from the macro/script are totally different to the command line options. Am I missing something, or is CAD just unhelpful on this? Running LT, so can't do LISPs
  20. Hey all, this is my first post so I'm sorry if I violate any of the forum rules. I appreciate the help! I'm trying to write a script to get the latest revision number from our drawings, then save that info into a text or CSV file. Each drawing has a revision block like the image tagged below. How would I do that in LISP? Thanks!
  21. I am creating a copy from a drawing with Autolisp and creating a script which will be dettaching all xrefs on the copy. After saving the copy, the last command of the script is "close", then I would like to go back to the original drawing from where the copy was made from. This is not happening if there are some other drawings opened, then it makes active the last opened drawing. I need an automatic process since I will not be the final user and they might get confused. Here it is the code: (defun run (/ mc_scr) (setq switch_dwg (strcat (getvar 'dwgprefix) (getvar 'dwgname) ) ) (setq mc_scr (open (strcat (getenv "temp") "\\mc.scr") "w")) (foreach mem0 (list "open" (strcat "\"" new_c "\"") "(setq opn_dwg_lst nil)" "(vlax-for" " x" " (vla-get-documents" " (vlax-get-acad-object)" " )" " (setq opn_dwg_lst (cons x opn_dwg_lst))" ")" "-xref" "d" "*" "-purge" "a" "*" "n" "_ucs" "_w" "_plan" "_w" "_zoom" "_e" "(foreach SYM_MEM opn_dwg_lst" " (if " " (=" " (strcat" " \"A\"" " (substr" " (getvar \"dwgname\")" " 2" " )" " )" " (vla-get-name SYM_MEM)" " )" " (setq SYM_A SYM_MEM)" " )" ")" "qsave" "close" "(vla-activate SYM_A)" ) (write-line mem0 mc_scr) ) (close mc_scr) ) (defun mc (/ new_c mc) (setvar 'CMDECHO 0) (if (= (substr (getvar 'dwgname) 1 2 ) "A_" ) (progn (command "qsave") (setq new_c (strcat (getvar 'dwgprefix) (vl-string-subst "B_" "A_" (getvar 'dwgname)) ) ) (cond ( (/= (findfile new_c) nil) (command "save" new_c "y") (run) ) (T (command "save" new_c) (run) ) ) (command "script" (strcat (getenv "temp") "\\mc.scr")) ) ) (setvar 'CMDECHO 1) (princ) ) (mc) Any clue? thanks in advance Svorgodne
  22. I have created a .cuix file that I would like to apply to AutoCAD2015 for each user on the network, so that I do not have to log in under each name and manually transfer in the CUI one at a time. So far I have tried multiple methods for loading the custom .cuix file into AutoCAD on launch, however I am unable to get the workspace to transfer in at all. I have created an acaddoc.lsp file, saved into a support file path, that calls another .lsp file to load in the cuix, based on code I have seen on this forum: (command "cuiunload" "FILENAME" ^C "cuiload" "X:\XX\XXX\FILENAME.cuix" ^C) However my new workspace is never added into the program after successfully calling the LSP when CAD launches. I have also messed around with ARG files and using a switch to call on a script upon launching CAD, although I so far have not had any luck. I am a novice at writing scripts for AutoCAD and navigating the program's folders, so please let me know if I need to provide any more detailed information. I appreciate any help that someone has to offer. Thanks.
  23. Hello everybody! Few programmers (including myself) decided to create a website with free (for now) AutoLisp programs and scripts for Autocad. Well, we have few questions to define where to start. Your answers would really help. - Do you use programs (scripts) in your work? - Which program (script) you would use but do not have. Best regards, ... PS Link to website asap
  24. Hi all I really do not have much experience with AutoLISP but I would like to write a script that allows me to: 1. Create a new DWG 2. Draw a line from a set of existing coordinates from a .txt file 3. Save this drawing in a specified location 4. Close the drawing 5. Rinse and repeat until all of the .txt files have been drawn. Basically this will be used for hundreds of .txt files containing coordinates to draw the cross-sections of a tunnel. Is this something that can be done? As after hours of research I have only managed to be able to draw one cross-section using a batch file but haven't been able to close the drawing or save it. Thanks in advance for any help
  25. Hi, this is my first post on the forum & I'm also pretty new to AutoCAD scripts & Lisp routines, so please bear with me. Basically I have the following script: (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.saveas 2010 !dn This script saves my current drawing as 'New Drawing.dwg' within my current directory, and works fine. When I try to modify the script to the following, which attempts to open instead instead of save, it doesn't work, just prompts for drawing name: - (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.open !dn The saveas & open dialogues look very similar, so please could someone explain why I can reference a variable for the _.saveas filename, but not for the _.open filename, or have I got the syntax completely wrong for the _.open command?
×
×
  • Create New...