• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • AutoCAD 2010/2011/2012 DWG Format

    Reply
    Valued Contributor
    Stemdriller
    Posts: 70
    Registered: ‎12-15-2011
    Accepted Solution

    Designed By Attribute

    235 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

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎04-05-2012

    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

     

    Please use plain text.
    Valued Contributor
    Stemdriller
    Posts: 70
    Registered: ‎12-15-2011

    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

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    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

     

     

     

     

     

     

     

    Please use plain text.
    *Pro
    M_Hensley
    Posts: 1,574
    Registered: ‎12-11-2003

    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)

    Please use plain text.
    Distinguished Mentor
    Moshe-A
    Posts: 679
    Registered: ‎09-14-2003

    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

     

    Please use plain text.
    Valued Contributor
    Stemdriller
    Posts: 70
    Registered: ‎12-15-2011

    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

    Please use plain text.
    Valued Contributor
    Stemdriller
    Posts: 70
    Registered: ‎12-15-2011

    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

    Please use plain text.
    Valued Contributor
    Stemdriller
    Posts: 70
    Registered: ‎12-15-2011

    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

    Please use plain text.
    *Pro
    M_Hensley
    Posts: 1,574
    Registered: ‎12-11-2003

    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.

    Please use plain text.