;;输出当前配置
(defun c:Fstl_ExportProfile (/ date path profiles us)
  (foreach arg (vl-directory-files *fstl_sys* "*.arg")
    (vl-file-delete (strcat *fstl_sys* "\\" arg))
  )
  (setq us (getvar "CPROFILE"))
  (setq Profiles (vla-get-Profiles (vla-get-Preferences *acad*)))
  (setq date (rtos (getvar "cdate") 2 0))
  (setq Path (strcat *fstl_sys* "\\FSTL" date ".arg"))
  (vla-ExportProfile Profiles us path)
  (fstl_alert
    (strcat "\n\n当前配置文件已输出至：\n\n" Path)
  )
  (princ)
)
;;输入配置,设为当前
(defun c:Fstl_ImportProfile (/ lst name path profiles)
  (cond	((setq Path (vl-directory-files *fstl_sys* "*.arg"))
	 (setq path (strcat *fstl_sys* "\\" (car Path)))
	 (setq name (vl-filename-base path))
	)
	(t
	 (fstl_alert
	   (strcat
	     "没有找到用户配置文件【Fstl*.arg】"
	     "\n\n请先保存你的配置文件!"
	   )
	 )
	 (fsxm-silenceexit)
	)
  )
  (setq Profiles (vla-get-Profiles (vla-get-Preferences *acad*)))
  (vlax-make-variant lst)
  (vla-GetAllProfileNames Profiles 'lst)
  (setq lst (vlax-safearray->list lst))
  (cond	((vl-position name lst)
	 (fstl_alert "\n\n保存的配置文件已存在于配置列表中！")
	)
	(T
	 (vla-ImportProfile Profiles name path :vlax-true)
	 (alert	(strcat	"\n[飞诗CAD程序管理大一统]"
			"\n\n友情提示：用户配置文件：\n\n"
			Path
			"\n\n已成功输入！"
		)
	 )
	)
  )
  (if (/= (getvar "CPROFILE") name)
    (vla-put-ActiveProfile Profiles name)
  )
  (fstl_Init_path)
  (princ)
)