' ******************************************************************************
' swxJRNL.swj - journal recorded on 03/26/03 by hamilton
' *****************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.OpenDoc4 ("C:\Documents and Settings\hamilton\My Documents\MyDorado\MultiBeam MidBodies\Hardware\5_16-18UNC SCREW ASSY.SLDASM", 2, 0, "", longstatus)
Set Part = swApp.ActivateDoc ("5_16-18UNC SCREW ASSY")
swApp.ActiveDoc.ActiveView.FrameLeft = 0
swApp.ActiveDoc.ActiveView.FrameTop = 0
swApp.ActiveDoc.ActiveView.FrameState = 1
swApp.ActiveDoc.ActiveView.FrameState = 1
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ActiveView().RotateAboutCenter 0.0263104, -0.0558421
Part.ActiveView().RotateAboutCenter 0.0328881, -0.0398872
Part.ActiveView().RotateAboutCenter 0.0263104, -0.0398872
Part.ActiveView().RotateAboutCenter 0.0131552, -0.0398872
Part.ActiveView().RotateAboutCenter 0.00657761, -0.0319098
Part.ActiveView().RotateAboutCenter 0.00657761, -0.0239323
Part.ActiveView().RotateAboutCenter 0.0131552, -0.0239323
Part.ActiveView().RotateAboutCenter 0.0197328, -0.0319098
Part.ActiveView().RotateAboutCenter 0.0328881, -0.0478647
Part.ActiveView().RotateAboutCenter 0.00657761, -0.0159549
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.0159549
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, 0
Part.ActiveView().RotateAboutCenter 0.0131552, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0.00657761, 0
Part.ActiveView().RotateAboutCenter 0.00657761, -0.00797744
Part.ActiveView().RotateAboutCenter 0, -0.00797744
boolstatus = Part.Extension.SelectByID("Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "SKETCH", 0, 0, 0, False, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "SKETCH", 0, 0, 0, False, 0, Nothing)
Part.EditSketch
Part.ClearSelection
boolstatus = Part.Extension.SelectByID("HexWidth@Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "DIMENSION", -0.0835077151728, 0.04887203834194, 0.03730037102094, False, 0, Nothing)
boolstatus = Part.Extension.SelectByID("HexWidth@Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "DIMENSION", -0.004874850845763, 0.06765751408049, 0, False, 0, Nothing)
Part.ClearSelection
boolstatus = Part.Extension.SelectByID("HexWidth@Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "DIMENSION", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("HexWidth@Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "DIMENSION", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Point16", "SKETCHPOINT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Point17", "SKETCHPOINT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line5", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line6", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line9", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line10", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line12", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line13", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line2", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line3", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line4", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Arc1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing)
Part.ViewZoomTo2 -0.0390707, 0.0325384, -0.0273127, 0.0279989, -0.0313625, -0.0273127
Part.ViewZoomTo2 -0.0227281, 0.0153848, -0.0273127, 0.00957006, -0.0124318, -0.0273127
Part.SetPickMode
Part.ClearSelection
Part.SetPickMode
boolstatus = Part.Extension.SelectByID("Line5", "SKETCHSEGMENT", -0.003861003321282, 0.0007803207884417, 0, False, 0, Nothing)
boolstatus = Part.Extension.SelectByID("Line5", "SKETCHSEGMENT", -0.003932780740257, 0.0008217615006088, 0, False, 0, Nothing)
boolstatus = Part.Extension.SelectByID("HexWidth@Sketch3@SOCKET HEAD CAP SCREWS (U.S.)-1@5_16-18UNC SCREW ASSY", "DIMENSION", -0.01174957866043, 0.01862043831539, 0.03730037102094, False, 0, Nothing)
' MSGBOX
' This dimension is over defined.  Its value cannot be changed.

Part.EditDelete
' MSGBOX
' The sketch can now find a valid solution.

boolstatus = Part.Extension.SelectByID("Line5", "SKETCHSEGMENT", -0.004257870511321, 0.001009452167443, 0, False, 0, Nothing)
Part.ClearSelection
Part.InsertSketch2 True
Part.ActiveView().RotateAboutCenter -0.00657761, 0
Part.ActiveView().RotateAboutCenter -0.0328881, -0.0319098
Part.ActiveView().RotateAboutCenter -0.0328881, -0.0478647
Part.ActiveView().RotateAboutCenter -0.0394657, -0.0478647
Part.ActiveView().RotateAboutCenter -0.0657761, -0.0797744
Part.ActiveView().RotateAboutCenter -0.0394657, -0.0638195
Part.ActiveView().RotateAboutCenter 0, -0.00797744
Part.ShowNamedView2 "*Isometric", 7
Part.EditAssembly
' MSGBOX
' Some of the models referenced in this document have been modified.  They must be saved when the document is saved.
' 		Save the document and the referenced models now?

Part.Save2 FALSE
Set Part = Nothing
swApp.CloseDoc "5_16-18UNC SCREW ASSY"
swApp.ExitApp
End Sub
