View Full Version : hoping for: get loginname and date then put on titleblock as text help
d_m_hopper
2008-03-17, 06:52 PM
(setq initials (getvar "loginname"))
(menucmd "M=$(edtime,$(getvar,date),DD-MO-YY)") )
(setq text (str ("loginname" - "date")))
I am unsure of psuedo code, looking for help
(setq initials (getvar "loginname"))
(menucmd "M=$(edtime,$(getvar,date),DD-MO-YY)") )
(setq text (str ("loginname" - "date")))
I am unsure of psuedo code, looking for help
Pretty close.
One way:
(setq initials (getvar "loginname"))
(setq d (menucmd "M=$(edtime,$(getvar,date),DD-MO-YY)"))
(setq text (strcat initials " - " d))
HTH
d_m_hopper
2008-03-17, 11:02 PM
Pretty close.
One way:
(setq initials (getvar "loginname"))
(setq d (menucmd "M=$(edtime,$(getvar,date),DD-MO-YY)"))
(setq text (strcat initials " - " d))
HTH
thank you for your help
d_m_hopper
2008-03-18, 02:41 PM
I just realized something however...
the loginname is not initials like I thought
it is our employee id # so it prints out something like this
123456789 - 03/18/08
updated test code below
(defun c:draft ()
(setvar "textstyle" "dmt"); set in routine this will be added to
(setq id '(1610.7021 -1002.0960)); set in routine this will be added to
(setq initials (getvar "loginname"))
(setq d (menucmd "M=$(edtime,$(getvar,date),MO/DD/YY)"))
(setq text (strcat initials " - " d))
(command "._text" "bl" id"" text"" 0 ""); set in routine this will be added to
)
how would I write: if loginname = 123456789 change it to AAA etc
I will be creating a list of if = employee # = "X" change to initials "X"
d_m_hopper
2008-03-18, 03:27 PM
found in a thread where it mentions to do this
(Setenv "123456789" "DMH")
Then in your DIESEL expression:
$(getenv, CHILL)
Since I can't change the system variable "loginname", I will work on doing this
ccowgill
2008-03-18, 04:42 PM
I just realized something however...
the loginname is not initials like I thought
it is our employee id # so it prints out something like this
123456789 - 03/18/08
updated test code below
(defun c:draft ()
(setvar "textstyle" "dmt"); set in routine this will be added to
(setq id '(1610.7021 -1002.0960)); set in routine this will be added to
(setq initials (getvar "loginname"))
(cond
((= initials "123456789")
(setq initials "AAA")
)
((= initials "123456788")
(setq initials "AAB")
)
)
(setq d (menucmd "M=$(edtime,$(getvar,date),MO/DD/YY)"))
(setq text (strcat initials " - " d))
(command "._text" "bl" id"" text"" 0 ""); set in routine this will be added to
)how would I write: if loginname = 123456789 change it to AAA etc
I will be creating a list of if = employee # = "X" change to initials "X"
you could try something like what I have written in red above
ReachAndre
2008-03-18, 04:50 PM
If your loginname was your name, you ould have tried using fields,
d_m_hopper
2008-03-18, 05:08 PM
If your loginname was your name, you ould have tried using fields,
I have never tried fields, still trying to figure out how to use text and if/cond statements in my routines....still new to this
I am always willing to try different approaches though.
thanks for the tip
d_m_hopper
2008-03-18, 05:12 PM
you could try something like what I have written in red above
(defun c:draft ()
(setvar "textstyle" "dmt"); set in routine this will be added to
(setq id '(1610.7021 -1002.0960)); set in routine this will be added to
(setq initials (getvar "loginname"))
(cond
((= initials "123456789")
(setq initials "AAA")
)
((= initials "123456788")
(setq initials "AAB")
)
)
(setq d (menucmd "M=$(edtime,$(getvar,date),MO/DD/YY)"))
(setq text (strcat initials " - " d))
(command "._text" "bl" id"" text"" 0 ""); set in routine this will be added to
)
thanks that works great, I was trying to make it change the loginname before I learned that I could not change it...
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.