i have a simple lisp, which i plan to add to startup, so that based on 64bit or 32 bit OS, when users hit OPEN, it will default to a folder called PROJECTS in the user's desktop, which houses the shortcuts to all project folders in the network. here's what i have so far:
;;;BEGIN
(defun c:open()
(setq myname (getvar "loginname"))
(if (= (getenv "PROCESSOR_ARCHITECTURE") "x86")
(progn
(startapp "explorer" (strcat "C:\\users\\" myname "\\Desktop\\PROJECTS"))
)
(progn
(startapp "explorer" (strcat "C:\\Documents and Settings\\" myname "\\Desktop\\PROJECTS"))
(princ)
)
)
)
;;;;END
the problem is "explorer" opens an external window, and i cannot figure out how to make the open dialogue box default to the PROJECTS folder. if someone can point me in the right direction, i would really appreciate.
@youngEIT wrote:i have a simple lisp ... so that based on 64bit or 32 bit OS, when users hit OPEN, it will default to a folder called PROJECTS in the user's desktop
....
(defun c:open()
(setq myname (getvar "loginname"))
(if (= (getenv "PROCESSOR_ARCHITECTURE") "x86")
...(startapp "explorer" (strcat "C:\\users\\" myname \\Desktop\\PROJECTS))...
...(startapp "explorer" (strcat "C:\\Documents and Settings\\" myname \\Desktop\\PROJECTS))...
....the problem is "explorer" opens an external window, and i cannot figure out how to make the open dialogue box default to the PROJECTS folder. ....
This is a job for the (getfiled) function, which spares you the need to get into another program outside AutoCAD. Something like [untested]:
(defun c:open() (command "_.open" (getfiled "Select drawing:" (strcat "C:\\" (if (= (getenv "PROCESSOR_ARCHITECTURE") "x86") "users\\" ; then "Documents and Settings\\" ; else ); end if (getvar "loginname") "\\Desktop\\PROJECTS" ); end strcat "dwg" 0 ); end getfiled ); end command ); end defun