马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
 - ;; ------------------------------------------------------------------------
- ;;; 函数名称 / function name: XD::PLOT:GetPlotToFilePath
- ;;;
- ;;; 【功能说明 / description】
- ;;; 获取 AutoCAD 中的默认“打印到文件”输出路径。
- ;;; 使用错误捕获机制(vl-catch-all-apply)防止访问失败时中断程序。
- ;;; 成功时返回路径字符串,失败返回 NIL。
- ;;;
- ;;; 【参数说明 / parameters】
- ;;; 无参数。
- ;;;
- ;;; 【返回值 / return value】
- ;;; 字符串 - 成功时返回默认输出路径
- ;;; NIL - 获取失败(如未能访问 Preferences 对象)
- ;;;
- ;;; 【示例 / example】
- ;;; (XD::PLOT:GetPlotToFilePath)
- ;; ------------------------------------------------------------------------
- (defun XD::PLOT:GetPlotToFilePath (/ preferences output)
- (vl-catch-all-error-p
- (setq output
- (vl-catch-all-apply
- 'vla-get-DefaultPlotToFilePath
- (list
- (vla-get-Output
- (vla-get-Preferences
- (vlax-get-acad-object)
- )
- )
- )
- )
- )
- )
- ;; 如果 output 是错误对象,返回 nil,否则返回路径
- (if (vl-catch-all-error-p output)
- nil
- output
- )
- )
|