View Full Version : DIESEL code - substitute loginname
chill
2004-07-29, 04:30 PM
Our cryptic looking login names are awful looking
Ex. loginname 'as is': hillclie
Desired name format: C. Hill
Has anyone used a DIESEL code string to substitute the loginname?
(I was hoping to use this in a RTEXT-based plot stamp.)
Is this a job for 'Lisp?
RobertB
2004-08-02, 06:12 PM
<off topic> Are you on AutoCAD 2005 yet? If so, consider using Fields, not RText. </off topic>
One option would be to use an external text file to feed the user name. If the text file was consistently named and located, the contents could reflect the desired name. Or, you could use Visual LISP to feed the correct string to a UserSx system variable that could feed the RText. The disadvantage to that would be maintaining the code for user updates.
Tom Beauford
2004-08-02, 09:14 PM
First set an environmental variable with lisp:
(Setenv "CHILL" "C Hill")
Then in your DIESEL expression:
$(getenv, CHILL)
You can't change the system variable "loginname" it's read only.
chill
2004-08-02, 09:35 PM
Tom B.,
I'll look into that.
*************
Tom & Robert,
I knew you guys could figure it out!
*************
Robert,
The new, (?/*!!#) cad admin has the 2005 Mechanical CD. I am looking forward to using fields. Although, I thought RTEXT was hear to stay. Now, here's something much improved I suppose.
The skiddish part of me says leave the title block info as attributes.
The attributes would be updated and manipulated by a newly revised, inhouse Autolisp drawing setup routine w/ built-in plotstamp .(see *)
Sooo.... now, I must decide among Attributes, Rtext, Fields.
Do you think fields are here to stay?
Why or why not?
*This drawing setup routine is a soon to be released Autolisp drawing setup routine developed for us by J. Sanders (www.jefferypsanders.com (http://www.jefferypsanders.com/))
He's a great guy with great Autolisp tutorials and well commented code.
RobertB
2004-08-02, 09:41 PM
Do you think fields are here to stay?
Why or why not?
Yes, Fields are here to stay. They are integral to the SSM, for one. They also address the justification issues that RText has. Also, RText objects depend on an object enabler to make them visible, making them a legacy/out-of-house issue.
There are a few things that fields cannot do that RText can, such as a list of attached XRefs or external file reading. But there are things fields do that RText cannot, such as displaying object properties, e.g. X/Y/Z coordinates.
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.