' ******************************************************************************
' swxJRNL.swj - journal recorded on 10/16/01 by magene
' ******************************************************************************

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 = CreateObject ("SldWorks.Application")
Set Part = swApp.OpenDoc4 ("M:\Work In Progress\Canyon Dynamics\batteryPack\batteryPack.SLDASM", 2, 0, "", longstatus)
Set Part = swApp.ActivateDoc ("batteryPack.SLDASM")
swApp.LoadFile2 "D:\GENE\canyonDynamics\batteryPack\batteryCase.SLDASM", ""
Set Part = swApp.ActiveDoc
Set Part = swApp.OpenDoc4 ("D:\GENE\canyonDynamics\batteryPack\batteryCase.SLDASM", 2, 0, "", longstatus)
Set Part = swApp.ActivateDoc ("batteryCase.SLDASM")
Part.SelectByID "bulkhead-1@batteryCase", "COMPONENT", 0, 0, 0
' MSGBOX
' You cannot replace a component with another of the same name (but different directory) using Component Properties. 
' Please use Reload/Replace instead

Part.SelectByID "bulkhead-1@batteryCase", "COMPONENT", 0, 0, 0
Part.ComponentReload
Part.ClearSelection
Part.FileReload
Part.SelectByID "bulkhead-2@batteryCase", "COMPONENT", 0, 0, 0
Part.SelectByID "bulkhead-1@batteryCase", "COMPONENT", 0, 0, 0
Part.SelectByID "packAssy-1@batteryCase", "COMPONENT", 0, 0, 0
Part.ComponentReload
Part.ClearSelection
Part.FileReload
' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' The file M:\Work In Progress\Canyon Dynamics\batteryPack\packAssy.SLDASM could not be opened.
' The reason may be that the filename is invalid or that a different part with the same name is already open.

Set Part = swApp.ActivateDoc ("batteryPack.SLDASM")
Set Part = Nothing
swApp.CloseDoc "batteryPack.SLDASM"
Set Part = swApp.ActivateDoc ("batteryCase.SLDASM")
Part.SelectByID "packAssy-1@batteryCase", "COMPONENT", 0, 0, 0
Part.ComponentReload
Part.ClearSelection
Part.FileReload
' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

' MSGBOX
' A document named "packAssy" is already opened. Do you want to show this already-opened document?

Part.SelectByID "packAssy-1@batteryCase", "COMPONENT", 0, 0, 0
Part.CompConfigProperties3 0, 0, 1, 1
Part.SelectByID "packAssy-1@batteryCase", "COMPONENT", 0, 0, 0
Part.CompConfigProperties3 2, 0, 1, 1
Part.ClearSelection
Set Part = Nothing
swApp.CloseDoc "batteryCase.SLDASM"
Set Part = swApp.OpenDoc4 ("M:\Work In Progress\Canyon Dynamics\batteryPack\batteryCase.SLDASM", 2, 0, "", longstatus)
Set Part = swApp.ActivateDoc ("batteryCase.SLDASM")
Part.SelectByID "packAssy-1@batteryCase", "COMPONENT", 0, 0, 0
Part.ComponentReload
Part.ClearSelection
Part.FileReload
Part.SelectByID "packAssy-1@batteryCase", "COMPONENT", 0, 0, 0
Part.SelectByID "bulkhead-2@batteryCase", "COMPONENT", 0, 0, 0
Part.SelectByID "bulkhead-1@batteryCase", "COMPONENT", 0, 0, 0
Part.ComponentReload
Part.ClearSelection
Part.FileReload
Part.SelectByID "shell-1@batteryCase", "COMPONENT", 0, 0, 0
Part.ComponentReload
Part.ClearSelection
Part.FileReload
' 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
swApp.ExitApp
End Sub
