我建议你这样开始:
- (defun c:pics nil (myexplore "photos\"))
- (defun c:points nil (myexplore "points\"))
- (defun c:odwgs nil (myexplore "dwgs\\byothers\"))
- (defun getroot ( / dir pos )
- (setq dir (strcase (getvar 'dwgprefix) t)
- pos (vl-string-search "\\dwgs\" dir)
- )
- (if pos
- (substr dir 1 pos)
- (prompt "\nCurrent directory does not have a "dwgs" folder.")
- )
- )
- (defun explore ( dir )
- (if (vl-file-directory-p dir)
- (startapp "explorer" dir)
- (prompt (strcat "\n"" dir "" not found."))
- )
- )
- (defun myexplore ( fld / dir )
- (if (setq dir (getroot)) (explore (strcat dir "\" fld)))
- (princ)
- )
|