ARRGH-Why can't custom property formats be more user configurable?

Discussion in 'SolidWorks' started by TOP, May 10, 2006.

  1. TOP

    TOP Guest

    Tis the season to play with Custom Properties again. It is relatively
    easy to place the date a document was created in Custom Properties.
    Just type in $PRP:"SW-Created Date" and the date the document was
    created will appear as a custom property. Now what if you want this
    date in another format?

    First of all the documentation in help (Linking Notes to Document
    Properties) states, "The formats of the dates are language and region
    dependent. For details, see Start/Settings/Control Panel/Regional
    Settings/Date on your computer." This is all well and good except there
    are two types of date formats that can be set (on XP). There is a long
    and a short date format. SW uses the long format. I want the short
    format (mm/dd/yy) in a custom property. In addition, SW tacks on the
    time which I don't want. The documentation should really read, "The
    formats of the dates are language and region dependent. For details,
    see Start/Settings/Control Panel/Regional Settings/Date on your
    computer for the long format date. In addition SolidWorks appends the
    time in the specified time format." This setup may be different on
    different MicroSoft OS but I don't think so. I would really like the
    short format date without time appended for some applications.

    So why can't I apply some kind of format to what appears in a custom
    property value? Perhaps the Format(string,format) VB function could be
    made to work. Perhaps in the properties.txt file a field could be added
    for text/number/date/truefalse and another field with a format template
    for the same. ==>Perhaps properties.txt could become properties.xml
    with a whole bunch of user configurable properties including word wrap,
    font, size, etc. <==
     
    TOP, May 10, 2006
    #1
  2. TOP

    Eddie Guest

    TOP,
    Actually, there are 4 date formats that can be used:

    SW-Created Date => Wendnesday, May 10, 2006 12:51:33 PM (Includes
    time.)
    SW-Short Date => 5/10/06 (Does not include time.)
    SW-Long Date => Wendnesday, May 10, 2006 (Does not include time.)
    SW-Last Saved Date => Wendnesday, May 10, 2006 12:51:33 PM (Includes
    time & is updated with every save.)

    The options I looked at for Start/Settings/Control Panel/Regional
    Settings/Date for WIN2000 & WIN XP both provide for customization of
    format for day, month, year, time and separators.
    We use several of the above with the formats we desire, including
    Short Date in the format of mm/dd/yy.
    Am I missing something?
    I do agree that the settings could be easier to set and that the
    "properties.txt" file could be leveraged much more.
    Regards,
    Eddie
     
    Eddie, May 10, 2006
    #2
  3. TOP

    TOP Guest

    Yup, those parameters were in the help. I was going to use created date
    along with file creator to automatically provide the model creation
    date and initials for the title block. I didn't test it, but I believe
    the SW-Short Date would place the current date in the Custom Property
    every time I opened the model. This is not what I want.
     
    TOP, May 10, 2006
    #3
  4. TOP

    matt Guest

    I use a property called Date and use a macro hooked up to a hotkey when
    I want to update it. I get the mm/dd/yy format.
    '**************************************************************
    ' today.swb written by Joe Jones of New Hampshire CAD 7/13/99
    ' www.nhcad.com Mechanical Design and Custom Programming
    '
    '**************************************************************
    Dim swApp As Object
    Dim DrawingDoc As Object
    Sub main()
    Set swApp = CreateObject("SldWorks.Application")
    Set DrawingDoc = swApp.ActiveDoc
    retval = DrawingDoc.DeleteCustomInfo("date")
    retval = DrawingDoc.AddCustomInfo("date", "Date", Str(Date))
    DrawingDoc.EditRebuild
    End Sub
     
    matt, May 10, 2006
    #4
  5. TOP

    TOP Guest

    Matt,

    Thanks for the snippet, or more properly thank Joe. Now if I can call
    an addin from a macro I am all set.
     
    TOP, May 10, 2006
    #5
  6. TOP

    mr.T Guest

    Is there a way to run this macro automatically when start a new drawing?

    Perhaps attaching it to drawing template.
     
    mr.T, May 12, 2006
    #6
  7. TOP

    TOP Guest

    I do this when I save the drawing. Or more properly right after. And I
    put the dates in the part/assy, not the drawing.
     
    TOP, May 12, 2006
    #7
  8. TOP

    mr.T Guest

    I do not feel like going around and set up a "Run Macro Toolbox" icons plus
    it would require someone to actually click on it and this may be for some
    people here too hard or too complicated.

    We put this "Creation Date" in DWG properties ( I do not really remember why
    but it looked like good idea when we started doing this) and for me perfect
    solution would be attaching macro to sheet or template and have it run on
    "Create new Drawing" , now if I just know how to do this..
     
    mr.T, May 12, 2006
    #8
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.