Toggle broken-view macro
Toggle broken-view macro
(OP)
Very often I will go to a page that has a broken view and the view is not broken. By that I mean the view still has the broken-view lines, but there is no clear gap between the lines.
See pic: h ttp://paul -flores.co m/solidwor ks_screens hots/broke n_view.jpg
I have to right-click the view, pick "un-break view", then break the again.
I thought instead of doing this several times a day, a broken-view toggle would be the better way to do this.
Preconditions: view is pre-selected
1. Un-break view
2. Break view
The problem is that it only works with the original view. It doesn't work with different views on different pages.
Can anybody help correct this problem?
See pic: h
I have to right-click the view, pick "un-break view", then break the again.
I thought instead of doing this several times a day, a broken-view toggle would be the better way to do this.
Preconditions: view is pre-selected
1. Un-break view
2. Break view
CODE
' ******************************************************************************
' macro recorded on 06/18/08
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
boolstatus = Part.Extension.SelectByID2("", "FACE", 0.1035512874926, 0.06293938349189, -1999.382179705, False, 0, Nothing, 0)
Part.UnBreakView
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("", "FACE", 0.09800694802044, 0.06776054825029, -1999.382179705, False, 0, Nothing, 0)
Part.BreakView
Part.ClearSelection2 True
End Sub
' macro recorded on 06/18/08
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
boolstatus = Part.Extension.SelectByID2("", "FACE", 0.1035512874926, 0.06293938349189, -1999.382179705, False, 0, Nothing, 0)
Part.UnBreakView
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("", "FACE", 0.09800694802044, 0.06776054825029, -1999.382179705, False, 0, Nothing, 0)
Part.BreakView
Part.ClearSelection2 True
End Sub
The problem is that it only works with the original view. It doesn't work with different views on different pages.
Can anybody help correct this problem?






RE: Toggle broken-view 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: Toggle broken-view macro
That being said, in this case your macro recorder has recorded the location of your selections. That's why it only works on the first view. If you'll get rid of all the code dealing with selections, the macro will work on whatever view you have pre-selected.
CODE
Sub main()
Set swDwg = Application.SldWorks.ActiveDoc
swDwg.UnBreakView
swDwg.BreakView
End Sub
-handleman, CSWP (The new, easy test)
RE: Toggle broken-view macro
Because of the non-disclosure agreement I don't think I can post the text of the SPR fixes, but I think my problem may have been fixed with SPR# 391246 in SP4.0
Flores