Linking notes?

Discussion in 'SolidWorks' started by bagarnx, Aug 19, 2004.

  1. bagarnx

    bagarnx Guest

    Hi!

    I'm having problems with linking notes in a drawing template.

    When using "SW-Created Date' the result is 'Thursday, August 19, 2004 8:54:12 AM'.
    How can I make it look like 'SW-Short Date'; '8/19/2004'?

    Also, is it possible to link a note to the user's login name?


    Thanks for your time!
    /Anders
     
    bagarnx, Aug 19, 2004
    #1
  2. bagarnx

    Krister L Guest

    I use DbWorks to care of these things, but how to display the date is set in
    "regional options" in the control panel, I'll see if I can get back with how
    to deal with login name later on

    Krister L
     
    Krister L, Aug 19, 2004
    #2
  3. bagarnx

    Seth Renigar Guest

    I have always wondered how to do this also. I just tried this solution, and
    it doesn't do exactly what bagarnx (and myself) was wanting. He was wanting
    the created date to be displayed as mm/dd/yyyy. Instead, the closest to
    that the regional options will do (in WinXP anyway) is MMMM/dd/yyyy. Plus,
    SW tags on the time also which was not desired.
     
    Seth Renigar, Aug 19, 2004
    #3
  4. bagarnx

    Krister L Guest

    Well....as I said I use DbWorks to take care of this.....and maybe there is
    another setting inside there...was quite a while since we did this so I'm
    not really sure, think I'll have a look later on. I myself use yyyy.mm.dd
    for my drawing creation date.

    Krister
     
    Krister L, Aug 19, 2004
    #4
  5. I use a macro to set the date when a new drawing is created automatically.
    SW leaves something to be desired here.

    Q: WHO REALLY WANTS A LONG CREATE DATE IN THE DRAWING?????
    A: NOBODY. who really cares what time of the day a drawing was created? COME
    ON!!!!!
     
    Corey Scheich, Aug 19, 2004
    #5
  6. bagarnx

    Krister L Guest

    Well.....just found out You can type in what ever display You want.....if
    You want 08/19/2004....just type it in into the regional property option,
    and use / as a date separator....just be sure to pick "SW-short date" in the
    link to property box

    Krister L
     
    Krister L, Aug 19, 2004
    #6
  7. bagarnx

    Krister L Guest

    Sorry....You should of course type in MM/dd/yyyy....not the date .....but
    You already guessed...eh
    and it sure works also in WXP

    Krister L
     
    Krister L, Aug 19, 2004
    #7
  8. bagarnx

    Seth Renigar Guest

    That is cool. Didn't know you could do that... You can do this in the
    short date and long date of the regional property option.

    The only other problem now is that the "SW-Created Date" in the link to
    property box still tags on the time. You can not use "SW-short date"
    because this always displays the current date, not the created date. There
    needs to be a "SW-Created Date" and a "SW-Created Date & Time".
     
    Seth Renigar, Aug 19, 2004
    #8
  9. bagarnx

    RedSoxFan Guest

    It should be pretty simple... try this:

    1. Click Note.
    2. In the PropertyManager, click Link to Property.
    3. In the dialog box, select SW-Short Date.
    4. Click OK.
     
    RedSoxFan, Aug 19, 2004
    #9
  10. He needs a SW-CreateDateShort but it doesn't exist. If I were smarter I
    would Hi-Jack this functionality and write my own links.

    Corey
     
    Corey Scheich, Aug 19, 2004
    #10
  11. bagarnx

    Seth Renigar Guest

    As I stated in my reply to Krister, this shows the current date, not the
    created date. This is the date format bagarnx is looking for though.
     
    Seth Renigar, Aug 19, 2004
    #11
  12. bagarnx

    Krister L Guest

    Just had a look in the help files and there is a "SW-created Date" depending
    on regional settings. A long shot would be to type in the short form on the
    long format line....if that one is not used anyhow

    Krister L
     
    Krister L, Aug 19, 2004
    #12
  13. bagarnx

    bagarnx Guest

    FIrst of all, thanks for your responses!

    Now, if I do as Krister L said, what would happen if someone opened
    the drawing in another computer?
    Wouldn't the date look different then?

    As Corey Scheich stated, SW-CreateDateShort would be optimal.

    No ideas on linking to the Windows login name?

    /Anders
     
    bagarnx, Aug 20, 2004
    #13
  14. No ideas on linking to the Windows login name?

    Not a CHANCE
    This I took care of using API also.

    Corey
     
    Corey Scheich, Aug 20, 2004
    #14
  15. bagarnx

    bagarnx Guest

    Are you using VB macro?
    If so, how did you "get" the login name?

    /Anders
     
    bagarnx, Sep 8, 2004
    #15
  16. Yes here it is I can't remember who gave me this example but it has worked
    quite well here.


    ' Declare for call to mpr.dll.
    Declare Function WNetGetUser Lib "mpr.dll" _
    Alias "WNetGetUserA" (ByVal lpName As String, _
    ByVal lpUserName As String, lpnLength As Long) As Long

    Const NoError = 0 'The Function call was successful
    Public UserInitials As String


    Sub GetUserName()

    ' Buffer size for the return string.
    Const lpnLength As Integer = 255

    ' Get return buffer space.
    Dim status As Integer

    ' For getting user information.
    Dim lpName, lpUserName As String

    ' Assign the buffer size constant to lpUserName.
    lpUserName = Space$(lpnLength + 1)

    ' Get the log-on name of the person using product.
    status = WNetGetUser(lpName, lpUserName, lpnLength)

    ' See whether error occurred.
    If status = NoError Then
    ' This line removes the null character. Strings in C are null-
    ' terminated. Strings in Visual Basic are not null-terminated.
    ' The null character must be removed from the C strings to be used
    ' cleanly in Visual Basic.
    lpUserName = Left$(lpUserName, InStr(lpUserName, Chr(0)) - 1)
    Else

    ' An error occurred.
    'MsgBox "Unable to get the name."
    End
    End If


    ' Display the name of the person logged on to the machine.
    MsgBox "The person logged on this machine is: " & lpUserName
    End Sub

    Regards

    Corey Scheich

    Are you using VB macro?
    If so, how did you "get" the login name?

    /Anders[/QUOTE]
     
    Corey Scheich, Sep 8, 2004
    #16
  17. bagarnx

    bagarnx Guest

    That worked perfectly!
    Thank you!

    /Anders

     
    bagarnx, Sep 9, 2004
    #17
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.