检索用户prof的简单方法
试着用我和同事的Lisp程序。我被用户配置文件名卡住了(defun c:STAMP (/ opt date ent text)
(initget 1 "Date Name")
(setq opt (getkword "\nSpecify stamp : "))
(while
(not
(and
(setq ent (car (entsel "\nSelect text to modify: ")))
(eq "TEXT" (cdr (assoc 0 (setq ent (entget ent)))))
)
)
(prompt "\n**Please select a text to modify!**")
)
(if (eq "Date" opt)
(progn
(setq date (rtos (getvar "CDATE") 2 0))
(setq text (strcat (substr date 5 2) "/" (substr date 7 2) "/" (substr date 3 2)))
)
(setq text (getvar "???"))
)
(entmod (subst (cons 1 text)(assoc 1 ent) ent))
(princ)
) (getvar“CPROFILE”) 非常感谢。 AutoCAD配置文件还是Windows配置文件?
如果是后者,则使用(getenv“username”) 这是cad配置文件,但这可能有用。非常感谢。
丹的腿好极了。
当做 谢谢如果这对这里的任何人都有用,你去吧
(defun c:STAMP (/ *error* opt date ent text)
(defun *error* (msg)
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **"))
)
(princ)
)
(initget 1 "Date Name")
(setq opt (getkword "\nSpecify stamp : "))
(while
(not
(and
(setq ent (car (entsel "\nSelect text to modify: ")))
(setq ent (entget ent))
(OR
(eq "TEXT" (cdr (assoc 0 ent)))
(eq "MTEXT" (cdr (assoc 0 ent)))
)
)
)
(prompt "\n**Please select a text to modify!**")
)
(if (eq "Date" opt)
(progn
(setq date (rtos (getvar "CDATE") 2 0))
(setq text (strcat (substr date 5 2) "/" (substr date 7 2) "/" (substr date 3 2)))
)
(setq text (getvar "CPROFILE"))
)
(entmod (subst (cons 1 text)(assoc 1 ent) ent))
(princ)
)
很抱歉我只使用单行文字,但决定允许同时使用。。。如果有人真的用这个。
页:
[1]