Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Update drawings

71 views
Skip to first unread message

Ronni

unread,
Aug 31, 2007, 8:07:50 AM8/31/07
to
I tried using the Task Schduler to update to 2007... And it didnt work
very well. But then I noticed that you can use the program to run a
macro. Which could help me with one of my problem.. that when it saves
a drawing it dosnt update (ctrl+Q) it, which means I have to update
all the drawings manually at a later point.

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.

fcsuper

unread,
Aug 31, 2007, 10:41:50 AM8/31/07
to

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

fcsuper

unread,
Aug 31, 2007, 10:45:19 AM8/31/07
to
BTW, I re-posted your question here: http://www.eng-tips.com/viewthread.cfm?qid=196399&page=1
You may wish to check there for responses over the next few days.

Jeff

unread,
Aug 31, 2007, 12:12:51 PM8/31/07
to
Ronnie I have one that does this using the API call for forced rebuild
but I need to know if you want to run on entire folder or just a
single drawing file.

Ronni

unread,
Sep 3, 2007, 1:49:18 AM9/3/07
to

Entire folders, have to run around 10k drawings.

<petefa#$"1@f2s.com >

unread,
Sep 5, 2007, 5:33:00 AM9/5/07
to
Ronnie

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...

Ronni

unread,
Sep 5, 2007, 7:22:27 AM9/5/07
to
I know these things and have been doing them in that order, but still
there was a lot I had to update manually and it dont force a rebuild a
long the way. And it wont work in anyway once I start with assemblies
that consist of more than a few parts. Also I had to copy the files to
another folder and run it from there since the scheduler have
difficulties planning more than around 500 files. So I manually moved
the parts 500 by 500 to another folder and then ran the updates from
there, in the order parts, parts used for half fabricated pieces,
assemblies and then drawings. This is as you point out very logical,
and was nessesary to get it to work just a little. But this procedure
is very time consuming with my current 130k SW files (have done around
70k now), and when I discover that I have to update them once more
just because it dont cause a force rebuild it is wastet work.

<petefa#$"1@f2s.com >

unread,
Sep 5, 2007, 10:07:08 AM9/5/07
to
You may need to speak to your VAR, as the update assistant, should force a
rebuild on all documents.

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...

fcsuper

unread,
Sep 7, 2007, 11:09:52 AM9/7/07
to
> > just because it dont cause a force rebuild it is wastet work.- Hide quoted text -
>
> - Show quoted text -

>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

0 new messages