Lt Dan's legs Posted August 10, 2010 Share Posted August 10, 2010 trying to make a lisp my coworker's and I can use. I'm stuck on user profile name (defun c:STAMP (/ opt date ent text) (initget 1 "Date Name") (setq opt (getkword "\nSpecify stamp [Date/Name]: ")) (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))) ) [b][color=red](setq text (getvar "???"))[/color][/b] ) (entmod (subst (cons 1 text)(assoc 1 ent) ent)) (princ) ) Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 10, 2010 Share Posted August 10, 2010 (getvar "CPROFILE") Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted August 10, 2010 Author Share Posted August 10, 2010 thank you! Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted August 10, 2010 Share Posted August 10, 2010 AutoCAD Profile or Windows Profile? If the latter, use (getenv "username") Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted August 10, 2010 Author Share Posted August 10, 2010 it's cad profile but this may be useful. Thank you Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2010 Share Posted August 10, 2010 (edited) trying to make a lisp my coworker's and I can use. I'm stuck on user profile name Wonderful work Lt Dan's legs. Regards. Edited August 10, 2010 by Tharwat Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted August 10, 2010 Author Share Posted August 10, 2010 (edited) Thanks. If this is useful to anyone here you go (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 [Date/Name]: ")) (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) ) Sorry. I only use single line text but decided to allow the use of both... if anyone actually uses this. Edited August 10, 2010 by Lt Dan's legs Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.