指定檔案路徑的具有DCL對話框副程式

  • Share this:

*** 重要指令為 acet-ui-pickdir ***

*** get_directory_of_bctl 為另一個副程式 ***

*** 功能是再深入取得指定路徑下的子路徑名稱 ***

*** 在此文程中, 未公開程式碼 ***

*** 如果您看懂了下面的程式 ***

*** get_directory_of_bctl 副程式一定寫的出來 ***

(有的電腦或 Auto CAD 好像不認得它 - acet-ui-pickdir !!???)

-----------------------------------------------------------------------------------------------

(acet-ui-pickdir [message [startDir [caption]]]) Displays a directory selection dialog. Arguments message: If provided, a message to be displayed in the space above the directory tree control. startDir: If provided, the initial directory to be selected. caption: If provided, the dialog caption. Return Values A string containing the name of the selected directory, or nil if the dialog was canceled. Library: acetutil.arx

---------------------------------------------------------------------------------------------

(defun get_dir_of_bctl () (setq sel_folder (strcat (acet-ui-pickdir "選擇檔案所在的路徑"  ;;; 對話框最上方顯示的文字 "d:\\"     ;;; 可自行指定內定的路徑 "指定要執行 [ 依顏色轉內定圖層 ] 檔案的路徑" ;;; 對話框選取提示文字, 可依目的修改 ) "\\" ) ) (if sel_folder (setq select_folder (strcat (vl-string-right-trim "\\" sel_folder) "\\") ) (setq select_folder "d:\\") ) (setq directory_list (vl-directory-files select_folder nil -1)) (setq all_directory_list nil) (setq all_directory_list (cons select_folder all_directory_list)) (get_directory_of_bctl directory_list) (while new_directory_list (foreach direct new_directory_list (setq directory_list (vl-directory-files direct nil -1)) (get_directory_of_bctl directory_list) ) ) (setq all_directory_list (reverse all_directory_list)) )


Tags: