×
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

Instability of custom properties saved using a VB program

Instability of custom properties saved using a VB program

Instability of custom properties saved using a VB program

(OP)
I first noticed this issue in SW2007 SP3.0 but it could have been there before. In SP5.0 it is still there. It occurs quite often but not all the time and it is unpredictable. What happens is I create a model then I run my program to input the values of its custom properties like description, material, finish etc. My model is part of an assembly and when I create the assembly drawings, its properties show nicely in the BOM. I also create a drawing of the model and its properties show in the title block. I save averything, save drawings as PDFs as well and close SW.

When I open the assembly drawing next time I notice that some of the lines in the BOM are empty. I open the corresponding models and their custom properties are gone. Their drawings have the fields in the title block empty.

I go through the same steps again and when I restart SW and open the assembly drawings the same BOM lines are empty again.

I go through the same steps again but after I define the properties (using my VB program) I verify that the properties are there, using the menu File/Properties.
(or in some cases I create and fill custom properties "manually" without the aid of a macro or program).
Then I check the assembly drawing again and close SW.

Now when I reopen the assembly drawing the lines are not empty anymore.

It occurs with some of the parts in SW2007 x32 and x64. It was the same on my old computer and my new computer so it's not hardware dependent.

It's so strange it is unbelievable.

RE: Instability of custom properties saved using a VB program

Sounds more like a problem with files not getting saved.

RE: Instability of custom properties saved using a VB program

We haven't seen this problem at all.  We are still using the same VBA macro I wrote in 2003 and (if file properties are to be believed) last modified in January 2005.  You said "VB program" - is it a separate app, or a VBA macro?  Does it happen often enough that it might be reproducible with a little testing, or does it just happen often enough to be annoying/aggravating in your daily use?  Can you post?

RE: Instability of custom properties saved using a VB program

TheTick may be on the right track.  You said you "Save everything".  Does that mean you save each individual file explicitly, or do you save the drawing, which saves the assembly, which saves the parts?  It may be possible that somehow the part file is not being marked as "dirty" when its custom properties are accessed via the particular VB/VBA calls you use.  When you save an assembly, it only saves referenced parts that have been marked as "dirty".  You could determine if your program is marking files as dirty by adding a couple of lines in your code to check the save flag (using ModelDoc2::GetSaveFlag) both before and after custom properties are accessed.  

RE: Instability of custom properties saved using a VB program

Perhaps add a rebuild into your macro to force the file to be marked for saving.

batHonesty may be the best policy, but insanity is a better defense.bat
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Instability of custom properties saved using a VB program

(OP)
Guys, I am using SW for eight years. At first I thought too it was a problem of not saving files but when it happened again and again you imagine I was very careful with my saving. So I did save each part, assembly and drawing individually.

I am using an exe application written in VB6 and which worked flawlessly till know. I rewritten it recently to include latest updates to SW API but with no effect.

I have rebuild included in my application.

I told you it's hard to believe. I don't expect a solution. When it will happen next time I will post my files.

RE: Instability of custom properties saved using a VB program

Yes this happens to us on a random base. I have found that after changing the properties and not clicking the save button, the properties would not be saved with the drawing and part. I would click the X in the upper right.
Now our parts are automatically saved with each properties update. On drawings I have to manually save them. No issues anymore.

The reason I do not automatically save the drawing is because the SolidWorks dialog would popup behind my Visual Basic macro dialog in the being. Users would sit idol for hours waiting for SolidWorks to save. I could change this, but our people are trained now.

Bradley
SolidWorks Pro 2008 x64 SP1.1
PDM Works, Dell XPS Intel(R) Pentium(R) D CPU
3.00 GHz, 5 GB RAM, Virtual memory 12577 MB, nVidia 3400
e-mail is Lotus Notes

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