Guys,
Below is my current code. The code writes a value to a field in the
current active document.
Instead of writing the value to the current field (assuming the field
value is there already), how can I make it read that field's value
from the active document and write the value to a file that is not
currently active (sitting in the background within the program which is
located in c:\temp). Btw, the API unique name is the same on both
pages.
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
' Obtain the PropertySets collection object
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets
' Get a reference to the "Date Checked" property.
Dim oProp As Property
Dim PartNum As String
Set oProp =
oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kStockNumberDesignTrackingProperties)
' Define a Date variable with the desired date.
PartNum = "9836-scoobie1"
' Assign the date to the property.
oProp.Value = PartNum
End Sub
Thanks in advance,
Tony
Below is my current code. The code writes a value to a field in the
current active document.
Instead of writing the value to the current field (assuming the field
value is there already), how can I make it read that field's value
from the active document and write the value to a file that is not
currently active (sitting in the background within the program which is
located in c:\temp). Btw, the API unique name is the same on both
pages.
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
' Obtain the PropertySets collection object
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets
' Get a reference to the "Date Checked" property.
Dim oProp As Property
Dim PartNum As String
Set oProp =
oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kStockNumberDesignTrackingProperties)
' Define a Date variable with the desired date.
PartNum = "9836-scoobie1"
' Assign the date to the property.
oProp.Value = PartNum
End Sub
Thanks in advance,
Tony