neekcotrack Posted October 24, 2008 Author Posted October 24, 2008 Is there a way to put the purge and bind at the beginning, then instead of savas is it possible to do a aectoacad. Not changing anything but the bind and purge will be done before aectoacad to the folder location. Do you know what I mean by use AECTOACAD instead of saveas? Quote
CAB Posted October 24, 2008 Posted October 24, 2008 I have not used that command. http://discussion.autodesk.com/forums/thread.jspa?threadID=465456 You may give it a try. Quote
neekcotrack Posted October 24, 2008 Author Posted October 24, 2008 I have not used that command.http://discussion.autodesk.com/forums/thread.jspa?threadID=465456 You may give it a try. Ok I got it to work. (defun c:BindIt (/ LST VANS VDATE VDATESTR VDAY VDIA VDIR VECHO VMONTH VNAME VPREFIX VYEAR X) ;; CAB 10/07/08 ;; (splitdirs "c:\\123\\456\\789") returns ("c:" "123" "456" "789") (defun splitdirs (str / lst pos) (while (or (setq pos (vl-string-search "\\" str)) (setq pos (vl-string-search "/" str)) ) (setq lst (cons (substr str 1 pos) lst) str (substr str (+ pos 2)) ) ) (if (> (strlen str) 0) (setq lst (cons str lst)) ) (reverse lst) ) (setq vDia (getvar "filedia") vEcho (getvar "cmdecho") vPrefix (getvar "dwgprefix") vName (getvar "dwgname") vDate (rtos (getvar "cdate") 2 6) vYear (substr vDate 1 4) vMonth (substr vDate 5 2) vDay (substr vDate 7 2) vDateStr (strcat vYear "-" vMonth "-" vDay) ) ;; remove the last 2 dirs (setq lst (reverse (cddr (reverse (splitdirs vPrefix))))) (setq vPrefix "") (mapcar '(lambda (x) (setq vPrefix (strcat vPrefix x "\\"))) lst) (setvar "filedia" 0) (setvar "cmdecho" 0) (initget "Bound Email") (setq vDir (getkword "\nSave file to [Email/Bound] <Bound>: ")) (cond ((or (null vDir) (= "Bound" vAns)) (setq vDir (strcat vPrefix "Bound")) (vl-mkdir vDir) ) (t (setq vDir (strcat vPrefix "Email")) (vl-mkdir vDir) ) ) (if (vl-file-directory-p vDir) (progn ;; The following is to create a seperate directory for each date (setq vDir (strcat vDir "\\" vDateStr)) (cond ((and (null (vl-file-directory-p vDir)) (null (vl-mkdir vDir)) ) (prompt (strcat "\nError - Could not create Folder: " vDir)) ) (t ; folder exist ;;(command "_.-exporttoautocad" "F" "2004" "" (strcat vDir "\\" vDateStr "-" vName)) (command "_.-exporttoautocad" "F" "2004" "" (strcat vDir "\\" vName)) ) ) ) (prompt (strcat "\nError - Could not create Folder: " vDir)) ) (setvar "filedia" vDia) (setvar "cmdecho" vEcho) (princ) ) So if you have never used AECTOACAD it is something that building systems has. Like AutoCAD MEP 2009 . It converts 3D objects over to 2D objects so people with just regular CAD can use it. Thanks again CAB!!!!!!!!!! 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.