My question is: Does anyone have macro that open the drawing, updates
(ctrl+Q) it and saves it again?
I could try running it with the Task Scheduler to seee if it works.
Better than CTRL-Q is the forcerebuilt function in SolidWorks API. Do
you want to open all the files in a particular folder on your
harddrive, or just one file at a time? This doesn't sound like a hard
macro to make.
Matt Lorono
http://sw.fcsuper.com
Entire folders, have to run around 10k drawings.
There is a problem when updating documents if you do not follow the order
of: part, assemblies and the drawings.
I.e.. update the part documents first, then the assemblies and finally the
drawings.
It is logical, if you think about it, but the scheduler will only update
document by document folder listing.
Updating by the folder listing will result in document updating in the wrong
order.
Example:-
1part.sldprt
1part.slddrw
2part.sldprt
2part.slddrw
assem1.sldasm
assem1.slddrw
This would work.
part1.sldprt
part1.slddrw
part2.sldprt
part2.slddrw
assem1.sldasm
assem1.slddrw
This will not work as the assembly documents will update BEFORE the part and
part drawing documents.
Pete
"Ronni" <r...@tresu.dk> wrote in message
news:1188562070....@o80g2000hse.googlegroups.com...
http://www.solidworks.com/swexpress/pages/may06/TT_Datasets.html
. Update Assistant - Customers participating in the jumpSTART program are
provided a tool to help with this process. The Update Assistant will:
. Force a rebuild on all documents
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
. Compare the document between two versions of SolidWorks
. Compare any differences between drawings in the different versions of
SolidWorks.
The Update Assistant is also limited in the process and methodology testing
but will insure the files open in the new version. This tool, just like the
Conversion Wizard, should be used in conjunction with function validation
testing to insure complete functional coverage.
I had a hunt around google 4 u
"Ronni" <r...@tresu.dk> wrote in message
news:1188991347.9...@r34g2000hsd.googlegroups.com...
>From KEN at eng-tips:
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim strPathAndFilename As String
Dim strResponse As String
Dim strFileType As Long
Dim longstatus As Long
Dim longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
strPathAndFilename = "C:\Temp\Part1.SLDDRW"
strResponse = vbYes
If StrComp((UCase$(Right$(strPathAndFilename, 7))), ".SLDPRT",
vbTextCompare) = 0 Then
strFileType = swDocPART
ElseIf StrComp((UCase$(Right$(strPathAndFilename, 7))), ".SLDASM",
vbTextCompare) = 0 Then
strFileType = swDocASSEMBLY
ElseIf StrComp((UCase$(Right$(strPathAndFilename, 7))), ".SLDDRW",
vbTextCompare) = 0 Then
strFileType = swDocDRAWING
End If
Set swModel = swApp.OpenDoc6(strPathAndFilename, strFileType, 0,
"", longstatus, longwarnings)
Set swModel = swApp.ActivateDoc2(strPathAndFilename, False,
longstatus)
If (swModel Is Nothing) Then
strResponse = MsgBox("The file could not be found." & Chr(13)
& "Routine Ending.", vbCritical, "FileOpenRebuildSaveClose")
End
End If
If (swModel.IsOpenedReadOnly = "False") Then
If (swModel.GetType <> swDocDRAWING) Then
'Shade Part
swModel.ViewDisplayShaded
'Set view
'swModel.ShowNamedView2 "*Isometric", 7
'swModel.ShowNamedView2 "*Trimetric", 8
swModel.ShowNamedView2 "*Dimetric", 9
'Set Feature Manager Splitter Position
swModel.FeatureManagerSplitterPosition = 0.3
End If
'Rebuild File
'swModel.EditRebuild3 'Stoplight or [Ctrl]+B
swModel.ForceRebuild '[Ctrl]+Q
'Zoom to extents
swModel.ViewZoomtofit2
'Save
swModel.Save2 False
Else
strResponse = MsgBox("The file is Read-Only." & Chr(13) & "Do
you want to close the file without Saving?", vbCritical + vbYesNo,
"FileOpenRebuildSaveClose")
End If
Set swModel = Nothing
If (strResponse = vbYes) Then
'Close
swApp.CloseDoc strPathAndFilename
End If
Set swApp = Nothing
End Sub