Control Q - Save Macro?
Control Q - Save Macro?
(OP)
I've been experiencing problems with SW2009 where the views aren't matching the model. From what I can tell it seems to fix itself if you hide the views and show them again or if you do a Control Q on the model and go back to the drawing... To help with this issue I'm wondering if anyone has a Macro that has a build in Control Q Then Save option? (FYI, I'm already using SP 3.0)






RE: Control Q - Save Macro?
Joe Hasik, CSWP/SMTL
SW 09 x64, SP 3.0
Dell T3400
Intel Core2 Quad
Q6700 2.66 GHz
3.93 GB RAM
NVIDIA Quadro FX 4600
RE: Control Q - Save Macro?
CODE
Dim swDwg As SldWorks.DrawingDoc
Dim vViews As Variant
Dim vView As Variant
Dim myView As SldWorks.View
Dim sLinkedBom As String
Dim Msg As String
Sub main()
Set swApp = Application.SldWorks
If swApp.ActiveDoc.GetType <> swDocDRAWING Then
MsgBox "Active document is not a drawing."
Exit Sub
End If
Set swDwg = swApp.ActiveDoc
Msg = "Forced update for views on " & swDwg.GetCurrentSheet.GetName & vbCrLf
vViews = swDwg.GetCurrentSheet.GetViews
For Each vView In vViews
Set myView = vView
If Not (Left(myView.GetName2, 1) = "*") Then
myView.SetVisible False, False
swDwg.EditRebuild3
myView.SetVisible True, False
End If
Next vView
MsgBox Msg
End Sub
-handleman, CSWP (The new, easy test)
RE: Control Q - Save Macro?
Thanks Again,
Todd
RE: Control Q - Save Macro?
Would there be a way to add a save command at the end, once the views are all shown again?
RE: Control Q - Save Macro?
swDwg.Save3 swSaveAsOptions_Silent, empty, empty
-handleman, CSWP (The new, easy test)
RE: Control Q - Save Macro?
RE: Control Q - Save Macro?
-handleman, CSWP (The new, easy test)
RE: Control Q - Save Macro?
All I did was moved the MsgBox down a line and copied and pasted the above code... Is there an issue with that, does it have to be done a different way?
RE: Control Q - Save Macro?
Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group
RE: Control Q - Save Macro?
RE: Control Q - Save Macro?