×
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

save as macro

save as macro

save as macro

(OP)
I need a macro to save as.  Task scheduler doesn't save as .sat or .x_t which is 2 of the 4 file types I need.  Anyone know where I can get one?  Preferably free.

Grant
Certified SolidWorks Associate
SW2009 X64 SP 1.0
Dell Precision T5400
Nvidia Quadro FX 5600
Xeon 2.5GHz Quad Core, 4GB RAM
XP Pro X64 SP2.0
 

RE: save as macro

(OP)
I have used it and didn't know there was a free version!!
Checking it out now.

Grant
Certified SolidWorks Associate
SW2009 X64 SP 1.0
Dell Precision T5400
Nvidia Quadro FX 5600
Xeon 2.5GHz Quad Core, 4GB RAM
XP Pro X64 SP2.0
 

RE: save as macro

(OP)
Arg!  Only saves out to .step.   

Grant
Certified SolidWorks Associate
SW2009 X64 SP 1.0
Dell Precision T5400
Nvidia Quadro FX 5600
Xeon 2.5GHz Quad Core, 4GB RAM
XP Pro X64 SP2.0
 

RE: save as macro

I was able to generate files with the right name, but I've never used them, so I do not know how to see if they saved correctly.  That being said, try this:

Option Explicit
    Dim swApp                   As Object
    Dim swModel                 As Object
    Dim sPartName               As String
    Dim sPartXT                 As String
    Dim sPartSAT                As String
    Dim nErrors                 As Long
    Dim nWarnings               As Long
    Dim bRet                    As Boolean

Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc

    sPartName = Left(swModel.GetTitle, Len(swModel.GetTitle) - 7)
    sPartXT = "C:\" & sPartName + ".x_t"
    sPartSAT = "C:\" & sPartName + ".sat"
    
    bRet = swModel.SaveAs4(sPartXT, swSaveAsCurrentVersion, swSaveAsOptions_Silent, nErrors, nWarnings)
    bRet = swModel.SaveAs4(sPartSAT, swSaveAsCurrentVersion, swSaveAsOptions_Silent, nErrors, nWarnings)

End Sub
 

RE: save as macro

Do you need to process a batch of files at one time... or simply the current open file?

If the current open file, you could modify one of these and get it to work.  The mod is typically easy, just change the code to a different file extension.

I can't access fcsuper's site right now... don't know why.  http://sw.fcsuper.com/index.php

He has two macros that save drawings as pdf's.  It is a simple change to make it work with parts and change to other file types.

Doing a batch process is another story.  My guess is the anglesix batch process can be modified.  I know Luke Malpass is quite active on the SolidWorks forums (over at solidworks.com) and he can probably tweak it for you.

 

-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
 

RE: save as macro

(OP)
saving the currently open file would be fine.  Will those save all config's out as indiviual step sat etc.?  I will have a couple part files with 600 configs.

Grant
Certified SolidWorks Associate
SW2009 X64 SP 1.0
Dell Precision T5400
Nvidia Quadro FX 5600
Xeon 2.5GHz Quad Core, 4GB RAM
XP Pro X64 SP2.0
 

RE: save as macro

Shaggy,
It's the free "Express" version that won't do the file type desired.  The Express version saves 8 types.  The full version does 40.  I doubt he would add more file types to the free version when the pay version does them.

-handleman, CSWP (The new, easy test)

RE: save as macro

grunt,
Have a look at DocExport on Lenny's site:
http://www.lennyworks.com/solidworks/default.asp?ID=20

Sounds like it does just what you are looking for.

handleman,
agreed.  I have not had the opportunity to play with BatchProcess.  Thanks for the info.

-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
 

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