- 积分
- 29015
- 明经币
- 个
- 注册时间
- 2013-1-25
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 尘缘一生 于 2023-5-19 23:40 编辑
不时被要求,存文件加时间标记,言有个什么的插件这个功能好 “牛”,你三领不作吗?如此云云,果真如此否?
那么,对于喜欢用参照的用户呢?存的文件名称都变了,若此文件还用于被其他文件参照呢?参照将丢失无效,更不用说,单位联网互相参照设计的企业了
鉴于此啊,哪么有人总喜欢要呢?还是需要提供为好,为此,《三领设计 V3.0》作点尝试,办法比较笨,加乒乓开关,供不同用户舍取....
链接:https://pan.baidu.com/s/121F2iYHurAheMcxlJAJjRw
提取码:iojf
本来想作15分钟判定保存,没来得及更深入,希望高手提供这部分。。。
- ;;图纸存为:名称(当前时间),以分钟间隔----------c:slqsave
- ;;MODIFY 三领设计 尘缘一生 QQ:15290049
- (defun c:tt (/ name dwgpath k basename ext fullname bakname path time newname)
- (setq name (Vlax-Get (Vlax-Get *Acad* 'ActiveDocument) 'Name))
- (setq time (menucmd "m=$(edtime,$(getvar,DATE),YYYY-MO-DD HH-MM)"))
- (if (not (sl:Saved-p)) ;(= (getvar "dwgtitled") 0) ;图纸还没有保存,则保存缺省名
- (progn
- (setq dwgpath (strcat (getvar "DWGPREFIX") "user-all.dwg"))
- (while (/= (findfile dwgpath) nil)
- (setq dwgpath (strcat (getvar "DWGPREFIX") "user-all" (slsjqs) ".dwg"))
- )
- (command "_.QSAVE" dwgpath)
- )
- )
- (setq fullname (Vlax-Get (Vlax-Get *Acad* 'ActiveDocument) 'FullName))
- (setq path (vl-filename-directory fullname))
- (setq ext (vl-filename-extension name))
- (setq basename (vl-filename-base name))
- (setq bakname (strcat path "\\" basename ".bak"))
- (if (wcmatch (strcase name) "*`(####-##-## ##-##`).DWG") ;如果文件已带有时间格式了
- (setq newname (strcat path "\\" (substr basename 1 (- (strlen basename) 18)) "(" time ")" ext))
- (setq newname (strcat path "\\" basename "(" time ")" ext))
- )
- (if (= (strcase fullname) (strcase newname))
- (command "_.QSAVE")
- (progn
- (setq k (sl:do1ordo2 "名称是否+时间?" "名称不变" "随时更名"))
- (if (= k "名称不变")
- (command "_.QSAVE")
- (vl-cmdf "SAVEAS" "" newname)
- )
- )
- )
- (if (= (getvar 'ISAVEBAK) 1) ;检测是否需要备份
- (vl-file-rename fullname (strcat path "\\" (vl-filename-base newname) ".bak"))
- (sl:del-fil fullname)
- )
- (if (vl-file-size bakname) (sl:del-fil bakname))
- (princ)
- )
三领全版
- ;;图纸存为:名称(当前时间),以分钟间隔----------c:slqsave
- (defun c:tt (/ name dwgpath k basename ext fullname bakname path time newname)
- (setq name (Vlax-Get (Vlax-Get *Acad* 'ActiveDocument) 'Name))
- (setq time (menucmd "m=$(edtime,$(getvar,DATE),YYYY-MO-DD HH-MM)"))
- (if (not (sl:Saved-p)) ;(= (getvar "dwgtitled") 0) ;图纸还没有保存,则保存缺省名
- (progn
- (setq dwgpath (strcat (getvar "DWGPREFIX") "user-all.dwg"))
- (while (/= (findfile dwgpath) nil)
- (setq dwgpath (strcat (getvar "DWGPREFIX") "user-all" (slsjqs) ".dwg"))
- )
- (command "_.QSAVE" dwgpath)
- )
- )
- (setq fullname (Vlax-Get (Vlax-Get *Acad* 'ActiveDocument) 'FullName))
- (setq path (vl-filename-directory fullname))
- (setq ext (vl-filename-extension name))
- (setq basename (vl-filename-base name))
- (setq bakname (strcat path "\\" basename ".bak"))
- (if (wcmatch (strcase name) "*`(####-##-## ##-##`).DWG") ;如果文件已带有时间格式了
- (setq newname (strcat path "\\" (substr basename 1 (- (strlen basename) 18)) "(" time ")" ext))
- (setq newname (strcat path "\\" basename "(" time ")" ext))
- )
- (if (= (strcase fullname) (strcase newname))
- (vl-cmdf "_.QSAVE")
- (cond
- ((= $Lgver 1)
- (setq k (sl:do1ordo2 "名称是否+时间?" "名称不变" "随时更名"))
- (if (= k "名称不变")
- (vl-cmdf "_.QSAVE")
- (vl-cmdf "SAVEAS" "" newname)
- )
- )
- ((= $Lgver 2)
- (setq k (sl:do1ordo2 "嘿琌+丁" "嘿ぃ跑" "繦"))
- (if (= k "嘿ぃ跑")
- (vl-cmdf "_.QSAVE")
- (vl-cmdf "SAVEAS" "" newname)
- )
- )
- ((= $Lgver 3)
- (setq k (sl:do1ordo2 "Name+Time?" "Name no changed" "Change name at any time"))
- (if (= k "Name no changed")
- (vl-cmdf "_.QSAVE")
- (vl-cmdf "SAVEAS" "" newname)
- )
- )
- )
- )
- (if (= (getvar 'ISAVEBAK) 1) ;检测是否需要备份
- (vl-file-rename fullname (strcat path "\\" (vl-filename-base newname) ".bak"))
- (sl:del-fil fullname)
- )
- (if (vl-file-size bakname) (sl:del-fil bakname))
- (princ)
- )
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
评分
-
查看全部评分
|