rk25134 Posted January 6, 2014 Posted January 6, 2014 Please find the attached screenshot. I need to remove the reference path using lisp. I used a lisp, in that it will attach the reference path and get inserted all the dwgs from the reference path into one file dwg. I want a lisp that need to add the reference path and inserted all drawings from the path save as with the folder name then remove the reference path Quote
satishrajdev Posted January 6, 2014 Posted January 6, 2014 Try this code - (defun RemoveDevPath (DevPaths / IAcadPreferencesFiles pathsString DevPaths) (vl-load-com) (setq IAcadPreferencesFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object)) ) pathsString (vla-get-supportpath IAcadPreferencesFiles) ) (foreach path DevPaths (setq pathsString (vl-string-subst "" path pathsString)) ) (vla-put-supportpath IAcadPreferencesFiles pathsString) (princ) ) Quote
rk25134 Posted January 6, 2014 Author Posted January 6, 2014 (edited) How to append the above routine to this lisp (defun c:iab () (c:insertalldirectory)) (defun c:insertalldirectory (/ DirPath filens) (setq DirPath (acet-ui-pickdir)) (VL-LOAD-COM) (SETQ ACADOBJ (VLAX-GET-ACAD-OBJECT)) (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES ACADOBJ))) (SETQ OLDSUPPORT (VLA-GET-SUPPORTPATH FILES)) (SETQ NEWPATH (STRCAT OLDSUPPORT ";" DirPath ";")) (VLA-PUT-SUPPORTPATH FILES NEWPATH) (setq filens (vl-directory-files DirPath "*.dwg")) (foreach file filens (command "-INSERT" file '(0 0 0) "" "" "") ) (command "Zoom" "e" "") (setvar "qaflags" 1) (command "explode" "all" "") (setvar "qaflags" 0) (command "_.saveas" "" DirPath (getvar 'dwgprefix) "dwg" 1)) (command "filedia" "1") (command "cmddia" "1") (princ) Edited January 7, 2014 by SLW210 ADD Code Tags! Quote
SLW210 Posted January 6, 2014 Posted January 6, 2014 Please read the Code posting guidelines and edit your post to include the Code in Code Tags. Quote
rk25134 Posted January 7, 2014 Author Posted January 7, 2014 (edited) You need a to enclose the Code ( CODE GOES HERE[/i] ). You missed the [/code] at the end. (vl-load-com) (defun c:iab () (c:insertalldirectory)) (defun c:insertalldirectory (/ DirPath filens) (setq DirPath (acet-ui-pickdir)) (SETQ ACADOBJ (VLAX-GET-ACAD-OBJECT)) (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES ACADOBJ))) (SETQ OLDSUPPORT (VLA-GET-SUPPORTPATH FILES)) (SETQ NEWPATH (STRCAT OLDSUPPORT ";" DirPath ";")) (VLA-PUT-SUPPORTPATH FILES NEWPATH) (setq filens (vl-directory-files DirPath "*.dwg")) (foreach file filens (command "-INSERT" file '(0 0 0) "" "" "") ) (command "Zoom" "e" "") (setvar "qaflags" 1) (command "explode" "all" "") (setvar "qaflags" 0) (command "_.saveas" "" DirPath (getvar 'dwgprefix) "dwg" 1)) (command "filedia" "1") (command "cmddia" "1") (princ)[/Code] Edited January 7, 2014 by SLW210 Corrected CODE TAGS! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.