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

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.
Reply to
Loading thread data ...
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
Reply to
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.
Reply to
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.
T> Yup, those parameters were in the help. I was going to use created date
'************************************************************** ' today.swb written by Joe Jones of New Hampshire CAD 7/13/99 '
formatting link
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
Reply to
If memory serves me correctly, I have tested this in the past and it works just as you stated (current date not created date). I could not find a way to make a short created date. That has been at least one release back though. Things might have changed since I tested it. dunno!
Reply to
Seth Renigar
Thanks for the snippet, or more properly thank Joe. Now if I can call an addin from a macro I am all set.
Reply to
Is there a way to run this macro automatically when start a new drawing?
Perhaps attaching it to drawing template.
Reply to
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.
Reply to
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..
Reply to

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.