Guys,
I need your help. I want to be able to read the current active file (field in the property page) and write that value to a non-active file (field in the property page). Both files are open by the same program (Inventor).
My current codes allow me to read the fields. I just cannot able to combine the codes to write it to a non-active file while reading the active file
Thanks in advance.
Tony
Public Sub Test3()
' Declare the Application object
Dim oApplication As Inventor.Application
' Obtain the Inventor Application object.
' This assumes Inventor is already running.
Set oApplication = GetObject(, "Inventor.Application")
' Set a reference to the active document.
' This assumes a document is open.
Dim oDoc As Document
Set oDoc = oApplication.ActiveDocument
Dim oDoc1 as Document
Set oDoc1 =?????
' Obtain the PropertySets collection object
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets
Dim oPropsets1 As PropertySets
Set oPropsets1 = oDoc.PropertySets
' Get a reference to the "Description" property.
Dim oProp As Property
Dim oProp1 as Property
Dim sRead As String
'==========================================================
'reading the current active file (value from property page)
'project tab - field 5
Set oProp = oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kDescriptionDesignTrackingProperties)
sRead = oProp.Value
'==========================================================
'==========================================================
'writing to a non-active file, non-active file is in the background opened by the same program
'file location is C:\TWD.DRAWING1.IDW
'Set oProp1 = oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kDescriptionDesignTrackingProperties)
oProp.Value = sRead
'==========================================================
End Sub
I need your help. I want to be able to read the current active file (field in the property page) and write that value to a non-active file (field in the property page). Both files are open by the same program (Inventor).
My current codes allow me to read the fields. I just cannot able to combine the codes to write it to a non-active file while reading the active file
Thanks in advance.
Tony
Public Sub Test3()
' Declare the Application object
Dim oApplication As Inventor.Application
' Obtain the Inventor Application object.
' This assumes Inventor is already running.
Set oApplication = GetObject(, "Inventor.Application")
' Set a reference to the active document.
' This assumes a document is open.
Dim oDoc As Document
Set oDoc = oApplication.ActiveDocument
Dim oDoc1 as Document
Set oDoc1 =?????
' Obtain the PropertySets collection object
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets
Dim oPropsets1 As PropertySets
Set oPropsets1 = oDoc.PropertySets
' Get a reference to the "Description" property.
Dim oProp As Property
Dim oProp1 as Property
Dim sRead As String
'==========================================================
'reading the current active file (value from property page)
'project tab - field 5
Set oProp = oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kDescriptionDesignTrackingProperties)
sRead = oProp.Value
'==========================================================
'==========================================================
'writing to a non-active file, non-active file is in the background opened by the same program
'file location is C:\TWD.DRAWING1.IDW
'Set oProp1 = oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kDescriptionDesignTrackingProperties)
oProp.Value = sRead
'==========================================================
End Sub