×
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

API issue with manual prompt to save children

API issue with manual prompt to save children

API issue with manual prompt to save children

(OP)
Hello again,
I am in the process of running a macro that I created to open up all the files in a directory, dig around, add some custom properties etc.  It works great.  Largely due to the help I received from numerous individuals on this forum.

The issue I am having is that about 5% of the files, upon saving and closing will require manual input to continue the operation.  SW will essentially prompt me to save some child component of the assembly it was performing the operation on.

Is there a command I can add to the code to always "say yes" to the prompt of "do you want save..."  Or is there some other way to get around the problem.

Thanks for everyone's help,
-Shaggy

RE: API issue with manual prompt to save children

Check out ModelDoc2::Save3 in the API help.  You want to add the save option swSaveAsOptions_SaveReferenced.  Since this is a bitmask enum you can simply add it to the "Options" argument of the Save3 function, like (to quote/modify the syntax of the help file):

CODE

retval = ModelDoc2.Save3(Options + swSaveAsOptions_SaveReferenced, &Errors, &Warnings )

RE: API issue with manual prompt to save children

(OP)
Handleman,
Thanks for the reply.

I have added the option to save referenced as well as tinkered with the option of avoid rebuild.  Unfortunately, neither of these had the effect I was hoping for.  I am still being prompted to save the occasional part.

Is there a way that I can do an if statement that essentially says:  If we receive a prompt, then click yes?

-Shaggy

RE: API issue with manual prompt to save children

You could try PTFB.  It's a separate utility that "Push[es] The Freakin' Button" for you.  I haven't used it myself, but I've heard of it.  It's a general Windows utility, not SW specific.

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