Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom property question 2

Status
Not open for further replies.

mackman

Mechanical
Oct 12, 2004
12
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
 
Replies continue below

Recommended for you

Hi, Mackman:

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
 
You need to use the "SW-Short Date" and not the "SW-Created Date".
 
mackman,
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
 
Alex

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
 
Stoker,

doesn't the SW-Short Date keep updating to the current date?
 
Hi, Stoker & Mackman:

"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
 
mackman,
Joe Jones has a very good site that will help with customizing properties.


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
 
Thanks Bradley

Alex,

The website Bradley shows has a today macro that might help you too.

Thanks


 
You can strip characters off the date string in a macro. Also the TIME settings in Regional Options (control panel) will have an effect on the way a date is displayed via a macro.
 
Bradley

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?

 
jmongan,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor