xj6019 发表于 2023-5-2 08:09:12

XGZS1234 发表于 2023-4-29 17:24
大神 C:%users\Administrator\appdata\local\temp\23FX-06.dwg    如果想要temp\23FX-06怎么改?

(setq tem(last(LM:str->lst (vl-filename-directory (setq str "C:\\Users\\Administrator\\appdata\\local\\temp\\23FX-06.dwg")) "\\")))
(strcat tem "\\" (vl-filename-base str))


;下为调用函数
(defun LM:str->lst (str del / pos)   
(if (setq pos (vl-string-search del str))
    (cons (substr str 1 pos)
                        (lm:str->lst (substr str (+ pos 1 (strlen del))) del)
    )
    (list str)
)
)

XGZS1234 发表于 2023-5-3 14:20:39

xj6019 发表于 2023-5-2 08:09
(setq tem(last(LM:str->lst (vl-filename-directory (setq str "C:\%users\\Administrator\\appdata\\lo ...

非常感谢大神!!!
页: 1 [2]
查看完整版本: cad文件内插入当前文件的路径