AutoCAD 2010/2011/2012

Reply
Valued Contributor
Stemdriller
Posts: 88
Registered: ‎12-15-2011
Message 1 of 10 (357 Views)
Accepted Solution

Designed By Attribute

357 Views, 9 Replies
04-19-2012 05:30 AM

Hi All

 

As in my previous posts I am very new to this AutoCAD lark.

 

All I am trying to do at the moment is create an attribute on a drawing template that will simply display the users username.

 

I am hoping then that this will be presented as 'Designed By' or something similar, on the drawing and then I am hoping to try and get it into Vault.

 

Hope someone can enlighten me.

 

Gareth

Member
MrShepherd
Posts: 4
Registered: ‎04-05-2012
Message 2 of 10 (331 Views)

Re: Designed By Attribute

04-19-2012 09:24 AM in reply to: Stemdriller

To make the attribute type

ATTDEF

 

When the dialog box appears

Select - Preset.  This will allow you to edit the block that contains the attribute.

If you enter the values shown for TAG, PROMPT & DEFAULT like this:

Attribute Define DLL

 

When you edit the block that contains the attribute with the ATTEDIT command, it will look like this:

Attribute Edit

 

Valued Contributor
Stemdriller
Posts: 88
Registered: ‎12-15-2011
Message 3 of 10 (315 Views)

Re: Designed By Attribute

04-20-2012 12:11 AM in reply to: Stemdriller

Thanks for the reply.

 

But can I get the 'Designed By' to default so that it automatically takes the users username.

 

So in my case  if I begin a dwg, it will automatically populate the 'Designed by'  with jgw2, my Windows username?

 

Gareth

Distinguished Mentor
Moshe-A
Posts: 739
Registered: ‎09-14-2003
Message 4 of 10 (309 Views)

Re: Designed By Attribute

04-20-2012 03:49 AM in reply to: Stemdriller

Gareth,

 

well one way to do it is to define the DESIGNER-NAME attribute value as field

first you need to add this expression to your acad.lsp (or any other lisp file that is autoload)

 

(setq username (getenv "username"))

 

now prepare your title block and invoke the ATTDEF command

in tag field enter DESIGNER-NAME

in prompt field enter Design Name

in Default field click on the Insert Field button...this opens the Field dialog box

then select "Other" Category

Field name -> LispVariable

and roll the list to find the username

(it should be there if you add the expression to acad.lsp and load it)

finish with ATTDEF dialog and define your block

 

after inserting your title block save the dwg and reopen it you will see that

the user name is update

 

another way of doing it is with autolisp but that's totally another story

 

GoodLuck

Moshe

 

 

 

 

 

 

 

*Expert Elite*
M_Hensley
Posts: 1,679
Registered: ‎12-11-2003
Message 5 of 10 (308 Views)

Re: Designed By Attribute

04-20-2012 03:57 AM in reply to: Stemdriller

You could use a field instead.

When in the text command right-click and select insert field.

In the field names list select DeselExpression.

In the diesel expression area type $(getenv, username)

Distinguished Mentor
Moshe-A
Posts: 739
Registered: ‎09-14-2003
Message 6 of 10 (295 Views)

Re: Designed By Attribute

04-20-2012 08:30 AM in reply to: M_Hensley

Yes Hensley, you are absolutely right, this saves the use of acad.lsp

 

thank you very much for your remark

Moshe

 

Valued Contributor
Stemdriller
Posts: 88
Registered: ‎12-15-2011
Message 7 of 10 (273 Views)

Re: Designed By Attribute

04-22-2012 11:47 PM in reply to: M_Hensley

Fantastic, thanks for this.

 

That has opened a few doors for me.

 

Gareth

Valued Contributor
Stemdriller
Posts: 88
Registered: ‎12-15-2011
Message 8 of 10 (271 Views)

Re: Designed By Attribute

04-22-2012 11:48 PM in reply to: Moshe-A

Thanks for responding.

 

I am just starting to look at .lsp files, didn't realise you could use them for things like this.

 

Gareth

Valued Contributor
Stemdriller
Posts: 88
Registered: ‎12-15-2011
Message 9 of 10 (266 Views)

Re: Designed By Attribute

04-23-2012 02:47 AM in reply to: M_Hensley

Hensley

 

I foolishly thought that when the username command took the current users username, that when another user opened the drawing it would keep the existing username. But it doesn't it overwrites with the other user (If that makes sense!)

 

What I am trying to achieve is that the creator of the drawing will always appear on the DWG file??

 

Can you help?

 

Gareth

*Expert Elite*
M_Hensley
Posts: 1,679
Registered: ‎12-11-2003
Message 10 of 10 (262 Views)

Re: Designed By Attribute

04-23-2012 04:07 AM in reply to: Stemdriller

I don't know how to display who created the drawing. You can display who saved it last, if that helps. Or if you fill out the author field of the drawing properties (using DWGPROPS command) you can display that.

 

To display who saved a drawing last, instead of selecting DieselExpression select LastSavedBy.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube