×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Custom property question
2

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

RE: Custom property question

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

RE: Custom property question

You need to use the "SW-Short Date" and not the "SW-Created Date".

RE: Custom property question

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

RE: Custom property question

(OP)
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

RE: Custom property question

(OP)
Stoker,

doesn't the SW-Short Date keep updating to the current date?

RE: Custom property question

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

RE: Custom property question

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

(OP)
Thanks Bradley

Alex,

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

Thanks


RE: Custom property question

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.

RE: Custom property question

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?

RE: Custom property question

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources