Custom property question
Custom property question
(OP)
Hey,
I am Using Custom Props to fill out my titleblocks, and would like to use the SW-Created Date to fill in the date on the drawing. The only problem is that it puts time along with the date, and I want just the date. Does anyone know of a way to get just the date. This would be a big help, because the rest of the Titleblock gets filed out by SAP.
Thanks
I am Using Custom Props to fill out my titleblocks, and would like to use the SW-Created Date to fill in the date on the drawing. The only problem is that it puts time along with the date, and I want just the date. Does anyone know of a way to get just the date. This would be a big help, because the rest of the Titleblock gets filed out by SAP.
Thanks






RE: Custom property question
We have the same problem. I don't think there is anything you can do as it is hard-coded incorrectly in SW. If you really need to do it, probably you need SW API to extract date portion from SW-Created Date. We just ignore the time portion. That is not a big issue to us. I hope that it is also not a big issue to you. The major issue that we've been having and I am pretty sure you are going to have is when you open a drawing and save it together with its model as a copy, you won't get correct date on your drawing. With any other software, when you save a file as something else, get a new create date, but not SolidWorks.
If you have correct date when you save an existing drawing as another file, please let me know.
Thanks,
Alex
RE: Custom property question
RE: Custom property question
We put our date in the properties of the model, because we need Drafter date, and Engineers date.
Private Sub cmdTodaysDate_Click() ' Drafters Date
txtSfDrawn_Date.Text = Format(Now, "short date")
End Sub
This is what we put on our template:
$PRPSHEET:"DRAWN_DATE"
There is a lot of other stuff that goes along with this, but this should give you some ideas.
Bradley
RE: Custom property question
good point on the new file creation. I thought I had found a macro that someone had created to update the date to the current date. I will take a look.
SAP has a created date also, but it comes in the wrong format. It looks like I will have to look into SAP further, and find how I can adjust the date format in that field. Does anyone have any experience with Gedas and SAP?
Thanks
RE: Custom property question
doesn't the SW-Short Date keep updating to the current date?
RE: Custom property question
"SW-Short Date" does not work in this case as it is a current date (or today's date). It is not true date when the document (drawing) was created. You have to use "SW-Created Date".
Thanks,
Alex
RE: Custom property question
Joe Jones has a very good site that will help with customizing properties.
http://www.nhcad.com/old/html/cprops.html
Start small with maybe just the date. Then build from there, who knows you may some day have your macros fill in all of your title block.
Bradley
RE: Custom property question
Alex,
The website Bradley shows has a today macro that might help you too.
Thanks
RE: Custom property question
Just in case you aren't satisfied yet (that's our nature...isn't it?) Here is a suggestion from Solidworks...
http://www.solidworks.com/swexpress/mar03/200303_t...
I haven't tried the engdate yet.
good luck.
dsgnr1
RE: Custom property question
RE: Custom property question
How do you use the code below to automate the short created date?
Private Sub cmdTodaysDate_Click() ' Drafters Date
txtSfDrawn_Date.Text = Format(Now, "short date")
End Sub
I would love to use this in my custom properties, but I am not sure how to go about entering the code in there to make it work. Do you have a program written that uses that code in some other way?
RE: Custom property question
I do not have time right now to go through the code and explain how it works. What I can do for you is zip up the whole thing and send it to you. It is custom for our company and will not run out of the box. You will have to have Visual Basic 6.0 to open it.
Brjjohnson at dstoutput dot com
Bradley