mdrummond
Industrial
- Feb 21, 2008
- 37
Hello,
I want to extract my file properties to a spread sheet. I found some code below, but I believe it needs some tweeking. I am no programmer, that's for sure. Can anyone take a crack at this thing, and make it work as a macro for excel?
SYMPTOM/PROBLEM
---------------
How do you extract the file properties for a Solid Edge file using VB
Automation API?
SOLUTION/WORKAROUND
-------------------
All the file properties that are listed under the "File/Properties" dialog can
be extracted by a VB propgram or a VBA macro in a spreadsheet. Just make sure
that your project has a reference to the type library called "Solid Edge File
Properties". The sample code below can be modified to suit your needs:
Sub GetFileProps()
Dim objPropSets As PropertySets
Dim objProps As Properties
Dim objProp As Property
Set objPropSets = CreateObject("SolidEdge.FileProperties")
Call objPropSets.Open("c:\temp\Part1.par")
'For Each objProps In objPropSets
' For Each objProp In objProps
' Debug.Print objProps.Name, ": ", objProp.Name, " = ", objProp.Value
' Next
'Next
Set objProps = objPropSets.Item("ProjectInformation")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
Set objProps = objPropSets.Item("SummaryInformation")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
Set objProps = objPropSets.Item("MechanicalModeling")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
Set objProps = objPropSets.Item("Custom")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
End
End Sub
I want to extract my file properties to a spread sheet. I found some code below, but I believe it needs some tweeking. I am no programmer, that's for sure. Can anyone take a crack at this thing, and make it work as a macro for excel?
SYMPTOM/PROBLEM
---------------
How do you extract the file properties for a Solid Edge file using VB
Automation API?
SOLUTION/WORKAROUND
-------------------
All the file properties that are listed under the "File/Properties" dialog can
be extracted by a VB propgram or a VBA macro in a spreadsheet. Just make sure
that your project has a reference to the type library called "Solid Edge File
Properties". The sample code below can be modified to suit your needs:
Sub GetFileProps()
Dim objPropSets As PropertySets
Dim objProps As Properties
Dim objProp As Property
Set objPropSets = CreateObject("SolidEdge.FileProperties")
Call objPropSets.Open("c:\temp\Part1.par")
'For Each objProps In objPropSets
' For Each objProp In objProps
' Debug.Print objProps.Name, ": ", objProp.Name, " = ", objProp.Value
' Next
'Next
Set objProps = objPropSets.Item("ProjectInformation")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
Set objProps = objPropSets.Item("SummaryInformation")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
Set objProps = objPropSets.Item("MechanicalModeling")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
Set objProps = objPropSets.Item("Custom")
For Each objProp In objProps
Debug.Print objProp.Name, " = ", objProp.Value
Next
End
End Sub